‎2006 Apr 18 2:20 PM
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.
‎2006 Apr 18 2:47 PM
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..!
‎2006 Apr 18 2:47 PM
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..!
‎2006 Apr 18 4:44 PM