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: 

Move values of fields from VBAK to VBAP in VA01

Former Member
0 Kudos
724

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos
264

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

7 REPLIES 7

Former Member
0 Kudos
265

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

0 Kudos
264

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

0 Kudos
264

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.

0 Kudos
264

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

0 Kudos
264

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

0 Kudos
264

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.

0 Kudos
264

Thanks Ramesh my issue was resolved.

Regards,

Narasimha