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

BAPI doesn't write data to database? why?

Former Member
0 Likes
2,271

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!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,093

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

20 REPLIES 20
Read only

GauthamV
Active Contributor
0 Likes
2,093

hi,

you have to use this function module to update database.

BAPI_TRANSACTION_COMMIT.

Read only

Former Member
0 Likes
2,093

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.

Read only

Former Member
0 Likes
2,093

Hi:

Commit work is required.

Regards

Shashi

Read only

Former Member
0 Likes
2,094

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

Read only

0 Likes
2,093

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

Read only

0 Likes
2,093

execute again and bapi_transaction_commit is executed

kind regards

arthur

Read only

0 Likes
2,093
Read only

0 Likes
2,093

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

Read only

0 Likes
2,093

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

Read only

0 Likes
2,093

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

Read only

0 Likes
2,093

thats fine, commit return table will be empty unless there are some errors

Read only

0 Likes
2,093

and is the return table of BAPI_PR_CREATE also empty ??

kind regards

arthur

Read only

0 Likes
2,093

That you need to check. You can set external break-points in BAPI, so can chek whats happenign in the BAPI

Read only

0 Likes
2,093

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

Read only

0 Likes
2,093

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?

Read only

0 Likes
2,093

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.

Read only

0 Likes
2,093

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

Read only

Former Member
0 Likes
2,093

thanks for the replies

what is the "WAIT" for here?

Read only

0 Likes
2,093

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.

Read only

0 Likes
2,093

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