Skip to Content
0

End routine to derive a value from 0plant

Feb 01, 2017 at 07:28 PM

47

avatar image
Former Member

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>

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

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

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hello Ricardo,

but for the value "A"...I need to consider the plants ranging from 1000-3000..so I was assuming that I need to mention a range in the routine like >=1000 and <= '3000'...how do we write that?

Thanks

0
Former Member
Former Member

Thanks it worked....Have a great day...

1