Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Converting the data back to table using SAP FM RFC_READ_TABLE

I want to know how I can read a table using RFC_REAL_TABLE and then converted back. Below is my code:

DATA: lt_options LIKE TABLE OF rfc_db_opt,
      lt_fields LIKE TABLE OF rfc_db_fld,
      lt_data LIKE TABLE OF tab512,
      lt_entries type table of DPR_PHA_TYPE.
CALL FUNCTION 'RFC_READ_TABLE'
  DESTINATION 'Y58CLNT800'
  EXPORTING
    query_table = 'DPR_PHA_TYPE'
  TABLES
    options     = lt_options
    fields      = lt_fields
    data        = lt_data.
BREAK-POINT.


1 Answer
Anil SAP Gupta

This is very simple and you can write a code as below. This code works when you only have characters fields in table:

DATA: lt_options TYPE TABLE OF rfc_db_opt,
        lt_fields  TYPE TABLE OF rfc_db_fld,
        lt_entries TYPE TABLE OF dpr_pha_type.
CALL FUNCTION 'RFC_READ_TABLE'
  DESTINATION 'Y58CLNT800'
  EXPORTING
    query_table = 'DPR_PHA_TYPE'
  TABLES
    options     = lt_options
    fields      = lt_fields
    data        = lt_entries.


Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.