Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to get internal table from SAP Data Provider C#

Hello.

ABAP:

   DATA: lt_t001 TYPE TABLE OF t001.
   DATA: url(1000) TYPE c.

  SELECT * INTO TABLE lt_t001 FROM t001.

  CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
      type                 = 'APPLICATION'
      subtype           = 'X-R3TABLE'
    TABLES
      data                 = lt_t001
    CHANGING
      url                    = url
    EXCEPTIONS
      OTHERS           = 4.

C#:

using SAPDataProvider;
using SAPTableFactoryCtrl;

public void SetDataFromUrl(string url)
        {            
            SAPDataProviderClass p = new SAPDataProviderClass();
            p.SetDataFromURL("APPLICATION", "X-R3TABLE", url);
            ISapDPR3Table tbl = p.GetDataAsR3Table("APPLICATION", "X-R3TABLE");
    
            SAPTableFactoryClass tf = new SAPTableFactoryClass();
            Table tb = (Table)tf.NewTable();

            tb.ISAPrfcITab = tbl.DataTable; // Exception !!!!!!
        }

How to get internal table from SAP Data Provider ?

Former Member
Not what you were looking for? View more on this topic or Ask a question