Posted: Wed Apr 02, 2008 11:03 pm Post subject: Creting PO through Visual Basic
Dim functionCtrl As Object
Dim sapConnection As Object
Dim theFunc As Object
Private Sub Command1_Click()
Set functionCtrl = CreateObject("SAP.Functions")
Set sapConnection = functionCtrl.Connection
sapConnection.Client = "220"
sapConnection.User = "PTBITUSR"
sapConnection.Password = "HELLO2"
sapConnection.Language = "EN"
If sapConnection.Logon(0, False) True Then
MsgBox "No connection to R/3 System"
Exit Sub 'End program
Set theFunc = functionCtrl.Add("BAPI_PO_CREATE")
Dim pocur As Object
Dim poheader As Object
Dim poitems As Object
Dim poitemschedule As Object
Dim retMess As Object
Dim returnFunc As Boolean
Dim startzeil As Integer
Dim endcol As Integer
Dim the_name As String
Set poheader = theFunc.exports.Item("PO_HEADER")
Set poitems = theFunc.Tables.Item("PO_ITEMS")
Set poitemschedule = theFunc.Tables.Item("PO_ITEM_SCHEDULES")
Set pocur = theFunc.exports.Item("PO_HEADER_ADD_DATA")
poheader.Value("VENDOR") = "0024001291" 'Text1.Text
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.