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

background check

Former Member
0 Likes
424

please suggest me how to change the following code from foreground check to background execution

FORM FOREGROUND_CHECK.

DATA: V_TITLE(35) TYPE C.

IF SY-BATCH = ' X'. "executed in background

V_TITLE = SY-CPROG.

MESSAGE E224 WITH V_TITLE.

EXIT. "abort running this program.

ENDIF.

ENDFORM. "FOREGROUND_CHECK

3 REPLIES 3
Read only

Former Member
0 Likes
396

FORM FOREGROUND_CHECK.

DATA: V_TITLE(35) TYPE C.

IF SY-BATCH = space. "executed in foreground

V_TITLE = SY-CPROG.

MESSAGE E224 WITH V_TITLE.

EXIT. "abort running this program.

ENDIF.

ENDFORM. "FOREGROUND_CHECK

Read only

Former Member
0 Likes
396

Hello,

Check this


FORM FOREGROUND_CHECK.

DATA: V_TITLE(35) TYPE C.

<b>IF SY-BATCH = '  '. "executed in foreground</b>

V_TITLE = SY-CPROG.

MESSAGE E224 WITH V_TITLE.

EXIT. "abort running this program.

ENDIF.

ENDFORM. "FOREGROUND_CHECK 

Vasanth

Read only

Former Member
0 Likes
396

FORM FOREGROUND_CHECK.

DATA: V_TITLE(35) TYPE C.

IF SY-BATCH = ' X'. "executed in background(<u>make this space to make it foreground)</u>

V_TITLE = SY-CPROG.

MESSAGE E224 WITH V_TITLE.

EXIT. "abort running this program.

ENDIF.

ENDFORM. "FOREGROUND_CHECK

When you make a background check you need to submit your report using the submit statement.

Please check the below.

IF P_BATCH = 'X'.

PERFORM GET_DATE_N_TIME.(give date and time)

CHECK V_REL NE 'A'.

PERFORM JOB_OPEN.(use job open function module)

PERFORM GET_PRINT_PARAMS.(specify print parameters)

PERFORM SUBMIT_PROGRAM.(submit program)

PERFORM JOB_CLOSE.(close job)

PERFORM POPUP_TO_INFORM.(popup which would tell you the jobname ect)

endif.

reward i it helps