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

Issue with bapi commit in method

Former Member
0 Likes
914

Hello Everyone

Iam using a BAPI to create a data in CRM inside a method. And i get an error when i use the BAPI_COMMIT inside the method. Its give me an error even if u use just COMMIT WORK.

Any solutions pls?

Thanks,

Suri

8 REPLIES 8
Read only

Former Member
0 Likes
868

Hello,

Could you post the message error.

What happens if you DONT use commit?

Bye

Gabriel

Read only

Former Member
0 Likes
868

Can you give the Class & BAPI name?

Read only

0 Likes
868

Let me describe in detail.

My friend is facing this issue exactly.

He is using a BAPI to create Businee Partner, actually the commit works. When we use the COMMIT after the BAPI it creates the Businees Partner and updates the BUT000 table.

Now the BUT000 has two custom fields called ZFEIN and ZSSN. After the commit of the BAPI we capture the Business partner and update the BUT000 table with new ZFEIN and ZSSN value. And this does not work i.e it does not update the custom fields of the BUT000 table.

Sorry for posting the query wrong previously.

THanks,

Suri

Read only

0 Likes
868

Make sure that the create process is completed before you do an update. Put a break point at your update statement and check if an entry exists for the newly created business partner in the table BUT000. If it exists then, maybe you have to do an conversion exit (alpha) on the business partner number before the update process.

Read only

0 Likes
868

If the update to BUT000 is after the commit to the BAPI, you may have to do a separate commit for that later update unless an action or event occurs that causes an implicit database commit.

You may need to execute

COMMIT WORK.

or call function module DB_COMMIT.

Keep in mind that a database commit closes all open database cursors, which would affect an open select loops or OPEN CURSOR statements.

Good luck

Brian

Read only

0 Likes
868

Brian ,

When i use either of the below commit statements inside the BADI implementation method IF_EX_EXEC_METHODCALL_PPF~EXECUTE ,

COMMIT WORK

BAPI_TRANSACTION_COMMIT

DB_COMMIT

I get an pop-up error message reading "Adminstration Header For (GUID) not found".

We need a COMMIT WORK statement inside the implementation to update the Custom Fields of BUT000 table after the creation of the Business Partner using the standard BAPI "BAPI_BUPA_CREATE_FROM_DATA"

Please suggest if there is any work around to update the custom fields in BUT000 table.

Thanks,

Suri

Read only

0 Likes
868

Check out the following thread, where some similar problems have come up:

This may give a more comprehensive solution.

Good luck

Brian

Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
868

Hi Suri,

most BAPI's do a test for a flag and if it is set they will perform a commit. This allows you to use the debugger to set this flag on so that the BAPI will perform the commit. This then means you can check to see if the BAPI is actually doing what you wanted it to.

Perhaps the BAPI is getting an error of some kind which would explain why the db changes are not saved.

Cheers

Graham