Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reading sales order header text

Shiva_Ram
Active Contributor
0 Kudos

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,

1 ACCEPTED SOLUTION

Former Member
0 Kudos
LOOP AT LINES.
 CONCATENATE  ZTEXTDETAILS LINES-TDLINE INTO ZTEXTDETAILS.
ENDLOOP.
5 REPLIES 5

Former Member
0 Kudos

Dear Shiva,

In your code you need to append wa to your field.

e.g.

LOOP AT LINES.

MOVE LINES-TDLINE TO ZTEXTDETAILS. "myline.

Append in internal table

ENDLOOP.

Regards,

Vijay

Former Member
0 Kudos

Hi

your code seems to be right, u shoul insert it in the VBAK node and assign ZTEXTDETAILS to a group.

U need to optimize your code:

LOOP AT LINES.
   MOVE LINES-TDLINE TO ZTEXTDETAILS. "myline.
ENDLOOP.

In this way only the last line of the text can be displayed, so it's a blank line you couldn't see any text.

max

Former Member
0 Kudos


"check ZTEXTDETAILS table contains only one field with lenght equla to LINES-TDLINE other wise 
"move fails..

LOOP AT LINES.
MOVE LINES-TDLINE TO ZTEXTDETAILS. "myline.
append ZTEXTDETAILS.        "add this
ENDLOOP.

Prabhu

Former Member
0 Kudos
LOOP AT LINES.
 CONCATENATE  ZTEXTDETAILS LINES-TDLINE INTO ZTEXTDETAILS.
ENDLOOP.

0 Kudos

Hi,

Thank you all for your valuable input.

Regards,