‎2010 Jul 06 1:41 PM
Hi,
I need to replace a variable &data& in SO10 to his value but it doesn't work.
I use the FM 'TEXT_SYMBOL_REPLACE' to replace the words in the SO10.
Could you help me please?
In the transaction SO10, we have &eric&.
DATA:
lt_text TYPE STANDARD TABLE OF tline.
data : eric type char30 value 'Test'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
object = 'TEXT'
id = 'ST'
name = 'EMAIL'
language = sy-langu
IMPORTING
header = header
TABLES
lines = lines
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'TEXT_SYMBOL_REPLACE'
EXPORTING
header = header
program = sy-repid
REPLACE_TEXT = 'X'
TABLES
lines = lines.
Regards,
Shushu
Edited by: Shushu93 on Jul 6, 2010 2:42 PM
Edited by: Shushu93 on Jul 6, 2010 2:45 PM
Edited by: Shushu93 on Jul 6, 2010 2:46 PM
Edited by: Shushu93 on Jul 6, 2010 2:46 PM
Edited by: Shushu93 on Jul 6, 2010 2:47 PM
‎2010 Jul 06 1:52 PM
REPLACE keyword can be used with the TABLE Itab addition...to find and replace the value inside the table. Perhaps that would work better for you.
‎2010 Jul 06 1:52 PM
REPLACE keyword can be used with the TABLE Itab addition...to find and replace the value inside the table. Perhaps that would work better for you.
‎2010 Jul 06 2:00 PM
sorry i am new in abap.
Could you be more explicit, please?
thank you.
Edited by: Shushu93 on Jul 6, 2010 3:02 PM
‎2010 Jul 06 2:02 PM
type 'replace' in ABAP editor, put your cursor on that and press F1...you'll find the replace keyword documentation.
‎2010 Jul 06 2:10 PM
Ok thanks.
However, I know that i can do a loop to change the values of the table line
but I prefer to use the FM TEXT_SYMBOL_REPLACE to replace the variable
Do you know how to use it?
‎2010 Jul 06 2:58 PM
‎2010 Jul 06 4:02 PM
Hi,
I threw this code together quickly for you:
REPORT ZFM_TEST.
DATA: ls_head TYPE thead,
lt_lines TYPE STANDARD TABLE OF tline,
ls_lines TYPE tline,
l_total_lines TYPE i.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'ST'
LANGUAGE = 'E'
NAME = 'ZTEXT'
OBJECT = 'TEXT'
IMPORTING
HEADER = ls_head
TABLES
LINES = lt_lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
IF SY-SUBRC = 0.
LOOP AT lt_lines INTO ls_lines.
Write: 'Unformatted:', ls_lines-tdline.
ENDLOOP.
DESCRIBE TABLE lt_lines LINES l_total_lines.
CALL FUNCTION 'TEXT_SYMBOL_REPLACE'
EXPORTING
endline = l_total_lines
header = ls_head
TABLES
lines = lt_lines.
IF SY-SUBRC = 0.
LOOP AT lt_lines INTO ls_lines.
Write:/ 'Formatted:', ls_lines-tdline.
ENDLOOP.
ENDIF.
ENDIF.
Regards,
Phil
‎2010 Jul 06 4:20 PM