Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI and BDC bundling

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member404244
Active Contributor
0 Kudos

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

1 REPLY 1

former_member404244
Active Contributor
0 Kudos

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