04-05-2012 11:28 AM
Hello Experts,
I am doing a report for mail functionality.I am getting my title and body from a standard text.But the title also contains some dynamic varibles like
Vendor name XXXXXXX payment ID and Country XXXXX. I am using Read_text to get the standard text and the output varible is of type string.Please tell me know i can populate dynamic values.
Thanks ,
Vijay.
04-05-2012 11:35 AM
Loop the entries returned in tables TLINES from FM READ_TEXT.
LOOP AT i_tlines INTO wa_tlines.
CONCATENATE v_string wa_tlines-tdline INTO v_string
SEPERATED BY space.
CLEAR : wa_lines.
ENDLOOP.
Just check where exactly you can fit the Vendor number and Country value in above loop.
04-05-2012 11:43 AM
Hello Bala Krishna,
The value for the vendor number is populated from the report similarly for remaining dynmaic variables also like how we do &var& do we have any procision here?
Thank you,
Vijay.
04-05-2012 11:51 AM
It depends on the long text you are getting with the read_text and where exactly you want the vendor name and country name.
What you can do is, search for the word 'Vendor' in wa_tline-tdline before concatenate statement. you get the value, add the vendor number, to wa_tline-tdline.
04-05-2012 12:05 PM
i am maintaing Vendor name XXXXXXX payment ID and Country XXXXX as a text in std text. I have three things to be populated on is vendor number payment id and country dynamically.
04-05-2012 12:21 PM
04-05-2012 12:26 PM
You should have a look into the function TEXT_SYMBOL_REPLACE. Call READ_TEXT first and then call the function like below
DESCRIBE TABLE tlines LINES lf_lines.
CALL FUNCTION 'TEXT_SYMBOL_REPLACE'
EXPORTING
endline = lf_lines
header = ls_header
program = lf_repid "Program name that hold global variables
TABLES
lines = tlines.
The tlines are the contents from READ_TEXT. The place holders in you text must be same as the global variables in your program for getting it replaced.
04-05-2012 12:50 PM
I would never recommend a direct concatenation of tline i.e. long text line. You may loose any formatting. Rather use CONVERT_ITF_TO_STREAM_TEXT. It takes tline as input and gieve you string with all newlines , tabs etc.. After 'TEXT_SYMBOL_REPLACE' call the above FM .