2011 Aug 29 8:56 AM
Hi All,
I have one exit which is called during PO change. I want to distinguish whether this exit is called through BAPI or ME22N. Is there any runtime parameter which can show us that we are inside BAPI?
Note:I can not put check ( If sy-tcode NE ME22n) to check BAPI.
Hi All,
I have one exit which is called during PO change. I want to distinguish whether this exit is called through BAPI or ME22N. Is there any runtime parameter which can show us that we are inside BAPI?
Note:I can not put check ( If sy-tcode NE ME22n) to check BAPI.
2011 Aug 29 10:04 AM
2011 Aug 29 10:07 AM
I believe there is NO system parameter for identifying the BAPI called behaviour, if you don't want to use sy-tcode option then use EXPORT/IMPORT option.
EXPORT a flag from either a custom wrapper BAPI over standard BAPI or use implicit enhancement of standard BAPI for it.
BR,
Diwakar
2011 Aug 29 10:09 AM
You could use the FM 'SYSTEM_CALLSTACK' in your exit, this would give you the origin of the call to the exit.
Vikranth
2011 Aug 29 10:22 AM
It depends on which exit you are using. For example, in the BADI "ME_PROCESS_PO_CUST" you can identify whether the method Implementation is executed from a BAPI call by tracking the value of instance attribute "FOR_BAPI"( value 'X' if called from BAPI and ' ' otherwise) of class CL_PO_HEADER_HANDLE_MM (Refer to parameter IM_HEADER type IF_PURCHASE_ORDER_MM of badi method PROCESS_HEADER).
Regards, Vinod
2011 Aug 29 11:09 AM
Hi,
SY-TCODE won't work as it will return the original program name where from BAPI is call and there can be many such program.
IMPORT/EXPORT is also not a option , as said that there can be many program in system calling BAPI and many new programs could be written, so not a generalize solution.
We are updating one custom table in standard peace of code( modification to standard ) , so no parameter exist as suggested like in some BADI.
Will check for call stack.
Isn't any parameter where business object behind the current BAPI call is available? Any hint will be very helpful.
Thanks all for your inputs and help so far.
2011 Aug 29 12:29 PM
Hi Anurag ....
WHen you are executing me22n or me21n or me59n ... there will be value in sy-tcode . user exit are nothing but function module only .
if bapi is executed using zreport then its transaction code will be there i.e SE38 / transaction code if any given for report .
so you can check for me22n . if it is me22n then only execute other code else not .
regards
Deepak.
2013 Aug 23 9:51 PM
Try checking global variable 'call_bapi'. If it is 'X', then it is a BAPI call. CALL_BAPI will be blank otherwise.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |