‎2008 Oct 23 11:01 AM
Hi,
I am using my web dynpro app to call BAPI_PR_CREATE, BAPI_RESERVATION_CREATE1.
all the input is right, and it returns me a Purchase No, and Reservation No, but when i check the number against the database, they have not been created.
why is this happening? how to solve?
thanks!
‎2008 Oct 23 11:08 AM
Hi,
Check whether a commit work is required.
While executing in se37,Select Test Sequences from se37 menu .Give BAPI_PR_CREATE, BAPI_TRANSACTION_COMMIT and then execute it one by one.
if we are using the bapi in a report,then u can use commit work command .
Regards,
Rachel
‎2008 Oct 23 11:03 AM
hi,
you have to use this function module to update database.
BAPI_TRANSACTION_COMMIT.
‎2008 Oct 23 11:04 AM
Hi,
Use the BAPI, BAPI_TRANSACTION_COMIT also after the other bapis. give wait = 'X'.
Also chek if you are getting any Update Terminated messages.
Regards,
Renjith Michael.
‎2008 Oct 23 11:05 AM
‎2008 Oct 23 11:08 AM
Hi,
Check whether a commit work is required.
While executing in se37,Select Test Sequences from se37 menu .Give BAPI_PR_CREATE, BAPI_TRANSACTION_COMMIT and then execute it one by one.
if we are using the bapi in a report,then u can use commit work command .
Regards,
Rachel
‎2008 Oct 23 1:18 PM
While executing in se37,Select Test Sequences from se37 menu .Give BAPI_PR_CREATE, BAPI_TRANSACTION_COMMIT and then execute it one by one.
if we are using the bapi in a report,then u can use commit work command .
i m no sap gui expert, how to do this exactly.
i add BAPI_PR_CREATE and BAPI_TRANSACTION_COMMIT one by one to the list
then i excute it, i chose a set of test data from the list where it's going to provide me with a correct result.
then click excute, the PR_CREATE got excuted
then how to proceed to the next level?
thanks
‎2008 Oct 23 1:27 PM
execute again and bapi_transaction_commit is executed
kind regards
arthur
‎2008 Oct 23 1:28 PM
Hi,
Check my post in wiki for how to do it
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/function%2bmodule%2btest%2bsequence
Regards,
Sachin
‎2008 Oct 23 2:12 PM
after i execute the first one, i click back, then execute the Transaction_Commit, but the returns table is empty, doesn't tell me it's error or success?
any advice?
but thanks everyone for the input so far!
<removed_by_moderator>
Edited by: Julius Bussche on Oct 23, 2008 3:18 PM
‎2008 Oct 23 2:24 PM
you would not be able to use SE37 to test it. once you press back there, the buffer is gone, and BAPI_TRANSCATION_COMMIT has no effect.
You need to test it from your calling program
so
call BAPI 1
commit BAPI ( if you need data from 1st BAPI in 2nd call )
Call BAPI2
commit BAPI
‎2008 Oct 23 2:51 PM
yes, i tried it in my program.
execute bapi_pr_create
excute bapi_transaction_commit
then try to debug the commit return table, table is empty except for some initial 000s
‎2008 Oct 23 2:52 PM
thats fine, commit return table will be empty unless there are some errors
‎2008 Oct 23 2:59 PM
and is the return table of BAPI_PR_CREATE also empty ??
kind regards
arthur
‎2008 Oct 23 3:21 PM
That you need to check. You can set external break-points in BAPI, so can chek whats happenign in the BAPI
‎2008 Oct 23 4:54 PM
it's working fine now
the BAPI_PR_CREATE return table is not empty, it returns "s"
but i really want to know how to test bapis and commit them in se37
‎2008 Oct 23 4:56 PM
you cant do Commit in SE37. SE37 can give you the idea if the db posting will be successfull or not, but it would nto commit that.
come to think of that you woudlnt want someone to update Database usign SE37 , right?
‎2008 Oct 23 5:04 PM
it's working, following the wiki page.
it can be committed with test sequence
thanks everyone for the input i m closing the questions now.
‎2008 Oct 27 8:02 AM
ofcourse you can do commit in se37 as long as you create a test sequence
under menu 'Function module'->> Test ->> Test sequence
position 1 youre bapi
position 2 bapi_commit
and why should you not want to do a commit in SE37 especially for some bapis you want to check what the effect is in the system before you can decide whether it is the right bapi or not
when you run the test sequence you get the result from the first bapi, then you press on the green button or F3 then you execute the commit bapi
kind regards
arthur
‎2008 Oct 23 12:00 PM
‎2008 Oct 23 12:06 PM
Operations that change the database must be carried out through the updating process. Otherwise, thereu2019s a risk that both unchecked and unwanted database COMMITs are executed during the RFC call.
‎2008 Oct 23 12:08 PM
read documentation fro the BAPI. Wait = 'X' will wait untill all DB updates are finished. you can fdecide to use that depends on your requirements