Application Development and Automation 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: 
Read only

Committing data to database after plausibility BAPI called in .NET...

Former Member
0 Likes
526

Hi,

I am using .NET connector to connect legacy system built on .NET platform to SAP. The SAP system uses a BAPI to pull data from legacy. The BAPI is called in Legacy system. After doing all the plausibility check in R/3, the BAPI returns data in BAPIRET2 table.

If the BAPIRET2 table does not contain any errors, I want the transactional data created in legacy to be committed in R/3. How can this be achived because the BAPI do commit iniside itself (following the standard SAP practice).

There are two options I have thought of:

1) The .NET developer will check the error table returned by BAPI and if non of the errors are there in the return structure then .NET code will call BAPI_Transaction_Commit for committing the data to database.

2) If the BAPIRET2 parameter of initial BAPI does not contain any errors, then some commit status on/off data flag is passed through the custom function module to R/3. Based on the commit status flag, the commit statement is excuted in R/3.

Please tell me which one is better solution. Any other smarter ideas are also appreciated. Any pros and cons ?

Thanks.

Rajesh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
487

Hi Rajesh,

Most BAPIs doesn't do a commit by themselves. And some other BAPIs have a flag which would let the system commit or not. Check if your BAPI has a parameter which flags the commit statement. Which BAPI are you referring to?

Regards,

Ravi

Hi,

I am using .NET connector to connect legacy system built on .NET platform to SAP. The SAP system uses a BAPI to pull data from legacy. The BAPI is called in Legacy system. After doing all the plausibility check in R/3, the BAPI returns data in BAPIRET2 table.

If the BAPIRET2 table does not contain any errors, I want the transactional data created in legacy to be committed in R/3. How can this be achived because the BAPI do commit iniside itself (following the standard SAP practice).

There are two options I have thought of:

1) The .NET developer will check the error table returned by BAPI and if non of the errors are there in the return structure then .NET code will call BAPI_Transaction_Commit for committing the data to database.

2) If the BAPIRET2 parameter of initial BAPI does not contain any errors, then some commit status on/off data flag is passed through the custom function module to R/3. Based on the commit status flag, the commit statement is excuted in R/3.

Please tell me which one is better solution. Any other smarter ideas are also appreciated. Any pros and cons ?

Thanks.

Rajesh.

3 REPLIES 3
Read only

Former Member
0 Likes
488

Hi Rajesh,

Most BAPIs doesn't do a commit by themselves. And some other BAPIs have a flag which would let the system commit or not. Check if your BAPI has a parameter which flags the commit statement. Which BAPI are you referring to?

Regards,

Ravi

Read only

0 Likes
487

I am using a Standard BAPI used for insurance module. By the way, I meant BAPI <b>do not do</b> commit in itself (following standard SAP practice)

Read only

0 Likes
487

Hi Rajesh,

I think the first Option is the way to go, as it involves no Custom Coding.

If the BAPI was provided with no commit options, that itself indicates the necessity of making use of the bapi_transaction _commit or Rollbacl based on the success or failure of the BAPI.

Regards,

Ravi