ā2014 May 22 5:33 AM
Hi Folks
I am updating some batch characteristics during Usage decision using BAPI_OBJCL_CHANGE . then after closing the ud using QA 12 using BDC .
But when QA12 is called using BDC i am getting the error that batch is already locked.
Sometimes this error comes and sometimes not. Please Help.
ā2014 May 22 5:42 AM
Hi,
do you call BAPI_TRANSACTION_COMMIT with WAIT option after BAPI_OBJCL_CHANGE ?
If not, please try that.
Regards,
Klaus
ā2014 May 22 5:44 AM
Hi Nikhil,
can you please post the relavant code you have used in BAPI_OBJCL_CHANGE, after this are you using any function module BAPI_TRANSACTION_COMMIT . If yes then please pass wait = 'X',
Please post your relevant code here.
ā2014 May 22 6:20 AM
Hi Sanjiv
please find the code format bellow.
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
OBJECTKEY = LS_BAPI1003_KEY-OBJECT
OBJECTTABLE = LS_BAPI1003_KEY-OBJECTTABLE
CLASSNUM = LT_ALLOCLIST-CLASSNUM
CLASSTYPE = LS_BAPI1003_KEY-CLASSTYPE
TABLES
ALLOCVALUESNUMNEW = LT_VALUES_NUM
ALLOCVALUESCHARNEW = LT_VALUES_CHAR
ALLOCVALUESCURRNEW = LT_VALUES_CURR
RETURN = LT_RETURN.
*BREAK-POINT.
READ TABLE LT_RETURN WITH KEY TYPE = 'E'.
IF SY-SUBRC NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
WAIT UP TO 10 SECONDS.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
TEXT = 'Done'.
CALL FUNCTION 'BUFFER_REFRESH_ALL'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
* IMPORTING
* RETURN =
.
ā2014 May 22 6:35 AM
Hi Nikhil,
please change your code as shown below and once pass some values like for objectkey = 'its value' and do it in all the fields of exporting, then please see that it is working or not
CALL FUNCTION 'BAPI_OBJCL_CHANGE'
EXPORTING
objectkey = 'value'
objecttable = 'value'
classnum = 'value'
classtype = 'value'
TABLES
allocvaluesnumnew = table name
allocvaluescharnew = table name
allocvaluescurrnew = table name
return = table name
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = ls_bapiret2.
ā2014 May 22 6:53 AM