05-14-2013 7:28 AM
Hi Experts,
I have done one enhancement(BADI) in ME21N T-code( Purchase Inquisition filed is mandatory in ME21N T-code). Now I have to upload excel file in ME21N T-code. I have used BAPI_PO_CREATE when i call this function module one error message i am getting 'Please enter the Purchase requisition filed'. How i can upload with out mandatory field in ME21N T-code. I am using BAPI_PO_CREATE1 also i am getting error. Please send me a sample program.
05-14-2013 8:16 AM
Well, you have to change your check in the BAdI, do not check the field if the PO is created via a BAPI but check it when user use transaction. You could find it by analyzing call stack :
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 eq 0. " BAPI
Regards,
Raymond
05-14-2013 10:16 AM
Hi Mahesh,
You can use IMPORT and Export statements for your requirement.
For Example.
write export statement in your BAPI_PO_CREATE1 program.
EXPORT FLAG TO MEMORY ID 'FLAG_SET'
and in your badi,write,
IMPORT FLAG FROM MEMORY ID 'FLAG_SET'.
IF FLAG <> 'X'.
your badi code.
ENDIF.
Hope this will help you.