2008 Jul 07 6:45 AM
Dear All,
I am calling an RFC from VB.
The RFC first executes a BDC, then a BAPI and finally inserts data in z-table.
In case operation fails in any one process, I want to rollback.
Is this possible ? if yes then plz let me know.
Thanks.
Dear All,
I am calling an RFC from VB.
The RFC first executes a BDC, then a BAPI and finally inserts data in z-table.
In case operation fails in any one process, I want to rollback.
Is this possible ? if yes then plz let me know.
Thanks.
2008 Jul 07 6:48 AM
for BAPI u can use BAPI_TRANSACTION_ROLLBACK
and for BDC you can put a commit and wait statement in a condition..
if <condition> eq 'false'.
commit work and wait.
endif.
2008 Jul 07 6:49 AM
call commit BAPI after entire process is done...
this way is anything fails in between data will not get comitted...
2008 Jul 07 7:11 AM
Hi,
In BAPI we can use BAPI_TRANSACTION_ROLLBACK.
FORM commit_work .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = ' '.
ENDFORM. " COMMIT_WORKFor BDC we can commit in following way.
CALL TRANSACTION 'SE38' USING BDCDATA MODE 'N'
MESSAGES INTO ITAB.A call transaction ends successfully for the following reasons:
1. COMMIT WORK
2. Next screen = 0
3. LEAVE TO TRANSACTION SPACE.
If any errors are found they get stored in itab as above.
We can handle that error message and commit the work.
If itab[] is initial.
commit and wait.
endif.
Hope this helps you.
plz reward if useful.
thanks,
dhanashri.
2008 Jul 07 7:29 AM
Hi,
Your procedure should first lock all necessary data.
After that it should check out whether intended changes are possible.
If it is not possible remove locks and provide negative return.
If it is possible perform your changes, remove locks and provide positive return.
Regards
Walter Habich
Edited by: Walter Habich on Jul 7, 2008 8:30 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |