Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Upload program for Long text.

Former Member
0 Likes
733

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.

3 REPLIES 3
Read only

Former Member
0 Likes
661

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.

Read only

former_member632729
Contributor
0 Likes
661
Read only

Former Member
0 Likes
661

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