‎2009 Feb 17 12:51 PM
Dear All,
We have made an enhancement through BADI in ME21N / ME22N transaction like validating certain entries, in that I am checking the t-codes ME21, ME21N, ME22 and ME22N. If it fails then PO wonu2019t create and populate some messages.
Now there is one custom program which creating POu2019s through calling BAPI in the program and itu2019s not validating the above as its calling through custom program.
(i.e SY-TCODE eq SE38)
Now how I should put a condition on BAPI in my BADI implementation?? If it is normal user exit, we can use runtime structure T158 and check the TCODE in that. But as I am using the BADI ME_PROCESS_PO_CUST with the method CHECK doesnu2019t have any transaction code info.
And currently I have an idea of using the GET / SET Parameters and need to set in the custom program and get that info in BADI? But I donu2019t know whether this idea good or not?? If anyone has any idea please let me know?
Thanks,
Raghu.
‎2009 Feb 17 1:12 PM
If the BADI is called through BAPI from the custom program.. You can try this condition..
IF SY-TCODE = ME21 or ME21N or ME22 or ME22N or SY-REPID = <custom program name>,
‎2009 Feb 17 1:04 PM
Hi Raghu,
If sy-tcode ne 'ME21'
and sy-tcode ne 'ME21N'...
IMPORT lv_data ....
do processing...
endif.Best regards,
Prashant
‎2009 Feb 17 1:11 PM
Dear Prashanth,
Can you please elobarate your answer please??
Regards,
Raghu.
Edited by: Raghu on Feb 17, 2009 2:11 PM
‎2009 Feb 17 1:12 PM
If the BADI is called through BAPI from the custom program.. You can try this condition..
IF SY-TCODE = ME21 or ME21N or ME22 or ME22N or SY-REPID = <custom program name>,