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

Function Module RV_DELIVERY_CREATE

Former Member
0 Likes
1,908

Hi Friends,

I have a Zprogram, in which initially using BAPI - BAPI_SALESORDER_CHANGE I will be updating the sale order. After this I have given COMMIT WORK and Wait statement for updates to be done. Later after updating the sale order, next step in my program is to create a delivery. For creating delivery I am using FM RV_DELIVERY_CREATE. Here it is erroring out with Message Id VI with Message Number 200. If I execute after some time the program, it is working fine and creating delivery. Only for the first time it is giving error. Please can anyone give me some ideas to rectify the error. Your answers will be awarded & appreciated

Thanks

Vinod

13 REPLIES 13
Read only

Former Member
0 Likes
1,644

What is the code for your commit?

Rob

Read only

Former Member
0 Likes
1,644

after first BAPI, call BAPI FM: BAPI_TRANSACTION_COMMIT , instead of just commit work.

delete the wait statement , check it, if it is ok then no problem

other wise put a wait statement with 2 seconds.

Read only

0 Likes
1,644

Hi,

I beleive when using BAPI_SALESORDER_CHANGE, it is locking the Sale Order. After the execution of the FM BAPI_SALESORDER_CHANGE, I can still see the the sale order & item in SM12 tcode with Lock mode "E". So I need to unlock the Sale Order after the execution of FM BAPI_SALESORDER_CHANGE and Commit work and wait statement. Please can anyone give ideas to unlock the Sale Order after the execution of FM BAPI_SALESORDER_CHANGE & commit statement.

Thanks

Vinod

Read only

0 Likes
1,644

Do not unlock the enqueue objects, you will run into bigger issues, use BAPI_TRANSACITON_COMMIT with WAIT = 'X'. Alternatively, you can introduce a DO loop around your delivery create call and exit the DO loop as soon as the creation is successful. Make sure that you check for only the lock error message to determine if you should continue in the DO loop or exit.

DO.

CALL create delivery function module.

IF sy-index = 10.

*-- get out of this loop if even after 10 loops, the lock still exists

EXIT.

ELSEIF sy-msgid = '??' AND sy-msgno = '???'.

*-- there is a lock on this sales order

CONTINUE.

ELSE.

EXIT.

ENDIF.

ENDDO.

Read only

0 Likes
1,644

Can I use to dequeue_all for unlocking

Read only

0 Likes
1,644

No you should not. It will create unwanted results. Please do as I suggested, it works.

Read only

0 Likes
1,644

Hi,

I did used BAPI - BAPI_TRANSACTION_COMMIT & WAIT = 'x'. but still after that statement, SO is still locked. I need SO to be unlocked before creating the delivery.

Please suggest ideas

Thanks

Vinod

Read only

0 Likes
1,644

Is there anything in the return table after the commit?

Rob

Read only

0 Likes
1,644

Hi Rob,

I am not passing return table, here is the code how I am passing

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

  • IMPORTING

  • RETURN =

Thanks

Vinod

Read only

0 Likes
1,644

My requirement is once after executing BAPI,BAPI_SALESORDER_CHANGE &

BAPI_TRANSACTION_COMMIT. I should not see my Sale Order in lock enteries SM12 Tcode. But I am doing so. So please suggest me some ideas to unlock the Sale Order immediatly after executing BAPI,BAPI_SALESORDER_CHANGE &

BAPI_TRANSACTION_COMMIT.

Thanks

Vinod

Read only

0 Likes
1,644

Pass the return parameter and check it. There may be nothing there, but until you check it, you won't know for sure.

Rob

Read only

Former Member
0 Likes
1,644

You have to DEQUEUE. But make sure you call calling the BAPI_TRANSACTION_COMMIT with wait = 'X'.

Albert

Read only

Former Member
0 Likes
1,644

Hi Vinod,

I also want to create an outbound delivery using that FM. So could u post the sample code to call the FM RV_DELIVERY_CREATE. I wanna know how to populate the parameters.

Regards

Vindika