Skip to Content
0
Former Member
Feb 15, 2011 at 09:21 PM

Calling ABAP BAPI InspLotOperation.RecordResults via ActiveX control in VB6

81 Views

We are migrating an existing applicatioon that used the DCom Connector to call QM BAPIs to the ActiveX Control (SAPBAPIControl) that is included with the SAP GUI.

We have had no problem reading data from SAP. When writing data using RecordResults and passing it the object SingleResults all seems to work well.

When trying to write data using RecordResults and passing it the object CharResults nothing is written to SAP and both the objects Return and ReturnTable come back empty (Return = Error 0).

Sample Code:

Dim objInspLot As Object

Dim objReturn As Object

Dim objCharResults As Object

Dim objReturnTable As Object

Set objInspLot = SAPBAPIControl1.GetSAPObject("InspLotOperation", Me.txtInspLot.Text, "0010")

Set objReturn = SAPBAPIControl1.DimAs(objInspLot, "RecordResults", "Return")

Set objReturnTable = SAPBAPIControl1.DimAs(objInspLot, "RecordResults", "ReturnTable")

Set objCharResults = SAPBAPIControl1.DimAs(objInspLot, "RecordResults", "CharResults")

With objCharResults

.rows.Add

.Value(1, "INSPLOT") = CVar(Me.txtInspLot.Text)

.Value(1, "INSPOPER") = "0010"

.Value(1, "INSPCHAR") = 10

.Value(1, "CLOSED") = ""

.Value(1, "EVALUATED") = "X"

.Value(1, "EVALUATION") = "A"

End With

objInspLot.RecordResults Return:=objReturn, CharResults:=objCharResults, ReturnTable:=objReturnTable

This is a sample of the SAP_Errorlog.txt

Tue Feb 15 15:43:45 2011

4392: <<BAPI Call() OK

4392: <<Pop parameter (RETURN/RETURN)

4392: <<Pop table (CHARRESULTS/CHAR_RESULTS)

4392: <<Pop table (RETURNTABLE/RETURNTABLE)

4392: >>swo_free(116754400, QAI.777, 5)

4392: *** ERROR => swo_free(116754400, QAI.777, 5)<< [P.BAPI 2242]

4392: *** ERROR => RETURN: Code 8008 [P.BAPI 2286]

4392: *** ERROR => Errortype 2 [P.BAPI 2288]

4392: *** ERROR => Workarea OL [P.BAPI 2289]

4392: *** ERROR => Message 808 [P.BAPI 2290]

4392: *** ERROR => Text Object with runtime number '&' not defined [P.BAPI 2291]

4392: *** ERROR => Variable1 5 [P.BAPI 2292]

4392: *** ERROR => [8198] A runtime object of type 5 with the persistent key 0300000648040010 could not be released in the Business Object Repository.

Message-Nr: 808

Workarea: OL

R/3 error message: Object with runtime number '&' not defined [P.BAPI 3804]

Any help would be appreciated.