cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using RFC_READ_TABLE to read EKKO

Former Member
0 Kudos

Hi,

I am trying to read EKKO table using SAP.NET

Connector 2.0 & RFC_READ_TABLE; however, I got

a "<b>DATA_BUFFER_EXCEEDED</b>" exception.

Here is the code I'm using


      TAB512Table Data = new TAB512Table();
      RFC_DB_FLDTable Fields = new RFC_DB_FLDTable();
      RFC_DB_OPTTable Options = new RFC_DB_OPTTable();
      string strDelimiter=""; 
      string strNoDate=""; 
      string strTable="EKPO";
      int iRowCount=0, iRowSkips=0;
      RFC_DB_OPT selection = new RFC_DB_OPT();

      selection.Text  = "EBELN = '" + 
        TextBox1.Text + "' AND EBELP = '00001'";

      Options.Add(selection);
				
      proxy.Rfc_Read_Table(strDelimiter, 
        strNoDate, strTable, iRowCount, iRowSkips,
        ref Data, ref Fields, ref Options);

      Response.Write(Data[0].Wa);

Any idea?

Thanks,

Ali.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ali,

how are you doing ?

the RFC : RFC_READ_TABLE raises DATA_BUFFER_EXCEEDED

in 1 place alone,

>> IF LINE_CURSOR > LINE_LENGTH AND NO_DATA EQ SPACE.

in EKPO, there will be a column which is exceeding the length of the data buffer

[the data buffer is system specific and a variable quantity, usually set to 512]

so when you find a column which has width greater than 512, the exception will be raised.

your possible solutions would be :

1> specify which columns you would like to retrieve from EKPO in the input

[as mentioned by Fabrice]

2> if you would like to read a column which itself exceeds your buffer length, then please ask your basis support to increase u're buffer size to the max of the column you need

with respect,

amit

Former Member
0 Kudos

Hi,

It is not recommended to use FM RFC_READ_TABLE for projects. This is designed for demo purpose only.

You can't use this function module for large no. of records.

Better you copy and change this function module as per your requirement.

Thanks & Regards,

Govind.

Former Member
0 Kudos

Hi Govingaraju,

how are you doing ?

why RFC_READ_TABLE is not recommended is due to the particular piece of code which checks the length of each column

the volume of data [from rows] is not limited

it is a generic table reader which is especially useful when developing interfaces, as it bypasses the overheads of creating more rfc's or bapi's

[creating new rfc's will effectively increase system complexity by creating more code to be maintained, when none is required if you develop new RFC's for every change in requirement]

RFC_GET_TABLE_ENTRIES along with RFC_READ_TABLE can be used wisely to extract specific data and not perform the usual practice of reading an entire table and then only taking the bits you want.

it works on the thought of an informed query to get data that is useful

please let me know why you believe it should be restricted to demos only when citing recommendations, which can then be analysed

with respect,

amit

Former Member
0 Kudos

Hi amit,

Kindly check this OSS Note <b>382318</b> - RFC_READ_TABLE .

Thanks & Regards,

Govindaraju.

Former Member
0 Kudos

Hi Govindaraju,

how are you doing ?

thanks for the note, unfortunately it also lacks any technical reasoning.

what is more of useful is to be able to reade the source code of the rfc and learn of it's limitations from within, i still maintain that it can be utilized for informed and exact querries very successfully as per my experience

if you are aware of any technical reason [code] and how it deviates fromt eh documentation, please let me know

with respect,

amit

Former Member
0 Kudos

Hello,

I guess you've forgotten to add the fields that you want in the FIELD table parameter:

RFC_DB_FLD oField_0 = new RFC_DB_FLD();

RFC_DB_FLD oField_1 = new RFC_DB_FLD();

oField_0.Fieldname = "field_name1";

Fields.Add(oField_0);

oField_1.Fieldname = "field_name2";

Fields.Add(oField_1);

Regards, Fabrice Coussedière.