cancel
Showing results for 
Search instead for 
Did you mean: 

Classic RFC vs NW RFC traversing table performance

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Correction RfcMoveToNextRow should be RfcMoveTo in the psuedo code above.