Application Development 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: 

CALL FUNCTION XXX UPDATE TASK

gcp
Explorer
0 Kudos

Hello Experts,

Good Day!

I'm working on a user exit where a couple of existing custom FM is implemented as below, each FM updates different field from table LT_TAB_UPDATE.

CALL FUNCTION XX1 in UPDATE TASK

TABLES = LT_TAB_UPDATE

CALL FUNCTION XX2 in UPDATE TASK

TABLES = LT_TAB_UPDATE

Now, i have a new requirement to update a new field and planning to implement a new FM, i don't want to touch the existing FM's.

CALL FUNCTION XX3 in UPDATE TASK

TABLES = LT_TAB_UPDATE

I cant find anything in the forum if it's allowed to have multiple update task in one LUW but base on debugging it seems that multiple update task doesn't work as expected. Can anyone confirm if this is allowed or not?

Thanks,

Dimmak

1 ACCEPTED SOLUTION

horst_keller
Product and Topic Expert
Product and Topic Expert

Why don't you read the documentation for CALL FUNCTION IN UPDATE TASK and COMMIT WORK instead of searching forums?

8 REPLIES 8

horst_keller
Product and Topic Expert
Product and Topic Expert

Why don't you read the documentation for CALL FUNCTION IN UPDATE TASK and COMMIT WORK instead of searching forums?

0 Kudos

Hello Horst,

Thanks for that, to be honest, I've done reading that already and the way i understand it is that it should be allowed however during my testing the fields are not getting updated that is why i wanted some confirmation.

Thanks,

Dimmak

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yep, at COMMIT WORK the processing of all update function modules registered with IN UPDATE TASK is triggered. If it not works for you, something else is wrong.

0 Kudos

Hello,

Still, here is the 6th sentence :

"If the statement is executed during the update task, the addition IN UPDATE TASK is ignored."

Sounds clear to me.

Bertrand

Sandra_Rossi
Active Contributor
0 Kudos

The update task (if any) occurs at the end of the SAP LUW. There's only one. It's triggered by COMMIT WORK (only if there's at least one CALL FUNCTION IN UPDATE TASK since the beginning of the current SAP LUW). A new SAP LUW is started at the beginning of an internal session (SUBMIT, transaction, etc.) and after every COMMIT WORK or ROLLBACK WORK.

I don't fully understand your question, please give more details about your scenario.

0 Kudos

Hello Sandra,

Thanks for your comments, my issue is related to the scenario below. Three FMs executed in UPDATE TASK which are called inside a user exit, updating different fields using the same table as parameter, for some reason the fields are not getting updated so I'm wondering if this is allowed.

CALL FM1 IN UPDATE TASK ( this update field flight date)

TABLE = LT_FLIGHT

CALL FM2 IN UPDATE TASK ( this update field flight time )

TABLE = LT_FLIGHT

CALL FM3 IN UPDATE TASK ( this update field flight day)

TABLE = LT_FLIGHT

Thanks,

Dimmak

0 Kudos

Yes allowed. Consider the parameters being passed like "by value" as they are saved into a system table at call time

Former Member
0 Kudos

Hi,

You can call any number of FMs in UPDATE TASK in a single SAP LUW, once the COMMIT WORK statement is executed, all registered FMs will execute in update work process. Now if your field is not getting updated then there should be something wrong in your FM. Please use SM13 t-code to check if your update FM went to any error. Also you can use UPDATE DEBUGGING to debug your update FM.