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 UPDATING DATA BASE AND RETRIEVING THE SAME

Former Member
0 Likes
847

Hi all,

IAM CREATING A RESERVATION USING A BAPI AND IAM USING BAPI TRANSACTION COMIT TOO AND AT THE END OF THE PROGRAM I RETRIEVING THE DATA BASED ON THE RESERVATION NUMBER CREATED

WHEN I AM RETRIEVING THE DATA I AM USING BYPASSING BUFFER IN SELECT QUERY TOO

SOME TIMES IT RETURNS SY-SUBRC NE 0.

LET ME KNOW THANKS

kAJOL

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
802

use wait command before retreiving the records from database.

ex:

wait up to 10 seconds.

Hi all,

IAM CREATING A RESERVATION USING A BAPI AND IAM USING BAPI TRANSACTION COMIT TOO AND AT THE END OF THE PROGRAM I RETRIEVING THE DATA BASED ON THE RESERVATION NUMBER CREATED

WHEN I AM RETRIEVING THE DATA I AM USING BYPASSING BUFFER IN SELECT QUERY TOO

SOME TIMES IT RETURNS SY-SUBRC NE 0.

LET ME KNOW THANKS

kAJOL

5 REPLIES 5
Read only

Former Member
0 Likes
803

use wait command before retreiving the records from database.

ex:

wait up to 10 seconds.

Read only

0 Likes
802

Hi ,

I tried using commit wok and wait after bapi_transaction_commit -it doesn't work too

Are you sure of this because it takes a long time for program to execute if i use wait 10 sec.

Let me know if anyone of you have faced a similar issue.

Read only

0 Likes
802

Hi ,

any suggestions on this

thanks

kajol

Read only

0 Likes
802

Hi,

Whenever a document is saved SAP and all check are performed, it gives the document number based on whatever number range format you are using. Simultaneously it triggers V1 update. V1 update is for time-critical data and it does the database commit.

V1 updates are carried out under the <b>R/3 locks of the transaction</b> that creates the update. This ensures that the data remains consistent; simultaneous changes to the objects to be updated are not possible. Also V1 update belong to the same database LUW and <b>can be reversed</b>. V1 update "can be reversed" means that, if some problem occurs while update it rollbacks all previous update. You might have notice in SAP that sometime you get the document number but if you try to see the data using SE11 in table, the document does not exist. This is because the SAP generate document number before starting the update. If update fails it rollback all the changes and document is not update in database.

In your case, when you are trying to read the database, the commit is not done. I would suggest you to use <b>WAIT command with the wait time of 5-10 seconds</b>. You can do trial and error to find out the what time best fit for your requirement.

For more information regarding "update task" in sap, please refer to this link:

http://help.sap.com/saphelp_46c/helpdata/en/e5/de86f335cd11d3acb00000e83539c3/frameset.htm

I hope this will solve this issue.

Let me know if you have any question.

Regards,

RS

Read only

Former Member
0 Likes
802

Hi,

When calling the FM BAPI_TRANSACTION_COMMIT pass the parameter WAIT ='X'. It will wait until the V1 updates are done..

Then you can do a select..

Thanks,

Naren