cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Text

Former Member
0 Kudos

hi all,

I am entering some header text in PO.

How can i capture using read_text. Please tell me the procedure.

Regards

Reddy

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

pass these parameters to 'read_text' function module.

Text Name = Po number

Language = EN

Text ID = F01

Text Object = EKKO

Former Member
0 Kudos

Hi,

Check this sample code. Though this code is for sales order text. You can apply same logic for fetching purchase order text.

Pass purchase document instead of sales doc. and use object 'EKKO' instead of VBBK and search for text ids in Tcode me23n.


REPORT  z_test1.
 
TABLES:
  thead.
 
PARAMETERS:
  p_vbeln TYPE vbak-vbeln.
 
PARAMETERS:
  p_textid TYPE thead-tdid.
 
DATA:
  BEGIN OF t_thead OCCURS 0.
        INCLUDE STRUCTURE thead.
DATA:
END OF t_thead.
DATA:
  w_line TYPE i,
  w_idx TYPE i,
  w_flag TYPE i.
DATA:
  BEGIN OF t_tline OCCURS 0.
        INCLUDE STRUCTURE tline.
DATA:
END OF t_tline.
 
DATA:
  w_test TYPE thead-tdname.
 
 
 
START-OF-SELECTION.
  w_test = p_vbeln.
 
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      client                  = sy-mandt
      id                      = p_textid
      language                = sy-langu
      name                    = w_test
      object                  = 'VBBK'
    TABLES
      lines                   = t_tline
    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 NE 0.
    MESSAGE 'HEADER TEXT NOT FOUND' TYPE 'I'.
  ENDIF.
 
 
END-OF-SELECTION.
 
  LOOP AT t_tline.
    WRITE: / t_tline-tdline.
  ENDLOOP.


Regards

Abhijeet