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: 

Sales Text Display

Former Member
0 Kudos

Hi

i displayed the Sales text for one sales order and im struck at displaying all sales order texts

TABLES:VBAK.

SELECT-OPTIONS : S_VBELN FOR VBAK-VBELN.

DATA: BEGIN OF ITAB_VBAP OCCURS 0,

VBELN LIKE VBAP-VBELN,

POSNR LIKE VBAP-POSNR,

ARKTX LIKE VBAP-ARKTX,

END OF ITAB_VBAP.

data : itab type table of TLINE with header line.

*data : v_name type THEAD-TDNAME.

*data : v_id type THEAD-TDID.

*data : v_object type THEAD-TDOBJECT.

*v_name = '0000004969000010'.

*v_id = '0001'.

*v_object = 'VBBP'.

SELECT VBELN POSNR ARKTX FROM VBAP INTO TABLE ITAB_VBAP WHERE VBELN IN S_VBELN.

LOOP AT ITAB_VBAP.

WRITE: / ITAB_VBAP-VBELN,ITAB_VBAP-POSNR,ITAB_VBAP-ARKTX.

ENDLOOP.

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = '0001'

LANGUAGE = sy-langu

NAME = '0005000134000010'

OBJECT = 'VBBP'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = itab

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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF sy-subrc EQ 0.

loop at itab.

write: / itab.

endloop.

ELSE.

WRITE:/ 'Sy-Subrc = ', sy-subrc.

ENDIF

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

What i ur problem?

In itab u must be getting tdformat and tdline.

in the loop you have to display itab-tdline.

Regards,

Neelambari

4 REPLIES 4

Former Member
0 Kudos

1. Get the data from VBAP.

2. Loop at VBAP

3. Concatenate VBELN + POSNR into NAME.

Make sure VBELN is of 10 char with leading zeros

4. Call the FM "READ_TEXT"

Regards,

Prabhu Rajesh

Former Member
0 Kudos

Hello,

What i ur problem?

In itab u must be getting tdformat and tdline.

in the loop you have to display itab-tdline.

Regards,

Neelambari

0 Kudos

hi

i did that but it displays only one can u verify my code once plz

0 Kudos

Hi,

In the READ_TEXT fm you are passing single name value so you are getting one text for that particular record.

If you pass all the values corresponding to name then you will get list of text.