Skip to Content

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

Purchase Order Long text

Dear ALL

my request is i want to know all kind of purchase order longtext which are stores in a STXH table.

please anybody can tell me how do i recall all text which my users had added in PO while creating it.

i knw the function 'read_text' but do not know how to use it .

can you also explain the function and how do i use it.

please explain the difrent type of PO long text.

thnq.

Nayan Lad.

Tags:
Former Member
Former Member replied

Check this code,

give textid,textname,textobject are the input to read_text function

REPORT ZTEXT .

TABLES: PBIM.

  • stxh, stxl, stxb - trans tables for text

  • ttxit - text on text-ids

  • ttxot - Short texts on text objects

  • Transaction MD63

SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR,

S_WERKS FOR PBIM-WERKS.

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: MATNR LIKE PBIM-MATNR.

INCLUDE STRUCTURE TLINE.

DATA: END OF DTEXT.

DATA: TNAME LIKE THEAD-TDNAME.

SELECT * FROM PBIM WHERE WERKS IN S_WERKS.

MOVE PBIM-BDZEI TO TNAME.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

ID = 'PB'

LANGUAGE = 'E'

NAME = TNAME

OBJECT = 'PBPT'

  • ARCHIVE_HANDLE = 0

IMPORTING

HEADER = HTEXT

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 PBIM-MATNR TO DTEXT-MATNR.

APPEND DTEXT.

ENDIF.

ENDLOOP.

ENDSELECT.

LOOP AT DTEXT.

WRITE:/ DTEXT-MATNR, DTEXT-TDLINE.

ENDLOOP.

Regards,

Midhun Abraham

Edited by: Midhun Abraham on Oct 3, 2008 9:08 AM

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