Skip to Content
0
Former Member
Dec 12, 2013 at 09:35 AM

Comparing two character fields

29 Views

Dear Expert,

I am facing a peculiar issue even though it is an easy one but i am facing and so far unable to find the solution. in my reporting to create vendor, i have to compare to fields of character type, and if both character fields having the same content then CONTINUE should be triggered. but in my case it is not at all triggering the CONTINUE. my sample code is as follow. am just giving an abstract code as original is restricted.

types: begin of gty_itab,

f1 type char10,

f2 type char24,

f3 type char10,

end of gty_itab.

data : gt_itab type table of gty_itab,

gw_itab type gty_itab.

constants: c_text type c length 24 value 'DO NOT ADD TO THE OUTPUT'.

gw_itab-f1 = '1st qtr'.

gw_itab-f2 = 'do not add to the output'.

gw_itab-f3 = 'vendor'.

append gw_itab to gt_itab.

clear gw_itab.

gw_itab-f1 = '2nd qtr'.

gw_itab-f2 = 'Regular'.

gw_itab-f3 = 'customer'.

append gw_itab to gt_itab.

clear gw_itab.

gw_itab-f1 = '3rd qtr'.

gw_itab-f2 = 'do not add to the output'.

gw_itab-f3 = 'vendor1'.

append gw_itab to gt_itab.

clear gw_itab.

gw_itab-f1 = '4th qtr'.

gw_itab-f2 = 'irregular'.

gw_itab-f3 = 'vendor'.

append gw_itab to gt_itab.

clear gw_itab.

loop at gt_itab into gw_itab.

*translate gw_itab-f2 to upper case.

if ( gw_itab-f2 = c_text )..

continue.

endif.

write: / gw_itab-f1, gw_itab-f2, gw_itab-f3.

endloop.

Early reply will be apprecieated and rewarded.

Regards