Quantcast
Channel: SCN : All Content - SAP NetWeaver Administrator
Viewing all articles
Browse latest Browse all 5139

Classic RFC vs NW RFC traversing table performance

$
0
0

Hi,

 

I am getting the rows of a table returned by a BAPI call using c++ with both classic RFC and NW RFC, in classic RFC the call used is ItGetLine(handle, index) from  sapitab.h. NW RFC SDK requires a combination of RfcMoveTo(handle, index, errorInfo) and RfcGetCurrentRow(handle, errorInfo). RfcMoveTo on its own takes longer than the ItGetLine call, RfcGetCurrentRow() is quicker than RfcMoveTo but still slower than ItGetLine . So using these commands alone NW RFC is over twice as slow as classic RFC to get all the rows of a table returned by a BAPI function. The comparison is fair as the same BAPI is returning the same number of rows for both classic and NW RFC. I have tried using RfcMoveToNext instead of RfcMoveTo but this is even slower.

 

Just to try and make it clearer,

 

Pseudo code for Classic RFC

int rowCount = ItFill(rfcTableHandle);

for (int i = 0; i < rowCount; i++)  {

     // timer start

     void* pLine = ItGetLine(rfcTablehandle, i + 1);

     // timer end

}

 

Psuedo code for NW RFC

int rowCount = 0;

RfcGetRowCount(rfcTableHandle, &rowCount, errorInfo);

for (int i = 0; i < rowCount; i++) {

     // timer 1

     RfcMoveToNextRow(rfcTableHandle, i, errorInfo);

     // timer 1 end

     // timer 2

     RFC_STRUCTURE_HANDLE h = RfcGetCurrentRow(rfcTableHandle,errorInfo)

     // timer 2 end

}

 

Am I doing something wrong is there a better way to get rows from a table in NW RFC. This is a big performance difference I must be missing something.

 

Thanks,

Simon


Viewing all articles
Browse latest Browse all 5139

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>