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

Short DUMP on several time BAPI call

Former Member
0 Likes
976

Hello, everybody.

I need help in the following situation: we have a webdyn pro application, that call BAPI for creating or deleting business partner relationships. ( BAPI_BUPR_RELATIONSHIP_CREATE and BAPI_BUPR_RELATIONSHIP_DELETE)

After the BAPI call in case no errors we COMMIT changes. There the problems start:

1. When creating relation ships we use statement COMMIT WORK and WAIT to update DB, but in case we add several BP relationships - it dumps with the following description: "SAPSQL_ARRAY_INSERT_DUPREC". If we use FM "BAPI_TRANSACTION_COMMINT" instead COMMIT - it doesn't return any error.

2. In the application we created some relations (update DB), than, without reload the application we want to delete the new entries it returns the following error: "Nested call of PERFORM ON COMMIT: NESTED_PERFORM_ON_COMMIT caller"

This has happened when we used "BAPI_BUPR_RELATIONSHIP_DELETE" and use "BAPI_TRANSACTION_COMMIT" , when we have changes the call of FM to statement COMMIT - no more dump.

I wonder to know the reasons of such program behavior as we have the same situation in several places.

<b>Thanks to everyone for respond</b>

1 ACCEPTED SOLUTION
Read only

0 Likes
518

Hi

Function BAPI_TRANSACTION_COMMIT does nothing else but a simple COMMIT WORK.

COMMIT WORK not only commits all database changes (insert, update, delete) to the database making them available for all other and later processes and transactions. In BAPI function modules, many database changens are not done directly but using the ABAP syntax PERFORM ... ON COMMIT:

That means, the form is not executed until the next COMMIT WORK ( or Call of BAPI_TRANSACTION_COMMIT).

All INSERT, UPDATE and DELETE is committed automatically at the end of transaction or execution of a report. PERFORM ... ON COMMIT needs the explicit COMMIT WORK.

Thats the reason why you will never find objects (orders, assets,...) created using BAPI in test environment using SE37 althoug you receive a success message. You must do it in program and after the BAPI call issue COMMIT WORK or call function BAPI_TRANSACTION_COMMIT.

You should be aware, that COMMIT WORK will commit everything to the database in the current LUW (transaction, logical unit of work), not only what you created.

If your routine is a child routine of a standard process, never use COMMIT WORK. The calling transaction will know the right time to commit and all changes you did are committed as well - or rolled back if an error occurred.

Sail

Hello, everybody.

I need help in the following situation: we have a webdyn pro application, that call BAPI for creating or deleting business partner relationships. ( BAPI_BUPR_RELATIONSHIP_CREATE and BAPI_BUPR_RELATIONSHIP_DELETE)

After the BAPI call in case no errors we COMMIT changes. There the problems start:

1. When creating relation ships we use statement COMMIT WORK and WAIT to update DB, but in case we add several BP relationships - it dumps with the following description: "SAPSQL_ARRAY_INSERT_DUPREC". If we use FM "BAPI_TRANSACTION_COMMINT" instead COMMIT - it doesn't return any error.

2. In the application we created some relations (update DB), than, without reload the application we want to delete the new entries it returns the following error: "Nested call of PERFORM ON COMMIT: NESTED_PERFORM_ON_COMMIT caller"

This has happened when we used "BAPI_BUPR_RELATIONSHIP_DELETE" and use "BAPI_TRANSACTION_COMMIT" , when we have changes the call of FM to statement COMMIT - no more dump.

I wonder to know the reasons of such program behavior as we have the same situation in several places.

<b>Thanks to everyone for respond</b>

1 REPLY 1
Read only

0 Likes
519

Hi

Function BAPI_TRANSACTION_COMMIT does nothing else but a simple COMMIT WORK.

COMMIT WORK not only commits all database changes (insert, update, delete) to the database making them available for all other and later processes and transactions. In BAPI function modules, many database changens are not done directly but using the ABAP syntax PERFORM ... ON COMMIT:

That means, the form is not executed until the next COMMIT WORK ( or Call of BAPI_TRANSACTION_COMMIT).

All INSERT, UPDATE and DELETE is committed automatically at the end of transaction or execution of a report. PERFORM ... ON COMMIT needs the explicit COMMIT WORK.

Thats the reason why you will never find objects (orders, assets,...) created using BAPI in test environment using SE37 althoug you receive a success message. You must do it in program and after the BAPI call issue COMMIT WORK or call function BAPI_TRANSACTION_COMMIT.

You should be aware, that COMMIT WORK will commit everything to the database in the current LUW (transaction, logical unit of work), not only what you created.

If your routine is a child routine of a standard process, never use COMMIT WORK. The calling transaction will know the right time to commit and all changes you did are committed as well - or rolled back if an error occurred.

Sail