Code: Alles auswählen.
DATA memory_id(30) VALUE 'SAPLSTXD'.
DATA:
BEGIN OF lt_catalog OCCURS 0,
tdobject LIKE thead-tdobject,
tdname LIKE thead-tdname,
tdid LIKE thead-tdid,
tdspras LIKE thead-tdspras,
function(1) TYPE c,
keep(1) TYPE c,
rename(1) TYPE c,
id(6) TYPE n,
copyindex(4) TYPE i,
is_reftext(1) TYPE c,
END OF lt_catalog.
data: wa_catalog like LINE OF lt_catalog.
IMPORT catalog TO lt_catalog FROM MEMORY ID memory_id.
READ TABLE lt_catalog into wa_catalog INDEX 1.
DATA l_cat_tdname LIKE wa_catalog-tdname.
l_cat_tdname = wa_catalog-tdname.
loop at lt_catalog into wa_catalog where tdobject = 'VBBK' and tdid = '0001'.
wa_catalog-tdobject = 'VBBP'.
wa_catalog-tdname = zlf_vbelnpos.
append wa_catalog TO lt_catalog.
ENDLOOP.
DATA: itctc like itctc OCCURS 1 WITH HEADER LINE.
itctc-destobject = 'VBBP'.
itctc-destname = zlf_vbelnpos.
itctc-destid = wa_catalog-tdid.
itctc-destlang = wa_catalog-tdspras.
itctc-srcobject = 'VBBK'.
itctc-srcname = l_cat_tdname.
itctc-srcid = wa_catalog-tdid.
itctc-srclang = wa_catalog-tdspras.
APPEND itctc.
BREAK-POINT.
* EXPORT catalog FROM lt_catalog TO MEMORY ID 'SAPLSTXD'. "Braucht man nicht, wird im COPY_TEXTS erledigt
CALL FUNCTION 'COPY_TEXTS'
EXPORTING
SAVEMODE_DIRECT = ' '
INSERT = 'X'
LOCAL_CAT = ' '
IMPORTING
ERROR = zlf_error
TABLES
texts = itctc
.
BREAK-POINT.
data zlf_sy_index LIKE sy-index.
data zlf_tdname like thead-tdname.
zlf_tdname = zlf_vbelnpos.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = 'VBBP'
NAME = zlf_tdname
ID = wa_catalog-tdid
LANGUAGE = wa_catalog-tdspras
* SAVEMODE_DIRECT = ' '
* KEEP = ' '
* LOCAL_CAT = ' '
IMPORTING
COMMIT_COUNT = sy-index
* TABLES
* T_OBJECT =
* T_NAME =
* T_ID =
* T_LANGUAGE =
.
BREAK-POINT.
EXIT.
Code: Alles auswählen.
DATA memory_id(30) VALUE 'SAPLSTXD'.
DATA:
BEGIN OF lt_catalog OCCURS 0,
tdobject LIKE thead-tdobject,
tdname LIKE thead-tdname,
tdid LIKE thead-tdid,
tdspras LIKE thead-tdspras,
function(1) TYPE c,
keep(1) TYPE c,
rename(1) TYPE c,
id(6) TYPE n,
copyindex(4) TYPE i,
is_reftext(1) TYPE c,
END OF lt_catalog.
data: wa_catalog like LINE OF lt_catalog.
IMPORT catalog TO lt_catalog FROM MEMORY ID memory_id.
READ TABLE lt_catalog into wa_catalog INDEX 1.
DATA l_cat_tdname LIKE wa_catalog-tdname.
l_cat_tdname = wa_catalog-tdname.
loop at lt_catalog into wa_catalog where tdobject = 'VBBK' and tdid = '0001'.
wa_catalog-tdobject = 'VBBP'.
wa_catalog-tdname = zlf_vbelnpos.
append wa_catalog TO lt_catalog.
ENDLOOP.
DATA: itctc like itctc OCCURS 1 WITH HEADER LINE.
itctc-destobject = 'VBBP'.
itctc-destname = zlf_vbelnpos.
itctc-destid = wa_catalog-tdid.
itctc-destlang = wa_catalog-tdspras.
itctc-srcobject = 'VBBK'.
itctc-srcname = l_cat_tdname.
itctc-srcid = wa_catalog-tdid.
itctc-srclang = wa_catalog-tdspras.
APPEND itctc.
BREAK-POINT.
* EXPORT catalog FROM lt_catalog TO MEMORY ID 'SAPLSTXD'. "Braucht man nicht, wird im COPY_TEXTS erledigt
CALL FUNCTION 'COPY_TEXTS'
EXPORTING
SAVEMODE_DIRECT = ' '
INSERT = 'X'
LOCAL_CAT = ' '
IMPORTING
ERROR = zlf_error
TABLES
texts = itctc
.
BREAK-POINT.
data zlf_sy_index LIKE sy-index.
data zlf_tdname like thead-tdname.
zlf_tdname = zlf_vbelnpos.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = 'VBBP'
NAME = zlf_tdname
ID = wa_catalog-tdid
LANGUAGE = wa_catalog-tdspras
* SAVEMODE_DIRECT = ' '
* KEEP = ' '
* LOCAL_CAT = ' '
IMPORTING
COMMIT_COUNT = sy-index
* TABLES
* T_OBJECT =
* T_NAME =
* T_ID =
* T_LANGUAGE =
.
BREAK-POINT.
EXIT.