04-28-2017 10:19 AM
Hi all,
i tried a lot how to put thic bapi in to vb, but no success. It is not a first bapi call from vb for me, usualy i don't have problems with them.
Problem is, how and where to put CONF_NO in TIMETICKETS table from thhis BAPI.
Is there any example of this case?
Thx, Slavko
05-02-2017 8:16 AM
Either use CONF_NO or ORDERID, SEQUENCE, OPERATION and SUB_OPER fields when builidng the table of confirmations TIMETICKETS.
Could you post part of your code like
Set obSapFn = CreateObject("SAP.Functions")
Set obProdOrdConf = obSapFn.Add("BAPI_PRODORDCONF_GET_TT_PROP")
Set obTblProdOrdConf = obProdOrdConf.Tables("TIMETICKETS")
obTblProdOrdConf.FreeTable
‘Add rows to the table in some loop
obTblProdOrdConf.Rows.Add
obTblProdOrdConf.Value(obTblProdOrdConf.RowCount, "CONF_NO") = rueck
04-28-2017 11:03 AM
look similar code below.
' Example calling BAPI RFC_GET_TABLE_ENTRIES
Option Explicit
Public Functions As SAPFunctionsOCX.SAPFunctions
Private LogonControl As SAPLogonCtrl.SAPLogonControl
Private R3Connection As SAPLogonCtrl.Connection
Dim Func As SAPFunctionsOCX.Function
Public iTABLE_NAME As SAPFunctionsOCX.Parameter
Public eNUMBER_OF_ENTRIES As SAPFunctionsOCX.Parameter
Public tENTRIES As SAPTableFactoryCtrl.Table
Private Sub Main()
Dim ix As Integer
Dim retcd As Boolean
Dim SilentLogon As Boolean
Set LogonControl = CreateObject("SAP.LogonControl.1")
Set Functions = CreateObject("SAP.Functions")
Set TableFactory = CreateObject("SAP.TableFactory.1")
Set R3Connection = LogonControl.NewConnection
R3Connection.Client = "000"
R3Connection.ApplicationServer = "192.168.69.111"
R3Connection.Language = "EN"
R3Connection.User = "DEVELOPER"
R3Connection.Password = "19920607"
R3Connection.System = "WAS"
R3Connection.SystemID = "$WebAS"
R3Connection.SystemNumber = "18"
R3Connection.UseSAPLogonIni = False
SilentLogon = True
retcd = R3Connection.Logon(0, SilentLogon)
If retcd <> True Then MsgBox "Logon failed": Exit Sub
Functions.Connection = R3Connection
Set Func = Functions.Add("RFC_GET_TABLE_ENTRIES")
Set iTABLE_NAME = Func.Exports("TABLE_NAME")
Set eNUMBER_OF_ENTRIES = Func.Imports("NUMBER_OF_ENTRIES")
Set tENTRIES = Func.Tables("ENTRIES")
iTABLE_NAME.Value = "TCURR"
Func.Call
Debug.Print eNUMBER_OF_ENTRIES
For ix = 1 To tENTRIES.RowCount
Debug.Print tENTRIES(ix, 1)
Next
R3Connection.logoff
End Sub
05-01-2017 6:33 PM
Can you clarify your question a bit - Is the question where you get the CONF_NO from?
05-02-2017 8:16 AM
Either use CONF_NO or ORDERID, SEQUENCE, OPERATION and SUB_OPER fields when builidng the table of confirmations TIMETICKETS.
Could you post part of your code like
Set obSapFn = CreateObject("SAP.Functions")
Set obProdOrdConf = obSapFn.Add("BAPI_PRODORDCONF_GET_TT_PROP")
Set obTblProdOrdConf = obProdOrdConf.Tables("TIMETICKETS")
obTblProdOrdConf.FreeTable
‘Add rows to the table in some loop
obTblProdOrdConf.Rows.Add
obTblProdOrdConf.Value(obTblProdOrdConf.RowCount, "CONF_NO") = rueck
04-15-2018 1:35 PM
Hello,
thanks to both who answered, it helped me a lot. Now i can read notification out of SAP and send confirmation back.
Regrads, Slavko