nwrfc
nwrfc copied to clipboard
fc.invoke error
Hello,
Following your example from wiki I am getting some errors after fc.invoke. Could you please let me know what might be causing these errors and if there is any way to correct them?
irb(main):008:0> f = conn.get_function("RFC_ABAP_INSTALL_AND_RUN")
=> #NWRFC::Function:0x3672750
irb(main):009:0>
irb(main):010:0* fc = f.get_function_call
=> #NWRFC::FunctionCall:0x36a9230
irb(main):011:0>
irb(main):012:0*
irb(main):013:0* code = <<ABAPCODE
irb(main):014:0" REPORT EXTRACT LINE-SIZE 255 NO STANDARD PAGE HEADING.
irb(main):015:0" TABLES: MARA.
irb(main):016:0" SELECT * FROM MARA.
irb(main):017:0" WRITE: / MARA-MATNR, MARA-BISMT.
irb(main):018:0" ENDSELECT.
irb(main):019:0" ABAPCODE
=> "REPORT EXTRACT LINE-SIZE 255 NO STANDARD PAGE HEADING.\nTABLES: MARA.\nSELEC
T * FROM MARA.\n WRITE: / MARA-MATNR, MARA-BISMT.\nENDSELECT.\n"
irb(main):020:0>
irb(main):021:0* # Populate the PROGRAM table parameter with the ABAP code
irb(main):022:0* code.each_line {|line|
irb(main):023:1* fc[:PROGRAM].new_row {|row| row[:LINE] = line.strip}
irb(main):024:1> }
=> "REPORT EXTRACT LINE-SIZE 255 NO STANDARD PAGE HEADING.\nTABLES: MARA.\nSELEC
T * FROM MARA.\n WRITE: / MARA-MATNR, MARA-BISMT.\nENDSELECT.\n"
irb(main):025:0>
irb(main):026:0*
irb(main):027:0* fc.invoke
: NWRFC::NWError
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/nwrfc-0.0.5/lib/nwrfc.rb:59:in check_error' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/nwrfc-0.0.5/lib/nwrfc.rb:287:in
invoke'
from (irb):27
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in start' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in
start'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:41:in <top (required)>' from script/rails:6:in
require'
from script/rails:6:in `
Thank you for your help
Sorry for the late reply. I have just tried to replicate your issue (but with table T000 because I don't have access to an ECC machine). For me it ran fine. Can you please confirm: Do you have a trace file from the RFC dll? Do you see any corresponding logs in SM21?
Perhaps it will help if you paste your code somewhere including everything from the start (minus your system details and login credentials, of course).
Oh yes, in your connection parameters add this: "trace" => 1, and examine the resulting trace file.
From the trace it looks like permissions problem: <ERROR thread="5084" comp="RUNTIME" time="2013-05-10, 08:58:39">Changes to Repository objects are not permitted in this client</ERROR></TRACE>