Use of FM Read_Text

 In SAP we use Function Module to get the desire value maintaining different parameters.

Usually we need to call FM when value directly not in a table. In FM we need to pass ID, Object, Name.

Here ID mean where from it reads. Object : which object of text to be read. Name : Which name f text to be read. In below I share a demo code with you.Suppose here name = Client number +Inspection Lot Number+L, so we need to concatenate both of them and keep them in a variable.

DATACON LIKE THEAD-TDNAME .
DATACON1 TYPE STRING .
L_D 'L'.
 

CONCATENATE SY-MANDT WA-PRUEFLOS INTO CON1.
CONCATENATE CON1 L_D INTO CON.


DATAI_LINE TYPE STANDARD TABLE OF TLINE,
        W_LINE LIKE LINE OF I_LINE.


  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      CLIENT                  SY-MANDT
      ID                      'QAVE'
      LANGUAGE                'E'
      NAME                    = CON
      OBJECT                  'QPRUEFLOS'
*     ARCHIVE_HANDLE          = 0
*     LOCAL_CAT               = ' '
* IMPORTING
*     HEADER                  =
*     OLD_LINE_COUNTER        =
    TABLES
      LINES                   I_LINE
    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.

After getting  values we need to loop it and pass the internal table.

Comments

Popular posts from this blog

New commodity code create in SAP S/4 Hana

BAPI to Change STO PO/ PO Delivery date in SAP

INITCAP- First letter of the word Capital in SAP ABAP