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

BAPI_GOODSMVT_CREATE environment variable

Former Member
0 Likes
639

Hello:

I have the following situation:

I run an interface from legacy system to sap , this interface performs a goods receipt using : BAPI_GOODSMVT_CREATE . I need to put in the user exit: ZXMBC02 an environment variable to know I'm running the BAPI , these variables do not work me :

sy- TCODE EQ ' MB01 ' OR       

sy- TCODE EQ ' MIGO ' OR       

sy- CPROG EQ ' RS_TESTFRAME_CALL '

Thanks for the help

Best regards

1 ACCEPTED SOLUTION
Read only

SandySingh
Active Contributor
0 Likes
536

Hello

You have two options-

1. You can call the following FM in User Exit and read the program stack to know that control is coming from BAPI.

SYSTEM_CALLSTACK

2. You are set the memory ID in interface where you are calling the BAPi and read the memory ID in User exit.

Regards

Sandy

2 REPLIES 2
Read only

SandySingh
Active Contributor
0 Likes
537

Hello

You have two options-

1. You can call the following FM in User Exit and read the program stack to know that control is coming from BAPI.

SYSTEM_CALLSTACK

2. You are set the memory ID in interface where you are calling the BAPi and read the memory ID in User exit.

Regards

Sandy

Read only

Arun_Prabhu_K
Active Contributor
0 Likes
536

Hello Dante Amor.

     Make use of SY-CALLD variable.

     It will have 'X' if called from BDC/BAPI and blank if the tcode is executed directly.

Regards.