[SAP ABAP] - Convert ITF to STRING


FUNCTION yofm_itf_to_string.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(ID) LIKE  THEAD-TDID
*"     VALUE(LANGUAGE) LIKE  THEAD-TDSPRAS DEFAULT SY-LANGU
*"     VALUE(NAME) LIKE  THEAD-TDNAME
*"     VALUE(OBJECT) LIKE  THEAD-TDOBJECT
*"  EXPORTING
*"     REFERENCE(STRING) TYPE  TDTAB_C132
*"----------------------------------------------------------------------

  DATA li_tline LIKE STANDARD TABLE OF tline WITH HEADER LINE.
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
*       CLIENT                        = SY-MANDT
      id                            id
      language                      language
      name                          name
      object                        object
    TABLES
      lines                         li_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 <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  CALL FUNCTION 'CONVERT_ITF_TO_ASCII'
    IMPORTING
      c_datatab string
    TABLES
      itf_lines li_tline.


ENDFUNCTION.

Comments