Home > Blockchain >  I am experimenting with PowerShell SAPNCO. How can I pass multiple text options to RFC_READ_TABLE?
I am experimenting with PowerShell SAPNCO. How can I pass multiple text options to RFC_READ_TABLE?

Time:05-30

I am experimenting with PowerShell SAPNCO.

How can I pass multiple text options to RFC_READ_TABLE?

I have been getting this error:

SAP.Middleware.Connector.RfcAbapRuntimeException: An error has occurred while parsing a dynamic entry.

when doing this:

[SAP.Middleware.Connector.IRfcTable]$Options = $RfcReadTable.GetTable("OPTIONS")
$Options.Append()
$Options.SetValue("TEXT", "SOMECOLUMN EQ 'SOMEVALUE'")
$Options.Append()
$Options.SetValue("TEXT", "SOMECOLUMN EQ 'SOMEVALUE'")

CodePudding user response:

Figured it out somehow. I was assuming that the options will be combined automatically but it looks like you need to add the operators as well. Here is how I got it to work:

[SAP.Middleware.Connector.IRfcTable]$Options = $RfcReadTable.GetTable("OPTIONS")
$Options.Append()
$Options.SetValue("TEXT", "SOMECOLUMN EQ 'SOMEVALUE'")
$Options.Append()
$Options.SetValue("TEXT", "OR")
$Options.Append()
$Options.SetValue("TEXT", "SOMECOLUMN EQ 'SOMEVALUE'")
$Options.Append()
$Options.SetValue("TEXT", "AND")
$Options.Append()
$Options.SetValue("TEXT", "SOMECOLUMN EQ 'SOMEVALUE'")
  • Related