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: 

User exit for received storage location depend on arbpl on co01

0 Kudos
284

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,

2 REPLIES 2

FredericGirod
Active Contributor
0 Kudos
144

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

144
    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>