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: 

about string comparision

Former Member
0 Kudos

Hi all,

Thanks in Advance.

I here i have my data in one internal table called g_t_comp. so here i need to attach a screen on which i need to add text boxes.

1) source string

2) destination string

what i need to do is from my data in the internal table. i need to replace the source string with the destination string into my internal table.

FOR EXAMPLE....

i have data in my ITAB like.

govardhan

rajesh

govarrao

rajan

rajasekhar

so

if i give source string as 1)gov

and destination as 2)hello

my ITAB shoul be filled with

helloardhan

rajesh

helloarrao

rajan

this is the situation......

please help me out......

1 ACCEPTED SOLUTION

former_member189059
Active Contributor
0 Kudos
loop at itab.
 replace all occurrences of 'gov' in itab-fieldname with 'hello'. "put the reqd fieldname
 modify itab.
endloop.
4 REPLIES 4

former_member189059
Active Contributor
0 Kudos
loop at itab.
 replace all occurrences of 'gov' in itab-fieldname with 'hello'. "put the reqd fieldname
 modify itab.
endloop.

0 Kudos

Hi kris,

really itz an help full answer.

byeee.

Former Member
0 Kudos

HI,

see this code.

data:begin of itab occurs 0,

field(30),

end of itab.

PARAMETERS:source(10),dest(10).

itab = 'GOVARDHAN'.

append itab.

itab = 'RAJESH'.

append itab.

itab = 'GOVARRAO'.

append itab.

itab = 'RAJAN'.

append itab.

itab = 'RAJASEKHAR'.

append itab.

loop at itab.

write:/ itab.

endloop.

loop at itab.

replace source in itab-field with dest IGNORING CASE.

modify itab.

endloop.

SKIP.

loop at itab.

write:/ itab.

endloop.

rgds,

bharat.

0 Kudos

hi Bharath,

i'll make it a try .

Thanks.