Application Development 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: 

General BADi question:Call BADi in background job/batch input. Possible?

Former Member
0 Kudos

Hi out there,

i'm using thoe following BADi: /SAPSLL/CTRL_SD0C_R3 (Global Trade Service).

But also, this question is a general question.

If we are calling on screen the transaction VF01, the BADi is called correctly.

But unfortunately it seemes that the BADi is NOT called (im not really sure, cause i can't debug the background task) when we are calling a batch input sequence wth f.e. form bdc_transaction VF01 nothing happens.

Maybe BADi cannot be called in a background task? If it's possible, how could it be monitored. Thare isw no spool entry or anything like that!

Any answer can help.

Thank you in advance!

Regards,

Timo

Edited by: Timo Ehl on Apr 14, 2009 7:27 PM

1 ACCEPTED SOLUTION

martin_voros
Active Contributor
0 Kudos

Hi,

generally BADIs are called in background mode. You can use the following trick to debug your BADI. You just need to create an infinite loop in your BADI implementation. Something like this.


DATA: l_a TYPE c.
WHILE l_a IS INITIAL.
ENDWHILE.

Obviously when your BADI is called in background mode then program will get into infinite loop. You can easily connect and debug running programs from transaction SM50. You need to select your background process and go to Program/Session -> Program -> Debugging. You will jump directly into your BADI methos with infinite loop. Then you will just set value to l_a and you will start debugging your BADI. If you can not find any process then your BADI is not called in background mode.

Cheers

3 REPLIES 3

naimesh_patel
Active Contributor
0 Kudos

System would call all the BAdI, user exit in Background job also.

Try to capture the active job:

Go to SM37

Select your Job (Job must be Active)

Menu Job > Capture: Active Job

Check this help - look for the section "To debug an active job"

http://help.sap.com/saphelp_nw04/helpdata/en/c4/3a8009505211d189550000e829fbbd/content.htm

Regards,

Naimesh Patel

martin_voros
Active Contributor
0 Kudos

Hi,

generally BADIs are called in background mode. You can use the following trick to debug your BADI. You just need to create an infinite loop in your BADI implementation. Something like this.


DATA: l_a TYPE c.
WHILE l_a IS INITIAL.
ENDWHILE.

Obviously when your BADI is called in background mode then program will get into infinite loop. You can easily connect and debug running programs from transaction SM50. You need to select your background process and go to Program/Session -> Program -> Debugging. You will jump directly into your BADI methos with infinite loop. Then you will just set value to l_a and you will start debugging your BADI. If you can not find any process then your BADI is not called in background mode.

Cheers

0 Kudos

Its fixed by Put infinite loop.

Anil Ahuja