Code: Alles auswählen.
Report ZR_TEST.
TABLES: EINA.
SELECT-OPTIONS: S_INFNR FOR EINA-INFNR.
DATA: BEGIN OF HTEXT.
INCLUDE STRUCTURE THEAD.
DATA: END OF HTEXT.
DATA: BEGIN OF LTEXT OCCURS 50.
INCLUDE STRUCTURE TLINE.
DATA: END OF LTEXT.
DATA: BEGIN OF DTEXT OCCURS 50.
DATA: INFNR LIKE EINA-INFNR.
INCLUDE STRUCTURE TLINE.
DATA: END OF DTEXT.
DATA: TNAME LIKE THEAD-TDNAME.
SELECT * FROM EINA. "WHERE WERKS IN S_WERKS.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'AT'
LANGUAGE = 'D'
NAME = TNAME
OBJECT = 'EINA'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER = HTEXT
* OLD_LINE_COUNTER =
TABLES
LINES = LTEXT
* EXCEPTIONS
* ID = 1
* LANGUAGE = 2
* NAME = 3
* NOT_FOUND = 4
* OBJECT = 5
* REFERENCE_CHECK = 6
* WRONG_ACCESS_TO_ARCHIVE = 7
* OTHERS = 8.
.
LOOP AT LTEXT.
IF LTEXT-TDLINE NE ''.
MOVE LTEXT-TDLINE TO DTEXT-TDLINE.
MOVE EINA-INFNR TO DTEXT-INFNR.
APPEND DTEXT.
ENDIF.
ENDLOOP.
ENDSELECT.
LOOP AT DTEXT.
WRITE:/ DTEXT-INFNR, DTEXT-TDLINE.
ENDLOOP.
Code: Alles auswählen.
TNAME = EINA-INFNR.
Code: Alles auswählen.
SELECT * FROM EINA
WHERE INFNR IN S_INFNR.
SELECT * FROM THEAD CLIENT SPECIFIED
WHERE TNAME = EINA-INFNR.
ENDSELECT.
CALL FUNCTION 'READ_TEXT'
EXPORTING
Dein Code ist unvollständigchristof hat geschrieben:Sehrwahrschienlich müsste ich ein anderen Code wählen
Code: Alles auswählen.
Report ZR_TEST.
TABLES: EINA.
SELECT-OPTIONS: S_INFNR FOR EINA-INFNR.
DATA: BEGIN OF HTEXT.
INCLUDE STRUCTURE THEAD.
DATA: END OF HTEXT.
DATA: BEGIN OF LTEXT OCCURS 50.
INCLUDE STRUCTURE TLINE.
DATA: END OF LTEXT.
DATA: BEGIN OF DTEXT OCCURS 50.
DATA: INFNR LIKE EINA-INFNR.
INCLUDE STRUCTURE TLINE.
DATA: END OF DTEXT.
DATA: TNAME LIKE THEAD-TDNAME.
SELECT * FROM EINA
WHERE INFNR IN S_INFNR.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'AT'
LANGUAGE = 'D'
NAME = TNAME
OBJECT = 'EINA'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER = HTEXT
* OLD_LINE_COUNTER =
TABLES
LINES = LTEXT
* EXCEPTIONS
* ID = 1
* LANGUAGE = 2
* NAME = 3
* NOT_FOUND = 4
* OBJECT = 5
* REFERENCE_CHECK = 6
* WRONG_ACCESS_TO_ARCHIVE = 7
* OTHERS = 8.
.
LOOP AT LTEXT.
IF LTEXT-TDLINE NE ' '.
MOVE LTEXT-TDLINE TO DTEXT-TDLINE.
MOVE EINA-INFNR TO DTEXT-INFNR.
APPEND DTEXT.
ENDIF.
ENDLOOP.
ENDSELECT.
LOOP AT DTEXT.
WRITE:/ DTEXT-INFNR, DTEXT-TDLINE.
ENDLOOP.
Code: Alles auswählen.
SELECT * FROM EINA
WHERE INFNR IN S_INFNR.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'AT'
LANGUAGE = 'D'
NAME = TNAME
OBJECT = 'EINA'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER = HTEXT
* OLD_LINE_COUNTER =
TABLES
LINES = LTEXT
* EXCEPTIONS
* ID = 1
* LANGUAGE = 2
* NAME = 3
* NOT_FOUND = 4
* OBJECT = 5
* REFERENCE_CHECK = 6
* WRONG_ACCESS_TO_ARCHIVE = 7
* OTHERS = 8.
.
Code: Alles auswählen.
MOVE EINA-INFNR TO TNAME.
Code: Alles auswählen.
SELECT * FROM EINA WHERE INFNR IN S_INFNR.
MOVE EINA-INFNR TO TNAME.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'AT'
LANGUAGE = 'D'
NAME = TNAME
OBJECT = 'EINA'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER = HTEXT
* OLD_LINE_COUNTER =
TABLES
LINES = LTEXT
* EXCEPTIONS
* ID = 1
* LANGUAGE = 2
* NAME = 3
* NOT_FOUND = 4
* OBJECT = 5
* REFERENCE_CHECK = 6
* WRONG_ACCESS_TO_ARCHIVE = 7
* OTHERS = 8.
Code: Alles auswählen.
LOOP AT LTEXT.
" CLEAR DTEXT-TDLINE.
IF LTEXT-TDLINE NE ' '.
MOVE LTEXT-TDLINE TO DTEXT-TDLINE.
MOVE EINA-INFNR TO DTEXT-INFNR.
CONCATENATE DTLINE1 DTEXT-TDLINE into DTLINE1.
APPEND DTEXT.
ENDIF.
ENDLOOP.
ENDSELECT.
LOOP AT DTEXT.
WRITE:/ DTEXT-INFNR, DTLINE1. "DTEXT-TDLINE.
ENDLOOP.
Ach du lieber Himmel. Dann solltest du eine Zieltabelle wählen, für die das Textfeld lang genug ist.christof hat geschrieben:Absätze spielen keine Rolle, die Texte müssen auf inhaltliche Richtigkeit geprüft werden. Dies geschieht am Besten wenn wir ein EXCEL mit allen Texten haben.