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: 

SAPMV45A: User-Exit to handle sub item quantity

Weiskopf
Participant
0 Kudos

Hello,

In SD sales order (VA01) I create line item 10 with sub item 11 such as:

10	89464988	1 M
11	99912001	1 PC	10

If I change the quantity of main item from 1 to e.g. 2 so the quantity of sub item will also be changed to 2.

Now, Iu2019m looking for a possibility to hold the quantity of sub item to 1.

In SAPMV45A I cannot find an appropriated user-exit for that.

How can I set the quantity to 1 in sub item? What exit can be used for that?

Thank your for your hints in advance.

Regards,

Kurt.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Kurt,

you could try USEREXIT_FILL_VBAP_FROM_HVBAP in MV45AFZB, but i'm not sure if it's executed in case of change the subitem.

Else you could use the USEREXIT_CHECK_VBAP and check there the XVBAP-UEPOS. If that's not initial, it's a subitem.

Regards Wolfgang

6 REPLIES 6

Former Member
0 Kudos

Hello Kurt,

you could try USEREXIT_FILL_VBAP_FROM_HVBAP in MV45AFZB, but i'm not sure if it's executed in case of change the subitem.

Else you could use the USEREXIT_CHECK_VBAP and check there the XVBAP-UEPOS. If that's not initial, it's a subitem.

Regards Wolfgang

0 Kudos

Hello Wolfgang,

thank you for your reply.

But, I would like to update the quantity (VBEP-WMENG); can I do that in the same exit?

Thanks & regards,

Kurt.

0 Kudos

Hello Kurt,

in that case you could also try the USEREXIT_CHECK_VBEP. In XVEBP you get the number of the position, that you can read in table xvbap.

Just but an breakpoint inside the exits and try, which is the best for your case.

In general, in these old SAPMV45A-Exits you have access to all internal areas and tables that are defined in the program (XBAP, XBEP and so on). That makes it so easy to change - but also so dangerous.

Regards Wolfgang

0 Kudos

Hi Kurt,

Could please check with the routine FORM userexit_save_document_prepare OR FORM userexit_save_document

in the INCLUDE MV45AFZZ of the VA01 main program. Loop XVBEP table in this routine and modify the item quantity entrry. You can even find the XVBAP entries in this rotine also.

It is going to help you to resolve this problem. Please check.

Regards,

Chandan

Former Member
0 Kudos

Hello Kurt,

Did you try the exit FORM userexit_move_field_to_vbep. In MV45AFZZ.

Regards

0 Kudos

Hello Kiron,

I tried the exit, but it doesnu2019t work. The quantity cannot be changed.

Do you have any idea?

Thanks & best regards,

Kurt.