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

Using a BAPI remotely

0 Likes
705

Hello,

I'm using  BAPI_PBSRVAPS_GETDETAIL2 to get planning book data from APO (SCM) into ECC. I am developing this program in ECC and am calling the FM as follows:

CALL FUNCTION 'BAPI_PBSRVAPS_GETDETAIL2' IN BACKGROUND TASK DESTINATION 'SCDCL093'

The BAPI is a Remote-Enabled module.

My question is I need to use the tables available in the BAPI but cannot define internal tables with the same table type as those in the BAPI because those structures do not exist in ECC.

Does anyone have any advice on how to handle this?

1 REPLY 1
Read only

Sandra_Rossi
Active Contributor
0 Likes
549

Be careful, here you call using tRFC so you can't receive any values as it's asynchronous. Instead use sRFC (DESTINATION 'SCDCL093' alone) or call using aRFC with waiting for the answer.

For not redefining the types, there is a blog which explains one solution Dynamically Handling Structure Data Types Defined on a Remote Dictionary; there's also the possibility to wrap the RFC function module as a Web Service, this way you may create a client proxy at the consumer side, and the types are automatically generated.