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: 

Setting Movement Reason on a delivery

Former Member
0 Kudos

Hi

We are creating Inbound/Outbound Deliveries in backround base on PO/SO. The BAPI BAPI_DELIVERYPROCESSING_EXEC is used.

The problem is - we need to also set the Movement Reasong field LIPS-GRUND. But I can't found a field on the bapi tables for it.

I looked at other bapis for delivery change, I also looked at function modules for Delivery and I can't find any where you can set that field.

Does anyone know of a way to set lips-grund programatically.

Thanks

Elona

9 REPLIES 9

former_member194669
Active Contributor
0 Kudos

Have you checked fm WS_DELIVERY_UPDATE and importing table VBPOK_TAB and field MDIFF_GRUND ?

0 Kudos

Thanks so much for your reply.

I tried the FM WS_DELIVERY_UPDATE, and I set the VBPOK-MDIFF_GRUND field.

The funcion ended without any errors, but no updates had occured. The Movement Reason filed in LIPS is still Empty - So this did not work (I made sure the commit flag was on and even did a commit work at the end of the function call just in case)

I also tried FM LE_MOB_DELIVERY_UPDATE - setting LIPS-GRUND. The same story - FM terminates succsessfuly but no change in LIPS-GRUND Field.

Elona

0 Kudos

not sure, Is there any UPDATE flag field(like UPDKZ) need to b populated in any bapi structure/table/parameter? or export it from ur Z prog. and import it in correcpsonding user exit in sapmv50afz1 and modify XLIPS, make sure free the memory ID after importing.. just a thought.

thanq

0 Kudos

I am not sure where that Update flag would be. There isn't any provided on the FM. Also the function works for updating other fields, just not this one.

Elona

0 Kudos

I found a badi for BAPI_DELIVERYPROCESSING_EXEC.

LE_SHP_DELIVERY_PROC it has a method FILL_DELIVERY_ITEM. This method can set the Movement Reason (GRUND) field.

Elona

Former Member
0 Kudos

I found a badi that does what is needed.

0 Kudos

Hi Elona Buchman ,

can you kindly give me the BADI name, which you are using. i also have the requirement to do that.

and give me what all the necessary parameters required to update reason code.

thanks,

vinayaka

0 Kudos

Hi Vinayaka

The BADI is LE_SHP_DELIVERY_PROC it has a method FILL_DELIVERY_ITEM. In that method the LIPS structure is available for you to populate with any value that you need to pass to the delivery.

If you set LIPS-GRUND to whatever value you need the delivery will be saved with that value in the Movement Reason.

Just remember the code in this BADI will be executed every time BAPI BAPI_DELIVERYPROCESSING_EXEC is called. So make your chages specific enough to your case so that if someone else is using the same BAPI their results will not get affected.

Also it is good to know what logic/Business Rules you are using - and implement it inside that BAPI rather than passing it (There is no parameters to pass information to the BADI). But if you don't have the logic and do not know before hand, you can Import/Export the value.

If by any chance you are not using BAPI BAPI_DELIVERYPROCESSING_EXEC, you can use user exit MV50AFZ1 the same way. Just be double careful here becuase this will execute every time you create or change a delivery (Including Manually).

Hope this helps

Elona

0 Kudos

Hi Vinayaka

The BADI is LE_SHP_DELIVERY_PROC it has a method FILL_DELIVERY_ITEM. In that method the LIPS structure is available for you to populate with any value that you need to pass to the delivery.

If you set LIPS-GRUND to whatever value you need the delivery will be saved with that value in the Movement Reason.

Just remember the code in this BADI will be executed every time BAPI BAPI_DELIVERYPROCESSING_EXEC is called. So make your chages specific enough to your case so that if someone else is using the same BAPI their results will not get affected.

Also it is good to know what logic/Business Rules you are using - and implement it inside that BAPI rather than passing it (There is no parameters to pass information to the BADI). But if you don't have the logic and do not know before hand, you can Import/Export the value.

If by any chance you are not using BAPI BAPI_DELIVERYPROCESSING_EXEC, you can use user exit MV50AFZ1 the same way. Just be double careful here becuase this will execute every time you create or change a delivery (Including Manually).

Hope this helps

Elona Buchman