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

Commit work and wait don't work,why

Former Member
0 Likes
898

Hi All,

I call BAPI 'BAPI_PO_CREATE1' and create PO, then commit via

commit work and wait.

after creating, query the new PO via

SELECT ebelp pstyp INTO TABLE lt_ebelp

FROM ekpo

WHERE ebeln = p_lv_ebeln.

but no result.

If creating and waiting a moment, it do work.

why, I already used 'commit work and wait' but not 'commit work'.

thanks.

regards.

dou

7 REPLIES 7
Read only

Former Member
0 Likes
818

Try to use BAPI_TRANSACTION_COMMITT FM and see the results.

It should work ,please call FM after your BAPI FM...

Thanks

Seshu

Read only

gopi_narendra
Active Contributor
0 Likes
818

Instead of Commit work and wait use the bapi : BAPI_TRANSACTION_COMMIT,

in which you can pass the wait = 'X'.

Even if this does not work, pass the wait upto 3 seconds.

Then this will definitely work.

Regards

Gopi

Read only

Former Member
0 Likes
818

Hi All,

At first, I used as follow

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

but it don't work.

so, I replaced with 'commit work and wait'.

Read only

0 Likes
818
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.

wait up to 3 seconds. " Add this

Accordingly increase or decrease the time in seconds.

Regards

Gopi

Read only

0 Likes
818

Okay ,first check whether po number is getting saved or not .

If po is saving then use BAPI_TRANSACTION_COMIITT FM ..

Now check ur select query like : Since wait upto n seconds ( This may not work)

data : n Type i.

n = 10.

write the below code after BAPI_TRANSACTIOn_COMITT.

do n times.

select query

if sy-subrc eq 0.

exit.

endif.

enddo.

still document number is not coming ,testing purpose increate n as 20 and see the results.

Thanks

Seshu

Read only

Former Member
0 Likes
818

Hi All,

thanks very much.

now, I only use do loop to perform it.

best regards.

dou

Read only

Former Member
0 Likes
818

Thanks everyone very much