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 commit without using Wait? need to get the data for created order

Former Member
0 Likes
863

I am using BAPI to create or change sales order and by using 'BAPI_TRANSACTION_COMMIT' updating the database.

Immediately after that there is some requirement to fetch VBAP with the created order number, but there is no data found.

If i use call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = 'X'.

then i am able to fetch data from VBAP, but its impacting the performance. Is there any alternative way to get data without fetching or without using wait.

Can i use ABAP memory or SAP memory to get the details?

Please help...........

6 REPLIES 6
Read only

JoffyJohn
Active Contributor
0 Likes
739

call function 'BAPI_TRANSACTION_COMMIT'

exporting

wait = 'X'.

is actually synchronous update. The processing wait till data is written to database.

That is the right way. It is better to commit to database and then fetch the commited data with a select.

Read only

Former Member
0 Likes
739

Thanks for the reply...

yes i am using commit work...but i don't want the wait...its a performance issue for my case....i want some solution so that by exporting memory or some other way to avoid the "WAIT"..

Thankss....

Read only

Former Member
0 Likes
739

Hi Tapas379,

Yes technically you can:

set data before commit


 DATA memory_id(20) TYPE c.

  CONCATENATE 'VBAP_01_' sy-uname INTO memory_id.

  DELETE FROM DATABASE indx(as) ID memory_id.

  EXPORT vbap_tab = vbap_tab "<-input
    TO DATABASE indx(as)
    CLIENT sy-mandt
    ID memory_id.

Get data from anywhere after setting it.



  data memory_id(20) type c.

  concatenate 'VBAP_01_' sy-uname into memory_id.

  import vbap_tab = vbap_tab " ->output
    from database indx(as)
    client sy-mandt
    id memory_id.
  delete from database indx(as) id memory_id.

Thanks,

Duy

Read only

0 Likes
739

Hi Pham Duy,

Thanks for the reply......

Actually i am using BAPI, So those data i am passing to the BAPI that i know.

I want those data which are updated in VBAP after creation of the order(i.e. excluding the data i m passing to the BAPI)

So until commit work and wait i am not getting the data, which is a performance issue and i want to avoid it.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
739

what if the commit fails ?

Read only

0 Likes
739

That's why I said "technically".

Thanks,

Duy