‎2007 Nov 02 6:26 AM
Hi All,
I am using a 2 BAPI's and 3 BDC's in a program. I need all these BAPI and BDC's update the tanscations in a single bundled task? that is if any of BAPI or BDC failed the sucessful BAPI/BDC should be rolled back. How can I make it happen? Any sample code will be helpful
All Suggestion will be rewarded.
‎2007 Nov 02 6:37 AM
Hi,
Identify the main bdc in ur program..when there is error in bdc program the errors will be populated in the BDCMSGcoll ..have a look .
CALL TRANSACTION TCODE MODE 'N' UPDATE 'S' MESSAGES INTO MESSTAB.
READ TABLE MESSTAB WITH KEY TYP = 'E'.
if sy-subrc ne 0.
now call second bdc
then call third bdc.
call first bapi
call second bapi...
endif.
also for bapi's u will have return structure.
so if return structure doesn't contain any error ,then only call "BAPI_TRANSACTION_COMMIT".
Regards,
Nagaraj
‎2007 Nov 02 6:37 AM
Hi,
Identify the main bdc in ur program..when there is error in bdc program the errors will be populated in the BDCMSGcoll ..have a look .
CALL TRANSACTION TCODE MODE 'N' UPDATE 'S' MESSAGES INTO MESSTAB.
READ TABLE MESSTAB WITH KEY TYP = 'E'.
if sy-subrc ne 0.
now call second bdc
then call third bdc.
call first bapi
call second bapi...
endif.
also for bapi's u will have return structure.
so if return structure doesn't contain any error ,then only call "BAPI_TRANSACTION_COMMIT".
Regards,
Nagaraj