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 Check in BADI Implementation

Former Member
0 Likes
1,006

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
784

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>,

3 REPLIES 3
Read only

Former Member
0 Likes
784

Hi Raghu,

If sy-tcode ne 'ME21'
 and sy-tcode ne 'ME21N'...

IMPORT lv_data ....

do processing...

endif.

Best regards,

Prashant

Read only

0 Likes
784

Dear Prashanth,

Can you please elobarate your answer please??

Regards,

Raghu.

Edited by: Raghu on Feb 17, 2009 2:11 PM

Read only

Former Member
0 Likes
785

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>,