on 01-04-2010 8:25 PM
Hi Experts
I have a specfic program to create a lot of shoping cars in excel files.
I use "BAPI_TRANSACTION_COMMIT" after calling BAPI_SCEC_CREATE.
Here the code:
loop at ...
CALL FUNCTION 'BAPI_SCEC_CREATE'
...
if ...
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
else.
rollback work
endif.
endloop.
My problem is when i user "rollbakc work",n the data is inconsistents, and when i delete "rollback work" the code "BAPi_TRANSACTION_COMMIT is executes for all cases.. So i have too many shopping card created.
I can I do a 'BAPI_TRANSACTION_COMMIT" only for my last workf and not for all ?
Thank you very muche for your help.
Regards,
Peggy.
Edited by: peggy delvincourt on Jan 4, 2010 9:25 PM
I can I do a 'BAPI_TRANSACTION_COMMIT" only for my last workf and not for all ?
Yes, you could, if you are satisfied with "all or nothing" result, meaning either you get to have all the SC successfully created or none at all.
If you are running the report in the same system as your SCs, I'd suggest that in the loop, you use FM BBP_PD_SC_CREATE, and only if successful, call FM BBP_PD_SC_SAVE. Then after the loop, commit work and wait or roll back. Give it a try.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.