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

FM Inside Loop - Lock Issue

Hi all,

I am using a FM to assign Revision level to many materials - REVISION_LEVEL_INSERT - I believe this is not BAPI as its not Remote enabled .

Problem is only first record is getting updated . Even though FM returns success message for all the remaining records its not updating in Table .

Loop ...FM

FM call

if sy-subrc eq 0

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

* IMPORTING

* RETURN =

.

endif

endloop...

Did i miss anything here. I guess I am not committing it properly or Object(Change Number ) Locked and so further records did not update ..Help please.

Thanks,

Srini.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 03, 2012 at 12:20 PM

    Thanks all for you suggestions..I found that i have to do INIT and Reset at the beginning and end of loop..

    REVISION_LEVEL_BUFFER_INIT

    REVISION_LEVEL_BUFFER_RESET

    This Solved.

    Thanks,

    Srini.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 03, 2012 at 10:26 AM

    Use CCAP_REV_LEVEL_MAINTAIN. The lock & unlock is handled internally.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 03, 2012 at 10:48 AM

    Such problem occurs when global data of function group and not intialized and they are buffered for subsiquient run.

    Not sure but you may try one thing. call the function CCRL_INIT of the same function group before actual function call.

    Loop ...FM

    call funcion CCRL_INIT

    FM call

    if sy-subrc eq 0

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    WAIT = 'X'

    * IMPORTING

    * RETURN =

    .

    endif

    endloop...

    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.