[ABAP] Elemente des Textpools (Selektionsbildtexte) lesen / schreiben

DATA: it_text TYPE STANDARD TABLE OF textpool.

PARAMETERS: p_report LIKE sy-repid DEFAULT sy-repid.
PARAMETERS: p_lang LIKE sy-langu DEFAULT sy-langu.

START-OF-SELECTION.

* Textpool lesen
  READ TEXTPOOL p_report INTO it_text LANGUAGE p_lang.

  LOOP AT it_text ASSIGNING FIELD-SYMBOL(<fs_line>).
    WRITE: / |{ <fs_line>-id } { <fs_line>-key } { <fs_line>-entry } { <fs_line>-length }|.
  ENDLOOP.

  IF lines( it_text ) > 0.
* Eintrag ändern
    it_text[ 1 ]-entry = 'Programm DEMO1'.

* Textpool schreiben
    INSERT TEXTPOOL p_report FROM it_text LANGUAGE p_lang.
  ENDIF.