Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Reading sales order header text

Hi,

I would like to output sales order header text in an ABAP query. I have coded the following for a field (ZTEXTDETAILS). On executing the ABAP query, the output is not showing any details on the text details field. May I know where I am making mistake? I am functional guy and hence not sure the completeness of the codes. If the text entered is more than 255 characters, is this an issue in ABAP query? (ABAP query column width is 255).

Help is appreciated.

TABLES:STXH.

DATA:

VBELN LIKE VBAK-VBELN,

TDNAME LIKE STXH-TDNAME,

MYLINE LIKE TLINE-TDLINE,

ZE18_LINE(1200) TYPE C.

DATA:BEGIN OF LINES OCCURS 0.

INCLUDE STRUCTURE TLINE.

DATA:END OF LINES.

DATA:BEGIN OF MYHEADER.

INCLUDE STRUCTURE THEAD.

DATA:END OF MYHEADER.

CLEAR ZTEXTDETAILS.

CLEAR TDNAME.

MOVE VBELN TO TDNAME.

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = 'ZE15'

LANGUAGE = SY-LANGU

NAME = TDNAME

OBJECT = 'VBBK'

IMPORTING

HEADER = MYHEADER

TABLES

LINES = LINES

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT FOUND = 4

OBJECT= 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

IF SY-SUBRC = 0.

LOOP AT LINES.

MOVE LINES-TDLINE TO ZTEXTDETAILS. "myline.

ENDLOOP.

ENDIF.

Thank you,

Former Member replied
LOOP AT LINES.
 CONCATENATE  ZTEXTDETAILS LINES-TDLINE INTO ZTEXTDETAILS.
ENDLOOP.
0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question