2009 May 14 6:03 PM
Hi Gurus,
Can anybody give me the code for uploading long text for different tables.
The input file will contain,
TABLEKEY1 Table Key
TABLEKEY2 LongText
It would be a Tab delimited text file with input as Table Key and the Long text. If the long text is more than 72 characters, it would be split into more than 1 line based on number of characters.
Read the file using CL_GUI_FRONTEND_SERVICES- GUI_UPLOAD. Process the internal table and for each Key (tdname), fill the TLINE internal table and use SAVE_TEXT to load the long description.
I have the dought that what can be the length of the longtext in text file.
plz give me some sudo code for this.
Hi Gurus,
Can anybody give me the code for uploading long text for different tables.
The input file will contain,
TABLEKEY1 Table Key
TABLEKEY2 LongText
It would be a Tab delimited text file with input as Table Key and the Long text. If the long text is more than 72 characters, it would be split into more than 1 line based on number of characters.
Read the file using CL_GUI_FRONTEND_SERVICES- GUI_UPLOAD. Process the internal table and for each Key (tdname), fill the TLINE internal table and use SAVE_TEXT to load the long description.
I have the dought that what can be the length of the longtext in text file.
plz give me some sudo code for this.
2009 May 14 6:15 PM
I didn't get your request. Can you explain it in a better way?
To broke the text in 72 characters, use the FM: RKD_WORD_WRAP
Where outputlen parameter is the size of line.
I hope its was usefull.
2009 May 14 6:19 PM
2009 May 14 6:31 PM
Hi Raj,
[Link for Long text into 72 char..|]
ans also see the code..
LOOP AT t_texts WHERE kunnr IS NOT INITIAL.
w_tabix1 = sy-tabix.
t_lines-tdformat = '* '.
w_len = STRLEN( t_texts-text ).
w_cnt = 72.
w_tot = 1500.
* Now split the text into line lengths of 72 or less
WHILE w_len GT 0.
w_cnt = 72.
* Now need to make sure a word is not split in the middle
IF w_len GT 72 AND
t_texts-text+72(1) NE ' ' .
WHILE w_cnt GT 0.
w_cnt = w_cnt - 1.
IF t_texts-text+w_cnt(1) EQ ' '.
t_lines-tdline = t_texts-text+0(w_cnt).
EXIT.
ENDIF.
ENDWHILE.
ELSE.
t_lines-tdline = t_texts-text+0(w_cnt).
w_cnt = 72.
ENDIF.
APPEND t_lines. "Append to another internal table for further process to save text
endloop.
Regards,
Prabhudas
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |