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.