‎2014 Jun 26 6:58 AM
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
‎2014 Jun 26 7:11 AM
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
‎2014 Jun 26 7:10 AM
Hi srinivas,
Use string comparison operators like CA or CS.
Regards,
Venkat.
‎2014 Jun 26 7:11 AM
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
‎2014 Jun 26 7:28 AM
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.