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: 

Starting a new LUW?

Former Member
0 Kudos

Hi Guys.

I'd explain my scenario first.

I have a common function module which is called by many custom programs.

Now in this common FM I want to update a database table and commit/rollback it WITHOUT affecting the calling programs's LUW - i.e. if the calling program has updated a database table BEFORE calling the FM, that SHOULD NOT be updated via the DB_COMMIT of my FM - i.e I want the updates inside my FM to be treated as a separate LUW.

Now I know some immediate responses to achieve this might be SUBMIT and return. Well, I tried that - but on committing inside the submitted program, all database updates till then are getting committed.

2nd option -> I tried to call my FM in update task - but that does not help because then the FM is dependent on the COMMIT work to be issued by the calling program, but I do not want that.

3rd option -> I tried to submit a job in background to do the update - even that does not work because JOB_OPEN internally calls a commit work which commits any database updates till then.

Any clues what can I do, or where I am going wrong?

Thanks in adv.

1 ACCEPTED SOLUTION

former_member195402
Active Contributor
0 Kudos

Hi Aishi,

try to call your FM by RFC with destination NONE.

Regards,

Klaus

2 REPLIES 2

former_member195402
Active Contributor
0 Kudos

Hi Aishi,

try to call your FM by RFC with destination NONE.

Regards,

Klaus

MarcinPciak
Active Contributor
0 Kudos

What I can see SAP says about this is

An implicit or explicit DB commit in the called transaction also updates all the completed inline

changes of the calling program.

Conversely

If you call up transactions with nested calls, each transaction needs its own COMMIT WORK

because each transaction maps its own SAP LUW.

The same applies to executable programs that are called using SUBMIT <program> AND

RETURN.

So in order each SAP LUW can process only its updates you should trigger COMMIT WORK explicitly for each of them. This would be case when you i.e. call transaction -> do your updates there -> trigger COMMIT WORK. This should therefore not affect calling program's updates.

Not sure if all updates have to be done in FM in UPDATE TAKS, similary as described [here|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbae4135c111d1829f0000e829fbfe/frameset.htm]

All LUW issues always makes me going crazy too

Regards

Marcin