Code: Alles auswählen.
DATA: x_name LIKE thead-tdname,
x_id LIKE thead-tdid VALUE 'PSTX', "Text-ID
x_spras LIKE thead-tdspras, "Sprache
x_object LIKE thead-tdobject VALUE 'PMS ', "Text-Obj.
x_dis_mod TYPE c, "Display oder Modif
x_title(30) TYPE c, "Text-Titel
x_save TYPE c, "Text automatisch sichern
x_txtfunc TYPE c, "Verarbeitungsart (N/U/D)
x_control LIKE itced, "Text-control
x_error TYPE c. "Fehler beim Text-Coyp
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'ZAD1'
LANGUAGE = SY-LANGU
NAME = X_NAME
OBJECT = 'ZADM'
IMPORTING
HEADER = X_HEAD
TABLES
LINES = X_TLINE
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC <> 0.
CALL FUNCTION 'INIT_TEXT'
EXPORTING
ID = 'ZAD1'
LANGUAGE = SY-LANGU
NAME = X_NAME
OBJECT = 'ZADM'
IMPORTING
HEADER = X_HEAD
TABLES
LINES = X_TLINE
EXCEPTIONS
OTHERS = 1.
ENDIF.
*-
CALL FUNCTION 'EDIT_TEXT'
EXPORTING
DISPLAY = X_DIS_MOD
EDITOR_TITLE = X_TITLE
HEADER = X_HEAD
SAVE = 'X'
LINE_EDITOR = 'X'
CONTROL = X_CONTROL
IMPORTING
FUNCTION = X_TXTFUNC
TABLES
LINES = X_TLINE
EXCEPTIONS
OTHERS = 1.
IF X_TXTFUNC EQ 'I'.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = X_HEAD
INSERT = ' '
SAVEMODE_DIRECT = 'X'
TABLES
LINES = X_TLINE
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = 'ZADM'
NAME = X_NAME
ID = 'ZAD1'
LANGUAGE = SY-LANGU
SAVEMODE_DIRECT = 'X'.
ELSEIF X_TXTFUNC EQ 'U'.
ENDIF.