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

Split Line item in VA02

Former Member
0 Likes
772

Hi,

Requirement : If partial stock exist, item should be splitted into 2 line items. (MTS & MTO).

ex : If available stock for Material M1 is 30.

Input : Item Material Qty

10 M1 50.

Output : Item Material Qty

10 M1 30 MTS

11 M1 20 MTO

We are able to do it during Sale Order creation (VA01). We are facing problem during Change (VA02).

Sale order created with material M1 of qty 30. When we try to change the quantity to 50 in Sales order Change (VA02), it is not splitting.

During initial case (Sale order Creation), the logic was written in exit : USEREXIT_MOVE_FIELD_TO_VBAK.

During Change(VA02), above exit will not be useful. Hence tried to use exit : USEREXIT_MOVE_FIELD_TO_VBEP.

We are not able to add new item at this level.

I couldn't find helpful information on SDN history, can any one share your ideas.

Thank you.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
627

Did you consider using product substitution? I think product substitution can resolve your issue.

Hi,

Requirement : If partial stock exist, item should be splitted into 2 line items. (MTS & MTO).

ex : If available stock for Material M1 is 30.

Input : Item Material Qty

10 M1 50.

Output : Item Material Qty

10 M1 30 MTS

11 M1 20 MTO

We are able to do it during Sale Order creation (VA01). We are facing problem during Change (VA02).

Sale order created with material M1 of qty 30. When we try to change the quantity to 50 in Sales order Change (VA02), it is not splitting.

During initial case (Sale order Creation), the logic was written in exit : USEREXIT_MOVE_FIELD_TO_VBAK.

During Change(VA02), above exit will not be useful. Hence tried to use exit : USEREXIT_MOVE_FIELD_TO_VBEP.

We are not able to add new item at this level.

I couldn't find helpful information on SDN history, can any one share your ideas.

Thank you.

2 REPLIES 2
Read only

Former Member
0 Likes
627

How do you know the stock exists? What if you have two orders and both exceed the available stock for a particular material? You update the first order (By the way, ITEMS are in table VBAP, VBEP contains the schedule lines for an ITEM, showing what quantities you can deliver and when if you utilize ATP). After you update the first order, to 30 and 20, you encounter second order for 35. So you split it into 30 and 5? Is that right? How are you going to deliver 60? Now, if your installation uses ATP, SAP would create the schedule lines correctly, showing what actually can be delivered, considering stock already "consumed" by another order/item/schedule line.

And, handling additional item lines is not a function of user exit for VBAK (header row). Look for userexits in MV45AFZx that refer to VBAP for items and VBEP for schedule lines!

Read only

Former Member
0 Likes
628

Did you consider using product substitution? I think product substitution can resolve your issue.