Skip to Content
avatar image
Former Member

End routine to derive a value from 0plant

Hello,

I need help in writing an end routine as I am new to writing routines. So I appreciate if someone could show me the routine that I need to add in for my requirement.

I need to derive the below values from the 0plant master data. and the values "A", "B" and "C" needs to be updated to a field in Target "ZIND"

Plants ranging from 1001 - 3000 = "A"

Plants that start with "B" (eg B1234 or B123) = "B"

Plants that start with "C" (eg CA123 or CV123) = "C"

I need to write it in a end routine as I Have 0plant from source is mapped to 0plant in target.

Can this is my scenario and can someone let me know the routine that I need to add after the below step?

LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Feb 01, 2017 at 09:12 PM

    Hi;

    Try this (replace /BIC/TARGET by your IO target)

    LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.

    IF <RESULT_FIELDS>-PLANT+0(1) = ‘1’

    OR <RESULT_FIELDS>-PLANT+0(1) = ‘2’

    OR <RESULT_FIELDS>-PLANT+0(1) = ‘3’

    <RESULT_FIELDS>-/BIC/TARGET = ‘A’.

    ELSEIF <RESULT_FIELDS>-PLANT+0(1) = ‘B’.

    <RESULT_FIELDS>-/BIC/TARGET = ‘B’.

    ELSEIF <RESULT_FIELDS>-PLANT+0(1) = ‘C’.

    <RESULT_FIELDS>-/BIC/TARGET = ‘C’.

    ENDIF.

    ENDIF.

    ENDIF.

    ENDLOOP.

    Regards

    Add comment
    10|10000 characters needed characters exceeded