on 06-14-2020 3:04 PM
Hi Experts,
I am trying to implement unmanaged scenario for a create operation. I am using 'BAPI_EPM_SO_CREATE' to create a sales order with create method.
This BAPI has a parameter 'persist_to_db' which is by default true. When I am calling the BAPI , getting dump because the BAPI contains 'COMMIT WORK'. As we know we cannot use commit work during transnational phase.
So then passed 'abap_false' to persist_to_db and placed commit work in save method (part of save sequence). But still I am getting dump for using commit.
Due to this reason I am unable to persist the data even after successful execution of the BAPI. How do I commit the data in save seqeunce. Kindly help.
Regards,
ABAPer.
Hi,
to avoid the COMMIT WORK issue, I used an aRFC function which executes the BAPI (CALL FUNCTION <new_arfc_function> STARTING NEW TASK <task_name> CALLING <method> ON END OF TASK. ... WAIT FOR ASYNCHRONOUS TASKS .... - Also possible is just DESTINATION 'NONE'.
Regards, Föß
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As far as I know the commit will be handled by the framework.
Even in "Save" method you will encounter the message "The command COMMIT is not allowed in a BEHAVIOR class."
Your "save" class is called in context of method "_PROCESS_SAVE_SEQUENCE" from class CL_RAP_TRANSACTION_MANAGER. That method will handle the commit. Of course all these if there are no "failed" entities.
I had a similar issue where I had to call a posting for FI documents. Due to update task usage from std tools, I had to call the FMs in background unit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a solution here in the meantime? I am currently facing the problem myself and would like to execute a BAPI in a RAP managed scenario.
I would be particularly interested in how exactly the call should take place. Somehow it doesn't seem to work in the same LUW.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello reachoutnagendra,
I am also trying the same thing but I am not able to pass multiple item records from the UI to backend to call the BAPI, can you explain how you achieved this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can create as RFC FM inside of it can write BAPI logic and call as below starting new task & destination as None
CALL FUNCTION 'ZRFC_FM'
STARTING NEW TASK 'UPDATE'
DESTINATION 'NONE'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi nick.giannakis
Our requirement is also similar,
However, our business object does not get updated via BAPI_TRANSACTION_COMMIT.
We have to use a different COMMIT (diwps_rev_save ) and for this, we need to pass the values from the corresponding method to SAVE( standard method provided by RAP). How do I pass those values in the SAVE method?
Any idea on this?
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have also encountered the same issue. BAPI internally calls a commit work and we have second commit by the framework.
I have updated comments here -
Here is Runtime Error that we get -
What happened?
Error in the ABAP application program.
The current ABAP
program “SAPMV45A” had to be terminated because it found a
statement that could not be executed.
Error analysis
There is probably an
error in the program
“SAPMV45A”.
A BEHAVIOR implementation is active for XYZ While this is the case,
the following ABAP statements are illegal:
– COMMIT
– ROLLBACK
– SUBMIT
– CALL TRANSACTION
– LEAVE
all DYNPRO-related statements, such as MESSAGE, CALL DIALOG, and CALL
SCREEN
The following statement is only allowed in the “Save” phase: –
CALL
FUNCTION IN UPDATE TASK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.