Use FM READ_TEXT to Read the Various Text

How write a program to read the sales order text? 

By : Hema Nagarajan

Use FM READ_TEXT to read the various text objects not only in sale order, any document in SAP. 

See the following sample code.

data xname like THEAD-TDNAME.
data i_xtline like tline.

clear i_xtline.
refresh i_xtline.

move i_vbak-vbeln to XNAME.

*  The NAME & OBJECT differ from object to object.  The composition of NAME and OBJECT can be found out in the text screen in the document.

Double click into the Text field

At the Top Menu - Click - Goto - Header

READ_TEXT Function

* XNAME refers to Text name

CALL FUNCTION 'READ_TEXT'
  EXPORTING
       ID = '0001'
       LANGUAGE = 'E'
       NAME = XNAME
       OBJECT = 'VBBP'
  TABLES
       LINES = i_XTLINE
  EXCEPTIONS
      ID = 1
      LANGUAGE = 2
      NAME = 3
      NOT_FOUND = 4
     OBJECT = 5
    REFERENCE_CHECK = 6.

If it is smartform or script you can include the text object directly with out using READ_TEXT FM.

Get help for your ABAP problems
Do you have a ABAP Question?

ABAP Books
ABAP Certification, BAPI, Java, Web Programming, Smart Forms, Sapscripts Reference Books

More ABAP Tips

Best regards,
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG. 
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk. 
 The content on this site may not be reproduced or redistributed without the express written permission of 
www.erpgreat.com or the content authors.