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

how to update database in update task

Former Member
0 Likes
2,868

Hi everyone,

I have a question: I need to update database in a SAP LUW. And I develop a method in my class

to update the database.how can I update database in SAP LUW.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,622

Hi Aaron

Normally you use INSERT, UPDATE, MODIFY, and DELETE to modify or update the database and check this link for more info:

http://help.sap.com/saphelp_nw70/helpdata/EN/41/7af4bfa79e11d1950f0000e82de14a/content.htm

Neha

4 REPLIES 4
Read only

Former Member
0 Likes
1,623

Hi Aaron

Normally you use INSERT, UPDATE, MODIFY, and DELETE to modify or update the database and check this link for more info:

http://help.sap.com/saphelp_nw70/helpdata/EN/41/7af4bfa79e11d1950f0000e82de14a/content.htm

Neha

Read only

Former Member
0 Likes
1,622

Use can use "COMMIT WORK " and Database operate command SQL

Within an LUW, database changes are not made until after a database commit. Prior to this, any database change can be canceled by a database rollback.

In the R/3 System, a database commit is triggered either automatically or by the ABAP/4 command COMMIT WORK or the appropriate Native SQL command for the database system.

Similarly, a database rollback is triggered either automatically or by the ABAP/4 command ROLLBACK WORK or the appropriate Native SQL command for the database system.

After the COMMIT WORK has been executed, the event RAISE_TRANSACTION_FINISHED of the class CL_SYSTEM_TRANSACTION_STATE with parameter value CL_SYSTEM_TRANSACTION_STATE=>COMMIT_WORK is triggered. However, this does not apply to the COMMIT WORK at the end of the update.

Edited by: Jack Wu on Dec 16, 2008 11:13 AM

Read only

Former Member
Read only

Former Member
0 Likes
1,622

Use a function module for this requirement.

function module attributes > normal Function module with start immediately radio button checked.

While calling this FM..

the syntax wud like -> CALL FUNCTION 'XYZ' in update task..

within this FM you can write the update database commands.