2009 Feb 24 10:40 AM
Hi All,
I have added a field 'XXXX' in the sales order header of VA01(8309) and sales order items of VA01(8459).Now the requirement is
For Eg: There are 10 items for a sales order header and if the value of the new added field is same for all the items. then the value of the sales order header(VBAK-XXXX) should be moved to the all sales orderitems(VBAP-XXXX).
Please suggest the user exit if need for this requirement or shall i use PAI in the screen 8309. Please reffer the sample also code.
Thanks in advance,
Narasimha
2009 Feb 24 1:04 PM
Hi,
User exit for VA01 is MV45AFZZ.
But this i think you can achive throug copy control of header to line item.Please check with your functional consultant.
Hope this helps you.
Regards,
Amitteja
2009 Feb 24 1:04 PM
Hi,
User exit for VA01 is MV45AFZZ.
But this i think you can achive throug copy control of header to line item.Please check with your functional consultant.
Hope this helps you.
Regards,
Amitteja
2009 Feb 24 1:29 PM
Hi Amitteja,
I have spoken with my functional consultant. He suggested that copy control is always between the documents but not with in the document.
Please suggest the user exit for this requirement.
I have already used userexit_move_field_to_vbap.
In that i have written the following code but its not working
IF VBAP-ZZAUGRU is initial
VBAP-ZZAUGRU = VBAK-ZZAUGRU.
ENDIF.
Please suggest the exit and anything added to the code.
Regards,
Narasimha
2009 Feb 24 1:55 PM
Hi Narasimha,
Try writing the following code in the same user exit:
LOOP AT XVBAP.
IF XVBAP-ZZAUGRU is initial
XVBAP-ZZAUGRU = VBAK-ZZAUGRU.
MODIFY XVBAP TRANSPORTING ZZAUGRU.
ENDIF.
Regards,
Ramesh.
2009 Feb 25 4:38 AM
Hi Ramesh,
Thanks for ur reply.
I have used the same code in the userexit_move_field_to_vbap.
LOOP AT XVBAP.
IF XVBAP-ZZAUGRU is initial.
XVBAP-ZZAUGRU = VBAK-ZZAUGRU.
MODIFY XVBAP TRANSPORTING ZZAUGRU.
ENDIF.
ENDLOOP.
But the values of fields are not moving from header to item details in VA01 & VA02
Please have a look at the code and suggest if any thing to add.
Regards,
Narasimha
2009 Feb 25 5:00 AM
Hi Ramesh,
Forgot to mention in the previous post.
I want the same logic to be done in VA02 & VA03 i.e., the value of field(ZZAUGRU) should moved to vbap(from header to item).
Regards,
Narasimha
2009 Feb 25 8:15 AM
Hi Narasimha,
First check in userexit_movefield_to_vbak whether you have to assign XVBAK-ZZAUGRU value to VBAK-ZZAUGRU.
Then in userexit_movefield_to_vbap check whether any value is captured in VBAK-ZZAUGRU field before it is moved to VBAP structure, i mean put a break point and chek.If it is not there, then check in XVBAK--ZZAUGRU.
Ramesh.
2009 Mar 02 8:15 AM