Application Development 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: 

Function Module RV_DELIVERY_CREATE

Former Member
0 Kudos
452

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

Former Member
0 Kudos
191

What is the code for your commit?

Rob

Former Member
0 Kudos
191

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.

0 Kudos
191

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

0 Kudos
191

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.

0 Kudos
191

Can I use to dequeue_all for unlocking

0 Kudos
191

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

0 Kudos
191

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

0 Kudos
191

Is there anything in the return table after the commit?

Rob

0 Kudos
191

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

0 Kudos
191

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

0 Kudos
191

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

Rob

Former Member
0 Kudos
191

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

Albert

Former Member
0 Kudos
191

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