Application Development and Automation 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: 
Read only

read_text output

Former Member
0 Likes
761

Hi ,

I am using RED_TEXT function module in script driver program, after execution of read_text, in reult text it contains 'TEXT PRINTED IN BOLD '

Now i need to delete TEXT from that resulted text , the text is available in another variable TEXT,

Need To compare and delete the particular text from resulted text  .

example:

       read_text result is : 'TEXT PRINTED IN BOLD'

       variable :              ' TEXT'

now i need result is 'TEXT PRINTED IN BOLD'

how to do this

please help

Thanks

Srini

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
626

Look at REPLACE statement documentation, try something lik


REPLACE ALL OCCURRENCES OF 'TEXT' IN warea WITH ``. " or FIRST

CONDENSE warea. " remove leading/double spaces

Regards,

Raymond


3 REPLIES 3
Read only

Former Member
0 Likes
626

Hi srinivas,

Use string comparison operators like CA or CS.

Regards,

Venkat.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
627

Look at REPLACE statement documentation, try something lik


REPLACE ALL OCCURRENCES OF 'TEXT' IN warea WITH ``. " or FIRST

CONDENSE warea. " remove leading/double spaces

Regards,

Raymond


Read only

Former Member
0 Likes
626

Hi Srinivas,

To dynamically remove 'TEXT' from string, you can try below code:

data:lv_string type string value 'TEXT PRINTED IN BOLD'.

data:i_data type table of string,

      wa_data type string,

      lv_count type i.

split lv_string at space into table i_data.

  describe table i_data lines lv_count.

  clear lv_string.

do.

   read table i_data into wa_data index lv_count.

   if wa_data ne 'TEXT'.

     concatenate wa_data lv_string into lv_string separated by space.

    endif.

    clear wa_data.

    lv_count = lv_count - 1.

    if lv_count le 0.

      exit.

     endif.

  enddo.


Also as mentioned by Raymond we can use 'Replace all occurances' and its better approach too..


Regards,

Greeshma.