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

Execute a FM in background

Former Member
0 Likes
13,156

I need to execute a FM in background. Can I use

CALL FUNCTION - IN BACKGROUND TASK for this purpose?

Regards,

Pooja

I need to execute a FM in background. Can I use

CALL FUNCTION - IN BACKGROUND TASK for this purpose?

Regards,

Pooja

5 REPLIES 5
Read only

Former Member
0 Likes
7,305

Calling the FM in Backgroung marks a flags for that function module func to be run asynchronously. That is, it is not executed at once. Instead, the data passed using EXPORTING or TABLES is placed in a database table and the next COMMIT WORK executes it in another work process.

Regards,

Prakash.

Read only

Former Member
0 Likes
7,305

for call function

IN UPDATE TASK is available. I am not sure about IN BACKGROUND TASK.

alternatively you can write it in a program and assign this to the background job.

Regards

srikanth

Read only

Former Member
0 Likes
7,305

HI,

Function modules that you call using CALL FUNCTION ... IN BACKGROUND TASK DESTINATION are registered for background execution in another SAP System when the program reaches the next COMMIT WORK statement (using Remote Function Call). After the COMMIT WORK, the dialog process does not wait for these function modules to be executed (asynchronous update). All of the function modules that you register in this way are executed together in a single database LUW

if you want to run in normal background i mean the same system, then there is no need to write any thing, you can use call FUNCTION MODULE statment. but make sure that GUI_* and WS_* function modules do not work in background

Regards

Sudheer

Read only

0 Likes
7,305

I placed the break-point at Commit work and checked for the processes in sm50. When the execution atopped at the break-point I pressed F6 and then refreshed the work processes in sm50 but I was not able to find my backgroud process. I could only see the dialog process. Is it possible for me to debug this from process overview?

Regards,

Pooja

Read only

0 Likes
7,305

Hi,

probably (but u have to test this),is possible.

Just program an endless loop in your background task. Then in SM50 just debug the WP and u should enter in code of the endless loop.

for example.

data : x value '5'.

do.

if x = '10'.

exit.

endif.

enddo.

Thn in debug modify the value of the "x" to exit from the loop.

Hope it helps

Bye

Andrea

Pls reward if it helps