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

RE:CALL FUNCTION update_function IN UPDATE TASK

alex_georgek
Associate
Associate
0 Likes
354

Hi,

Can anyone give a sample code or a simple scenario for CALL FUNCTION update_function IN UPDATE TASK .

Thanks in advance,

Alex.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
319

Hello George

In a project dealing with material master data I had the problem that I needed to update standard as well as customer tables at the same time when the user pushed the SAVE button.

For the standard tables I used BAPI_MATERIAL_MAINTAINDATA_RT (retail material) and for the customer tables I created my own SAVE function modules.

How to ensure that either both (standard and custom) tables are updated or not simultaneously?

I created a special SAVE function module which called both the standard BAPI and my custom SAVE function modules.

This "wrapper" SAVE function module was then called IN UPDATE TASK.

This way I created a LUW (logic unit of work) which comprised both standard and custom tables. If everything was ok both types of tables were updated, otherwise the entire transaction was rolled back.

Further reading: [Special LUW Considerations|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbae3435c111d1829f0000e829fbfe/content.htm]

Regards

Uwe

1 REPLY 1
Read only

uwe_schieferstein
Active Contributor
0 Likes
320

Hello George

In a project dealing with material master data I had the problem that I needed to update standard as well as customer tables at the same time when the user pushed the SAVE button.

For the standard tables I used BAPI_MATERIAL_MAINTAINDATA_RT (retail material) and for the customer tables I created my own SAVE function modules.

How to ensure that either both (standard and custom) tables are updated or not simultaneously?

I created a special SAVE function module which called both the standard BAPI and my custom SAVE function modules.

This "wrapper" SAVE function module was then called IN UPDATE TASK.

This way I created a LUW (logic unit of work) which comprised both standard and custom tables. If everything was ok both types of tables were updated, otherwise the entire transaction was rolled back.

Further reading: [Special LUW Considerations|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbae3435c111d1829f0000e829fbfe/content.htm]

Regards

Uwe