How to get number of rows in SAP table by powershell using RFC? -


i trying reach number ob rows in sap table mara using powershell. call em_get_number_of_entries function. don't know powershell , have problem correctly pass tabname value. think line "$rfctableout.setvalue("tabname","mara")" incorrect.

here's script:

function invoke-sapfunctionmodule { #-loads nco libraries------------------------------------------------- $rc = [reflection.assembly]::loadfile("c:\sap\64\sapnco.dll") $rc = [reflection.assembly]::loadfile("c:\sap\64\sapnco_utils.dll")  #-sets connection parameters------------------------------------------ $cfgparams = new-object sap.middleware.connector.rfcconfigparameters  $cfgparams.add("ashost", "some ip") $cfgparams.add("sysnr", "20") $cfgparams.add("name", "some system") $cfgparams.add("user", "some user") $cfgparams.add("passwd", "some pass@") $cfgparams.add("client", "400") $cfgparams.add("lang", "pl") $cfgparams.add("pool_size", "5")    $destination =          [sap.middleware.connector.rfcdestinationmanager]::getdestination($cfgparams) [sap.middleware.connector.irfcfunction]$rfcfunction =   $destination.repository.createfunction("em_get_number_of_entries")  [sap.middleware.connector.irfcstructure] $rfctableout = $rfcfunction.gettable("it_tables") $rfctableout.setvalue("tabname","mara") write-host $rfcfunction.getvalue("tabrows")  }  #-main---------------------------------------------------------------- invoke-sapfunctionmodule #-end----------------------------------------------------------------- 

and have error: enter image description here

24 line :

[sap.middleware.connector.irfcfunction]$rfcfunction =     $destination.repository.createfunction("em_get_number_of_entries") 

you cannot call method on null-valued expression


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -