Monday, 22 December 2014

current execution is a batch job (background) or a dialog job(foreground)

SY-BATCH indicates if the current execution is a batch job (background) or a dialog job(foreground). If sy-batch is 'X', then the execution is in the background.

Suppose if you want to write logic for 2 diff. situations.

1. when program runs in foreground output shold be in excel

2.  when program runs in background output shold store in application server as a file.

To determine whether program is running forground or background we will can
use  SY-BATCH

IF SY-BATCH =  'X'.

  Background.

ELSE.

FOREground
ENDIF.

No comments:

Post a Comment