Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Call BAPI_PRODORDCONF_GET_TT_PROP from vb

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

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
4 REPLIES 4

former_member200754
Participant
0 Kudos

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

raghug
Active Contributor
0 Kudos

Can you clarify your question a bit - Is the question where you get the CONF_NO from?

raymond_giuseppi
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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