mydoghasworms / nwrfc

SAP Netweaver RFC SDK wrapper via Ruby-FFI
http://ceronio.net/nwrfc/
28 stars 14 forks source link

fc.invoke error #4

Open michaeljt opened 11 years ago

michaeljt commented 11 years ago

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:ininvoke' 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:instart' 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:inrequire' from script/rails:6:in `

' irb(main):028:0>

Thank you for your help

mydoghasworms commented 11 years ago

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?

mydoghasworms commented 11 years ago

Perhaps it will help if you paste your code somewhere including everything from the start (minus your system details and login credentials, of course).

mydoghasworms commented 11 years ago

Oh yes, in your connection parameters add this: "trace" => 1, and examine the resulting trace file.

michaeljt commented 11 years ago

From the trace it looks like permissions problem:

Changes to Repository objects are not permitted in this client