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

CALL FUNCTION update_function IN UPDATE TASK

Former Member
0 Likes
1,233

hi

please give me an <b>example for implementation</b> of CALL FUNCTION update_function IN UPDATE TASK

plz help.. its urgent

useful solutions will be rewarded

<b>note</b>: dont give me link. i need simple straight forward example

thanks

ravish

1 ACCEPTED SOLUTION
Read only

former_member150733
Contributor
0 Likes
782

...

CALL FUNCTION zfunc_name IN UPDATE TASK.

...

...

COMMIT WORK.

IN UPDATE TASK flags the function module func for execution in the update task.

It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task. Update function modules must be flagged as such in the Function Builder -> Attributres.

3 REPLIES 3
Read only

Former Member
0 Likes
782

Hi,

if you set a function to be update task, you write some DB access statemen like delete or update, and return the function. Those DB access won't be submitted to DB, until you run COMMIT WORK. When run commit, all of update task FMs before this commit will be runned, as they are in the same LUW

CALL FUNCTION 'TH_IN_UPDATE_TASK'

IMPORTING

in_update_task = lv_update_process.

<b>Reward points</b>

Regarsd

Read only

former_member150733
Contributor
0 Likes
783

...

CALL FUNCTION zfunc_name IN UPDATE TASK.

...

...

COMMIT WORK.

IN UPDATE TASK flags the function module func for execution in the update task.

It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task. Update function modules must be flagged as such in the Function Builder -> Attributres.

Read only

varma_narayana
Active Contributor
0 Likes
782

Hi,

When u want to call function which has to be executed in the Update work process.

1. You have to set the "Processing Type" to "Update Module" and select "Immediate Start" which makes the function to be processed using V1 update process(for critical updates)

function module parameters must be passed by using Pass by Value only.

Export parameters are not supported.

In the source code of the function

to perform a ROLLBACK in case of any error

Generate a message using type A(Abend)

2. Call the function from the program using

CALL FUNCTION 'Z_FM' in update task

EXPORTING

-


TABLES

-


.

COMMIT WORK .

hope this will help.

Reward if so.

Regards,

Varma