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

user exit help

Former Member
0 Likes
480

Hi all,

im working on exit MV45AFZZ --

ship-to party city or town (field ORT01) should be derived and populated into field (VBKD-INCO2). If this field is blank then use the sold-to party city otherwise leave the field as is.

data: v_ort01 like kna1-ort01.

if vbkd-inco2 is initial.

select single ort01 from kna1 into v_ort01

where kunnr = kuwev-kunnr.

endif.

if sy-subrc = 0.

move v_ort01 to vbkd-inco2.

endif.

form is USEREXIT_MOVE_FIELD_TO_VBKD

i have done this bit of code. but it is giving me an erro saying that the header data is not related to item data r something like that.

i dont know wats going wrong. is there anything i have to do other than the bit i have done. new to this please help me.

Thanks,

Kiran.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
446

Hello Kiran,

See VBKD is a line item table for the orders. So, you have to access the internal table <b>XVBKD</b>

So,

data: v_ort01 like kna1-ort01.

loop at xvbkd.

if xvbkd-inco2 is initial.

select single ort01 from kna1 into v_ort01

where kunnr = kuwev-kunnr.

if sy-subrc = 0.

move v_ort01 to xvbkd-inco2.

endif.

endif.

endloop.

Regards,

Naimesh

Reward points, if it is helpful..!

2 REPLIES 2
Read only

naimesh_patel
Active Contributor
0 Likes
447

Hello Kiran,

See VBKD is a line item table for the orders. So, you have to access the internal table <b>XVBKD</b>

So,

data: v_ort01 like kna1-ort01.

loop at xvbkd.

if xvbkd-inco2 is initial.

select single ort01 from kna1 into v_ort01

where kunnr = kuwev-kunnr.

if sy-subrc = 0.

move v_ort01 to xvbkd-inco2.

endif.

endif.

endloop.

Regards,

Naimesh

Reward points, if it is helpful..!

Read only

0 Likes
446

thanks a lot naimesh.