ABAP Background Processing System Fields

SY-BATCH is the variable to check if your program is running in the background or not. If it carries the value ‘X’, this means that the program is running in the background.

 
 

SY-BINPT is the variable to check if your program is being processed in a batch input session or not. If it carries the value ‘X’, this means that you have a case of a batch input.

 
 

Having SY-BINPT = ‘X’ doesn’t necesserily mean that SY-BATCH will also equal ‘X’. It’s a good idea to be careful about this distinction and check both if you want a code snippet to be processed only if the program is executed in the foreground. Sample code:

 
 

  check sy-batch is initial and

        sy-binpt is initial.

 
 

First line makes sure that the program is not being executed in the background. Second line makes sure that the program is not being processed in a batch input session.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s