2013 Sep 09 9:35 AM
Hi,
When creating a sales order, may I know how to identify if it is created manually using VA01 transaction, BDC method via EDI IDoc processing or through 'BAPI_SALESORDER_CREATEFROMDAT2' call?
To differentiate EDI from VA01, I may refer to system variable syst-binpt.
How about the BAPI call? How can I identify that the order is being created using a BAPI?
Thanks much for your guidance.
Thanks, Nick
2013 Sep 09 2:28 PM
You could also look for the BAPI FM in the stack (not valid when in update task of course, but there it is always too late), the code could look like :
CALL FUNCTION 'SYSTEM_CALLSTACK'
IMPORTING
et_callstack = lt_callstack.
LOOP AT lt_callstack TRANSPORTING NO FIELDS WHERE eventname CS 'BAPI'.
EXIT.
ENDLOOP.
IF sy-subrc NE 0 " Not a BAPI
AND sy-batch IS INITIAL " Not a background job
AND sy-binpt IS INITIAL. " Not a batch inputRegards,
Raymond
2013 Sep 09 2:06 PM
2013 Sep 09 2:12 PM
Hi,
You have to may be enhance the VBAK table to add custom fields and record the T-Code in a custom field. You can code in the USEREXIT_SAVE_DOCUMENT or USEREXIT_SAVE_DOCUMENT_PREPARE exits and perform modifications you need to internal table vbak and xvbap.Standard SAP program will then update the database tables for you.
Cheers,
Arindam
2013 Sep 09 2:28 PM
You could also look for the BAPI FM in the stack (not valid when in update task of course, but there it is always too late), the code could look like :
CALL FUNCTION 'SYSTEM_CALLSTACK'
IMPORTING
et_callstack = lt_callstack.
LOOP AT lt_callstack TRANSPORTING NO FIELDS WHERE eventname CS 'BAPI'.
EXIT.
ENDLOOP.
IF sy-subrc NE 0 " Not a BAPI
AND sy-batch IS INITIAL " Not a background job
AND sy-binpt IS INITIAL. " Not a batch inputRegards,
Raymond
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |