cancel
Showing results for 
Search instead for 
Did you mean: 

End Routine

anuja_s
Participant
0 Kudos

Hello Experts

I want to write end routine to load 0COMP_CODE based on calmonth and 0COUNTRY as below.

IF calmonth is between jan 2014 to jun 2014 then it will return company code based on following conditions.

    if 0country = AX1, AX2, AX3, AX4, AX5,AX6,GH6,BH6,KU9,BN8,TG9,RT5 ; 0COMP_CODE =  C70

    if 0country = TG9,RT5                                                                           ; 0COMP_CODE = J98

    if 0country = GH7,YU9                                                                          ; 0COMP_CODE =  C68

    if 0country = KO8                                                                                  ; 0COMP_CODE =  I98

IF calmonth is between july 2014 to dec 2014 then it will return company code based on following conditions.

    if 0country = AX1, AX2, AX3, AX4, AX5,AX6,GH6,BH6,KU9,BN8, ; 0COMP_CODE =  C70

    if 0country = GH7,YU9                                                                          ; 0COMP_CODE =  C68

    if 0country = KO8                                                                                  ; 0COMP_CODE =  I98

Please help.

Thanks & Regards

Anuja

Accepted Solutions (1)

Accepted Solutions (1)

anshu_lilhori
Active Contributor
0 Kudos

I am providing a rough code for the same:


LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.

IF <RESULT_FIELDS>-calmonth GE '201401'

and IF <RESULT_FIELDS>-calmonth LE '201406' .

If <RESULT_FIELDS>-country = 'AX1'

or

I<RESULT_FIELDS>-country = 'AX2'

or

<RESULT_FIELDS>-country = 'AX3'.

<RESULT_FIELDS>-comp_code= 'C70'.

endif.

endif.

Endloop.

Similarly you can write for other conditions.

Hope this gives an idea.

Regards,

AL

anuja_s
Participant
0 Kudos

Thanks Anshu.. It is working

Answers (0)