cancel
Showing results for 
Search instead for 
Did you mean: 

CALL TRANSACTION LT31 in an update task

former_member367551
Participant
0 Kudos

Dear experts,

I am implementing a function exit, EXIT_SAPLL03T_002 which is executed in an update task at the end of a TO confirmation. Here, I will need to trigger the TO printing upon confirmation, by calling the standard transaction LT31 (via BDC codes).

However, due to the nature of "in update task", I cannot use SUBMIT or CALL TRANSACTION statements. 😞

I have tried to wrap the BDC codes in an FM and call this FM "in background task", but the TO will NOT be printed at the end. 😞

How can I resolve this issue?

Accepted Solutions (1)

Accepted Solutions (1)

Sandra_Rossi
Active Contributor
0 Kudos

Make sure that the BDC works when you run it manually after the Transfer Order (TO) confirmation (the final database commit must have finished).

If it doesn't work when it's triggered via a CALL FUNCTION ... IN BACKGROUND TASK (tRFC), then it's probably due to the fact that the tRFC has started before the final database commit of the TO confirmation.

To make sure, you should do a test with a big wait at the beginning of the tRFC (10 seconds, to make sure the database commit is done).

If it still doesn't work, then your code is buggy as it's obvious it doesn't correspond exactly to the initial BDC (because you had initially made sure it was okay).

But if it works, then you're sure the solution is the wait, and you should replace the wait with a loop doing a SELECT on a table until the TO confirmation is done (I'm not expert in this subject, you'll find to find the SELECT by yourself).

former_member367551
Participant

Thank you Sandra. The "delay mechanism" you suggested proved to be working for me. 🙂

Answers (1)

Answers (1)

former_member367551
Participant
0 Kudos

I have tried to wrap the BDC codes in an FM and call this FM "in background task", but the TO will NOT be printed at the end. 😞

The statement above applies to TO with the requirement type, "L".

For TOs with the requirement type, "P", this works perfectly fine.

Any ideas on how I can resolve this?