2020 Jan 17 12:17 PM
Hi,
i want to change received storage loc.(afpod-lgort) field depend on work center.
i use IF_EX_WORKORDER_UPDATE~BEFORE_UPDATE as below:
FIELD-SYMBOLS: <fs_header> TYPE LINE OF cobai_t_header.
FIELD-SYMBOLS: <fs_item> TYPE LINE OF cobai_t_item.
LOOP AT it_header ASSIGNING <fs_header>.
SELECT SINGLE a~arbpl "i can select work center using this way
INTO lv_arbpl
FROM crhd AS a INNER JOIN afvc AS b
ON a~objid EQ b~arbid
WHERE b~aufpl EQ <fs_header>-aufpl.
ENDLOOP.
"Below code not working.i cannot change it_items table data.
if lv_arbpl eq 'ABC'.
LOOP AT <fs_item> ASSIGNING <fs_items>.
<fs_items>-lgort= 'XYZ'.
ENDLOOP.
endif.
How can i change this data?
Thnks,
2020 Jan 17 12:34 PM
Please use [CODE] button to display code part.
We didn't know where & how <fs_item> is assigned in your code. We didn't know the input/ouput of the code
2020 Jan 17 12:47 PM
DATA: lv_lgort TYPE lgort_d.
CLEAR lv_lgort.
FIELD-SYMBOLS: <fs_header> TYPE LINE OF cobai_t_header.
FIELD-SYMBOLS: <fs_item> TYPE LINE OF cobai_t_item.
LOOP AT it_header ASSIGNING <fs_header>.
SELECT SINGLE c~lgort
INTO lv_lgort
FROM crhd AS a INNER JOIN afvc AS b
ON a~objid EQ b~arbid
INNER JOIN ztnt113 AS c " our ztable for lgort
ON a~arbpl EQ c~zmakkodu
WHERE b~aufpl EQ <fs_header>-aufpl.
ENDLOOP.
LOOP AT it_item ASSIGNING <fs_item>. "here is not assingned.
<fs_item>-lgort = lv_lgort.
ENDLOOP.
UNASSIGN <fs_header>.
UNASSIGN <fs_item>.<br>