cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read the values that returned from the RFC in SAP iRPA ?

0 Kudos

Hello Everyone,

I'm trying to execute the RFC in SAP iRPA. I used ActiveXObject and execute the RFC well in the code. But I didn't iterate(loop) in the table. I didn't find any documentation about how to use ActiveXObject. How can I do this?

There is no import values in the RFC just there is export value

After execution

Values

var BAPI = rootData.BAPI;


var rfcTable = BAPI.Add("Z_CRM_GET_RB_LEAD_LIST");
rfcTable.Call();
var rfcTableData = rfcTable.imports("ET_LIST");

ctx.log("Row Count" + rfcTableData.RowCount); // Gives me undefined

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_schnell
Active Contributor
0 Kudos

serdar_yazici35

Hello Serdar,

it isn't possible, this is a very old error in the ActiveX component, here a post from 2013.

Table parameters are obsolete, so it is better to don't use it.

Without any additional software installation you can't solve your requirement.

Best regards
Stefan

vishaldubey
Advisor
Advisor
0 Kudos

Hi serdar_yazici35

Please have a look at the step-by-step guide in the below blog post. It has explained how to iterate on the table data. Hope it helps.

SAP Intelligent RPA – Post General Journal Entries via RFC

Regards,

Vishal Kumar Dubey

0 Kudos

Thanks for your answer Vishal but I looked the all answered questions about this problem. The problem is actually the rfcTable.imports method has no RowCount so it comes undefined. If you want to iterate data in the table, you have to take the variable from rfcTable.tables method. After that you can iterate like that.

var BAPI = rootData.BAPI;

var rfcTable = BAPI.Add("Z_CRM_GET_RB_LEAD_LIST");
rfcTable.Call();
var rfcTableData = rfcTable.tables("ET_LIST");

for (var enumerator = new Enumerator(rfcTableData.Rows); !enumerator.atEnd(); enumerator.moveNext()) {
     var rfcTableDataRow = enumerator.item();
     ctx.log(rfcTableDataRow("COLUMN_NAME"));
}
vishaldubey
Advisor
Advisor
0 Kudos

Hi serdar_yazici35

Could you please check the below details once again.

  • Connection credentials should be correct (including client number).
  • SAP Function Module should be declared as RFC enabled.

  • You should use the tab "Tables" to declare the exporting table (not tab "Export", use tab "Export" for variables). Something like below. Change your statement with var rfcTableData = rfcTable.tables("ET_LIST");

Regards,

Vishal Kumar Dubey