cancel
Showing results for 
Search instead for 
Did you mean: 

How to save long texts (>255 chars) in a table ?

Former Member
0 Kudos
1,182

Hi,

how can i save long texts/strings from a g_textfield, which are larger than 255 chars in a table? Are there any examples (text, textkey) ?

Many thanks,

Marcus

Accepted Solutions (0)

Answers (2)

Answers (2)

andreas_mann3
Active Contributor
0 Kudos

Hi,

use fm read_text

->

Andreas

Former Member
0 Kudos

Hi Andreas,

do you have more details? Where do i store the texts and how can i get them later (with a textkey?)

Marcus

andreas_mann3
Active Contributor
0 Kudos

HI Marcus,

look function group STXD

sample:

REPORT ztext01.
PARAMETERS ebeln LIKE ekko-ebeln.
DATA:  textname         LIKE thead-tdname,
       func,
       co_co            LIKE sy-index.
* Interne Tabellen
DATA  t_tf02hz LIKE thead OCCURS 0 WITH HEADER LINE.
DATA  t_tf02lz LIKE tline OCCURS 0 WITH HEADER LINE.

MOVE ebeln TO textname.

CALL FUNCTION 'INIT_TEXT'
     EXPORTING
          id       = 'F02'
          language = 'D'
          name     = textname
          object   = 'EKKO'
     IMPORTING
          header   = t_tf02hz
     TABLES
          lines    = t_tf02lz.

APPEND '  test 1 ' TO t_tf02lz.

CALL FUNCTION 'SAVE_TEXT'
     EXPORTING
          header          = t_tf02hz
          insert          = 'X'
          savemode_direct = 'X'
     IMPORTING
          newheader       = t_tf02hz
          function        = func
     TABLES
          lines           = t_tf02lz.

Andreas

Former Member
0 Kudos

Hi,

I think you can create a custom table with fields as textkey (Number range ) , text(255) . While saving a text , generate a number range and save it in that table.Check if the text is greater than 255 , if so then save it as a second entry with the same number range .Similarly save a new text with a new number range.

Hope you understood the logic.

Regards

Abhishek