Skip to Content
author's profile photo Former Member
Former Member

Starting a new LUW?

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Oct 12, 2010 at 07:32 AM

    Hi Aishi,

    try to call your FM by RFC with destination NONE.

    Regards,

    Klaus

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 12, 2010 at 07:34 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.