Application Development and Automation 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: 
Read only

Calling BAPI in VBA

Former Member
0 Likes
626

Hi, friends

i'm calling SalesOrder BAPI in VBA but it initiate error when i create object of SalesOrder, a log file is generated i'm unable to understand what the problem is ... kindly view the log at the end.

is this the issue of BASIS to develop currect RFC Function?

plz help its urgent !!!...

'----


'--


BAPI Call--


'----


Dim obSalesOrder As Object

Dim ologonCtrl As Object

Dim Flag As Boolean

Dim str As String

SAPLogonControl1.Client = "<client>"

SAPLogonControl1.User = "<username>"

SAPLogonControl1.Language = "E"

SAPLogonControl1.Password = "<pwd>"

SAPLogonControl1.SystemNumber = "02"

SAPLogonControl1.System = "<system>"

SAPLogonControl1.ApplicationServer = "<server>"

SAPBAPIControl1.Connection = SAPLogonControl1.NewConnection()

Flag = SAPBAPIControl1.Connection.Logon(0, True)

'---- Logfile -


SAPBAPIControl1.LogLevel = 9

SAPBAPIControl1.LogFileName = "c:\IDES_Log.trc"

'---- Transaction -


a = SAPBAPIControl1.CreateTransactionID()

SAPBAPIControl1.TransactionID = a

'----- create object --- but initiate error.

Set obSalesOrder = SAPBAPIControl1.GetSAPObject("SalesOrder", "1000000175")

'----


' generated log...

'----


ed Mar 05 16:27:42 2008

SAP.BAPI up and running (version 710 )

loaded from c:\PROGRA~1\sap\frontend\sapgui\wdobapiu.ocx

120: BackEnd Release 700 WITH BAPI support

120: >>swo_type_info_get(40614176, R36.800, , SalesOrder)

120: *** ERROR => <<swo_type_info_get(40614176, R36.800, , SalesOrder) [ 2152]

120: *** ERROR => RfcCall() error 18 [ 2153]

120: *** ERROR => An internal RFC-Error occurred.

Error-key: RFC_ERROR_SYSTEM_FAILURE

Description: See RFC trace file or SAP system log for more details

cpic-status: ???

Internal State: ??? [ 776]

Wed Mar 05 16:27:55 2008

120: CWdoAutoCtrl::WDTOnFinalReleaseConnections

120: >>SAP BAPI Control object deleted

1 REPLY 1
Read only

Former Member
0 Likes
374

Check ST22 to see if it created a dump. It might have a bit more info for you.

And no, besided helping you find the fault, your basis guys cant do much about an internal RFC error.

Edited by: John de Villiers on Mar 7, 2008 11:46 AM