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 while fetching latest updated record from DB Table

aravinth_anandhan
Active Participant
0 Likes
831

Hi All,

    We are using BAPI_PRODORDCONF_CREATE_TT for confirmation and goods movement of SFG materials. While doing this, we will get one material document number generated and updated in DB Table.

And we are having a select query to fetch the newly generated material number from AUFM table. Now the issue is, our select query is fetching previous generated material document instead of fetching new one. And we are executing this select query after the execution of BAPI_TRANSACTION_COMMIT.

We guessed, the problem is because of time taken to update records in SAP DB Tables. So we used a statement WAIT UP TO 10 SECONDS before our select query and now it is fetching a newly generated material document.

Now our concern is, while executing our RFC, it is taking more time. Can anyone suggest better/correct way to fetch latest updated record from DB Table or to improve execution time of RFC ?

How can we get the status of lock set to update DB table released or not?

Thanks in advance,

Aravinth

Hi All,

    We are using BAPI_PRODORDCONF_CREATE_TT for confirmation and goods movement of SFG materials. While doing this, we will get one material document number generated and updated in DB Table.

And we are having a select query to fetch the newly generated material number from AUFM table. Now the issue is, our select query is fetching previous generated material document instead of fetching new one. And we are executing this select query after the execution of BAPI_TRANSACTION_COMMIT.

We guessed, the problem is because of time taken to update records in SAP DB Tables. So we used a statement WAIT UP TO 10 SECONDS before our select query and now it is fetching a newly generated material document.

Now our concern is, while executing our RFC, it is taking more time. Can anyone suggest better/correct way to fetch latest updated record from DB Table or to improve execution time of RFC ?

How can we get the status of lock set to update DB table released or not?

Thanks in advance,

Aravinth

4 REPLIES 4
Read only

former_member194152
Contributor
0 Likes
748

Hi,

There is an import parameter in function module BAPI_TRANSACTION_COMMIT pass value of wait = 'X', so this will call synchronous update in database hence you need not to call wait statement.

Regards,

Gagan

Read only

0 Likes
748

Hi Gagan,

We are passing wait = 'X' only. But still it is taking previous record. Because of that only I am using WAIT statement

Regards,

Aravinth

Read only

0 Likes
748

strange, you can try another approach like in return parameter of BAPI you can get document number generated by that function module so you can think a logic based on newly generated document number returning by BAPI, are you using "Commit on update task" either through subroutine or function module because if that is the case then it will execute at the end of LUW.

Read only

0 Likes
748

Hi,

We are not getting material document number in BAPI Return. All we are getting is this message Confirmation of order <order number> saved  in BAPI Return.

And other than BAPI_TRANSACTION_COMMIT, we are not using any other commit statements.