05-03-2012 11:15 AM
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.
05-03-2012 1: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.
05-03-2012 11:26 AM
Use CCAP_REV_LEVEL_MAINTAIN. The lock & unlock is handled internally.
05-03-2012 11: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...
05-03-2012 1: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.
05-03-2012 1:36 PM
Did you notice that CCRL_INIT calls the fm you listed plus clears some other global variables.?
Below is the code of this FM. I still suggest use this FM instead.
clear itaeoib.
refresh itaeoib.
call function 'REVISION_LEVEL_BUFFER_RESET'
exceptions
others = 0.
call function 'REVISION_LEVEL_BUFFER_INIT'
exceptions
others = 0.
05-04-2012 11:57 AM
Hi,
If sy-subrc is not initial, and if necessary, you can call 'BAPI_TRANSACTION_ROLLBACK', that refresh the buffers.
Regards,
Maria João Rocha