2013 Jan 23 4:52 PM
In my conversion program , i creating a document info record(DIR) using BAPI 'BAPI_DOCUMENT_CREATE2' and then change the DIR using BAPI
BAPI_DOCUMENT_CHANGE2. If i do for few records in the Fore ground it works find, when i execute for huge number of records in back ground it gives message 'Change number locked by WF-BATCH'.Could you please suggest any solution apart from using WAIT statement, as this is not recommended as there will be huge number of records.
2013 Jan 23 5:11 PM
hello,
Wait is required since the DB update takes a while before oyu can change the record. Another approach would be separate your processes. Do the Create first and then run another job for changing it, this way you do not need the WAIT statement.
best regards,
swanand
2013 Jan 24 4:07 AM
Hi Shiva,
Use one Indicator Variable in your Program , like...
data : I_BAPI_TY(2) type C.
if I_BAPI_TY = 'CR' then Call your
"BAPI_DOCUMENT_CREATE2" then "BAPI_TRANSACTION_COMMIT.
elseif I_BAPI_TY = 'CH'
"BAPI_DOCUMENT_CHANGE2" then "BAPI_TRANSACTION_COMMIT .
else.
Error MSG Wrong Choice .
Endif .