2008 Jul 30 8:27 PM
Hi,
I've successfully called a number of BAPIs in VBA, however am getting a problem with BAPI_COMPANYCODE_GETDETAIL
It doesn't seem to pick up the structure of the tables - the 'Tables' objects just get set to 'nothing' rather than pulling back the structure, like it should. The call itself doesn't fail but obviously no data is returned.
Much appreciate any ideas!
Set oSAPFunctions = CreateObject("SAP.Functions")
Set oSAPBapiFn = oSAPFunctions.Add("BAPI_COMPANYCODE_GETDETAIL")
Set oSAPECC = oSAPBapiFn.Exports("COMPANYCODEID")
Set oSAPICCD = oSAPBapiFn.Tables("COMPANYCODE_DETAIL")
'Set oSAPICCA = oSAPBapiFn.Tables("COMPANYCODE_ADDRESS")
Set oSAPTRet = oSAPBapiFn.Tables("RETURN")
oSAPECC.Value = "xxxx"
If oSAPBapiFn.Call = False Then
iRet = False
Else
'worked
EndIf
Hi,
I've successfully called a number of BAPIs in VBA, however am getting a problem with BAPI_COMPANYCODE_GETDETAIL
It doesn't seem to pick up the structure of the tables - the 'Tables' objects just get set to 'nothing' rather than pulling back the structure, like it should. The call itself doesn't fail but obviously no data is returned.
Much appreciate any ideas!
Set oSAPFunctions = CreateObject("SAP.Functions")
Set oSAPBapiFn = oSAPFunctions.Add("BAPI_COMPANYCODE_GETDETAIL")
Set oSAPECC = oSAPBapiFn.Exports("COMPANYCODEID")
Set oSAPICCD = oSAPBapiFn.Tables("COMPANYCODE_DETAIL")
'Set oSAPICCA = oSAPBapiFn.Tables("COMPANYCODE_ADDRESS")
Set oSAPTRet = oSAPBapiFn.Tables("RETURN")
oSAPECC.Value = "xxxx"
If oSAPBapiFn.Call = False Then
iRet = False
Else
'worked
EndIf
2008 Jul 30 9:15 PM
Hi,
Could you in your call pass empty values for tables. IMHO such behaviour is mandatory.
/wg
2008 Jul 31 8:13 AM
Hi wg,
Thanks for your reply, however I'm not entirely sure what you mean: the TABLES parameters are returned FROM the function module?
However I attempted what I thought you meant and changed the code as below:
Set oSAPFunctions = CreateObject("SAP.Functions")
Set oSAPBapiFn = oSAPFunctions.Add("BAPI_COMPANYCODE_GETDETAIL")
Set oSAPECC = oSAPBapiFn.Exports("COMPANYCODEID")
Set oSAPICCD = oSAPBapiFn.Tables("COMPANYCODE_DETAIL")
'Set oSAPICCA = oSAPBapiFn.Tables("COMPANYCODE_ADDRESS")
Set oSAPTRet = oSAPBapiFn.Tables("RETURN")
oSAPICCD("COMP_CODE").Value = "" <---- new line
oSAPECC.Value = "xxxx"
If oSAPBapiFn.Call = False Then
iRet = False
Else
'worked
EndIf
However I got the error that oSAPICCD hadn't been set yet, probably because it doesn't seem to be pulling down the structure of COMPANYCODE_DETAIL from SAP (i.e. being set to 'Nothing').
2008 Jul 31 1:13 PM
There is such limitation in SAP adapter for BizTalk:
"By default, table parameters are not surfaced in the response message. If you require table parameters in response message, you must pass empty table parameters in the request message."
Do you receive anything in the return?
/wg
2008 Jul 31 1:19 PM
Hi wg,
No, nothing is filled into RETURN but this is because the RETURN structure is not copied down to the object variable either. So it is 'Nothing' like the others.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |