Sunday, 21 July 2013

'READ_TEXT' Function Module in SAP ABAP

The purpose of this Function Module is to read text from any SAP documents say: 
Sale Order, Purchase Order, Transfer Order etc.....(both at the header level and item level)

The structure of this FM looks like below:

 CALL FUNCTION 'READ_TEXT'
  EXPORTING
*   CLIENT                        = SY-MANDT
    id                            =
    language                      =
    NAME                          =
    OBJECT                        =
*   ARCHIVE_HANDLE                = 0
*   LOCAL_CAT                     = ' '
* IMPORTING
*   HEADER                        =
*   OLD_LINE_COUNTER              =
  TABLES
    lines                         =
* 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.
* Implement suitable error handling here
ENDIF.


For the above FM mandatory fields are: 

ID, Language, Name, Object and Tables Parameter: Lines.


To find the attributes of a Text Object/Type see below Post:

How to find the Properties/Attributes of a Text Object/Type in SAP ABAP



No comments:

Post a Comment