cancel
Showing results for 
Search instead for 
Did you mean: 

Splitting line item in Sales Order-VA02

reazuddin_md
Active Contributor
0 Kudos

Hello All,

I got struck with the below requirement, Can someone share their ideas, if any one come across such case.

Requirement : If ordered material obsolete then system has to propose follow up material ( which will be maintained in MMR-MRP4 view - Followup material field) based on stock availability.

We have done the same by using USEREXIT in Sales order creation & working fine without any issues.

But, If stock partially exists for entered material, then new line item has to add/insert with the follow up material.

Eg;

M1- stock -30 ea

M2- No stock ( Follow up material)

*In Sales Order Creation- VA01,*

Line Item -- Material - Ordered Qty

M1 - 50 Qty (ordered qty)

Result;

Line Item -- Material - Ordered Qty - Item Cat

10----M1-----30 ea - TAN

11----M2--


20 ea - TAB ( MTO)

Working fine-

We are able to do it during Sale Order creation (VA01).

*Change mode of Sales order - VA02;*

Line Item -- Material - Ordered Qty - Item Cat

10----M1-----30 ea - TAN

11----M2--


20 ea - TAB ( MTO)

if user increases the M1 qtty to 10 Ea, then system should behave as shown in below eg,

Line Item -- Material - Ordered Qty - Item Cat

10----M1-----30 ea - TAN

11----M2--


20 ea - TAB ( MTO)

12----M2--


10 ea -- TAB(MTO)

But We are facing problem during Change mode .

in VA01- (Sale order Creation), the logic was written in exit : USEREXIT_MOVE_FIELD_TO_VBAK - which is working fine

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

But not able to add new item at this level.

All useful ideal will be appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Jelena
Active Contributor
0 Kudos

Couldn't this be achieved by using material determination/substitution?

Anyway, I think in this example it should not add line 12 but increase the quantity in line 11. Otherwise a user makes 10 changes and - kaboom!

Not quite sure why the VBAK user exit was used to begin with... Wouldn't USEREXIT_MOVE_FIELD_TO_VBAP be more suitable for this? In the worst case USEREXIT_SAVE_DOCUMENT_PREPARE could be used as well. Make sure to check the current mode (create/change) and code accordingly.

reazuddin_md
Active Contributor
0 Kudos

Thanks for attempting this thread.

Material determination will not suffice our requirement, because it will not substitute the follow up material, when entered material have partial stock. In VB12 - MRP indicator will active only when stock is not available for entered material & results according to the substitution reason

In our case,

if entered material doesnt have stock, then follow up material should replace with complete ordered qty,

if entered material have partial stock exists, then system confirms for available qtty & create new line item with balance qtty, item cat-TAB----


that is the reason we didnt go for material determination. ( you cant have 2 substitution reasons for one record in VB12)

VBAK has to be used to check the overall document qtty. the above explained scenario working fine with our development in create mode.

But in change mode, if user tries to increase the qtty in entered material, then this one more new line item has to create for folloup material with excess qty - is our requirement .

Hope its clear now, still if any queries let me know

Answers (1)

Answers (1)

reazuddin_md
Active Contributor
0 Kudos

Closed, informed logic wont work in change mode