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: 

LE_SHP_DELIVERY_PROC BAdi implementation - capture delivery item change

Former Member
0 Kudos
1,808

Hi Community Members,

I am recently working on enhancement which is going to forbid quantity changes for delivery line items

if corresponding PO line item is blocked or deleted.

To do this I want to use BAdi LE_SHP_DELIVERY_PROC (Enhancements in Delivery Processing)

One of methods PUBLISH_DELIVERY_ITEM imports 2 internal tables:

IT_XLIPS Current Status of Delivery Items

IT_YLIPS Database Status: Delivery Items

Inside the method I am checking if recent quantity value (IT_XLIPS-LFIMG) is not equal to the one from database (IT_YLIPS-LFIMG). If so then I throw error.

Everything is ok, but I have encountered a strange behavior.

For example when I change delivery item quantity (LFIMG, for example 1->2 ) and then go back to the initial value (2->1)...

The problem is that when entering the method (debugger) I can see inside IT_XLIPS that LFIMG is updated, but Gross/Net weigth and volume fields still have old values (NTGEW, BRGEW, VOLUM).

That is a problem because highly possible is that after quantity field customer will also want to validate weight and volume fields.

Moreover I also checked FILL_DELIVERY_ITEM and CHANGE_DELIVERY_ITEM methods of BAdi mentioned. In all of them weight/volume (and probably other fields also) behave the same.

Could you share your comments on this issue please?

What would you recommend to do to enable such validation?

Kind Regards,

Piotr.

1 ACCEPTED SOLUTION

eduardo_hinojosa
Active Contributor
0 Kudos
189

Hi

Check method DELIVERY_FINAL_CHECK. See the sample implementation and how you can write the message in CT_FINCHDEL.

Other option is to use the classic userexits. See SAP Note 415716 - User exits in delivery processing with the recommendations for them.

I hope this helps you

Regards

Eduardo

3 REPLIES 3

eduardo_hinojosa
Active Contributor
0 Kudos
190

Hi

Check method DELIVERY_FINAL_CHECK. See the sample implementation and how you can write the message in CT_FINCHDEL.

Other option is to use the classic userexits. See SAP Note 415716 - User exits in delivery processing with the recommendations for them.

I hope this helps you

Regards

Eduardo

0 Kudos
189

Hi Eddy,

I find your reply very useful.

Fault was of course mine - I was throwing 'E' message to the screen when validating DLV line item.

According documentation BAdi methods do not support messages thrown directly to the screen (with ABAP MESSAGE statement).

For this purpose CT_FINCHDEL, CT_LOG ... itables should be used.

Your reply has solved my problem!

Thank you very much!

0 Kudos
189

I have a similer type of requirement. I have checked in the method 'DELIVERY_FINAL_CHECK' and 'SAVE_DOCUMENT_PREPARE', populated the corresponding log table and executed VL34. In both the cases, the log is showing the error message, but the delivery is getiing created.