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

System Variable to Identify Background Task?

former_member208149
Participant
0 Likes
1,829

Hi,

Is there any system variable to identify whether a FM is called in background task, similar to SY-BATCH which is set when program is run in background mode.

[I have checked SY-BATCH, it is not set in case of BACKGROUND TASK.]

I need to put some condition inside the FM when it is run in background task as below:

CALL FUNCTION 'Z_TEST'
    IN BACKGROUND TASK
    DESTINATION 'NONE'
...
...
.

Is there any way to identify this using any existing system parameters or any other FM ?

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,317

Not sure, but you could look in the Abap stack (call FM SYSTEM_CALLSTACK) for function AFRC_EXECUTE?

Read only

pokrakam
Active Contributor
0 Likes
1,317

Depends on what you consider "Background". What if it's running in Web GUI, Web Dynpro, UI5, mobile?

If it's specifically SapGUI related, then you could use FM GUI_IS_AVAILABLE