Skip to Content

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

Sales Text

Hi experts ,

i wote code for displaying sales text but it goes to short dump when debugging the code also when it reaches FM it goes to Dump

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: begin of itab occurs 0,

text type string,

end of itab.

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 = 0000004969000010

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-text.

endloop.

ELSE.

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

ENDIF.

Tags:
replied

Find your code corrected now..

REPORT ZTEST1 NO STANDARD PAGE HEADING LINE-SIZE 255.

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: begin of itab occurs 0,

*text type string,

*end of itab.

data : itab type standard 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 = v_id

language = 'E'

name = v_name

object = v_object

  • 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.

Regards,

Prashant

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question