on 12-22-2009 4:02 PM
I am trying to create a server implementation of a function that takes as input 2 strings & outputs 1 string variable. I understand that I have to create my own function descriptor
ABAP Code:
FUNCTION ZTEST_RUBY_FM.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(STRING1) TYPE STRING
*" VALUE(STRING2) TYPE STRING
*" EXPORTING
*" VALUE(STRING3) TYPE STRING
*"----------------------------------------------------------------------
ENDFUNCTION.
RUBY Code:
assert(conn = SAPNW::Base.rfc_connect)
func = SAPNW::RFC::FunctionDescriptor.new("ZTEST_RUBY_FM")
func.addParameter(SAPNW::RFC::Export.new(:name => "STRING1", :len => 1024, :type => SAPNW::RFC::STRING))
func.addParameter(SAPNW::RFC::Export.new(:name => "STRING2", :len => 128, :type => SAPNW::RFC::STRING))
func.addParameter(SAPNW::RFC::Import.new(:name => "STRING3", :len => 32, :type => SAPNW::RFC::STRING))
The last ruby line where I declare the Exporting parameter as RFC::Import does not work as expected. When I set the value of the STRING3 variable, it does not get reflected in SAP nor in trace file. I have tried changing that to RFC::Export, in that case I see the value in trace file but not in SAP. Finally, when I change the ruby parameter to RFC::Changing, do I see in both places, SAP & trace file.
Can someone please explain why it works the way it does?
thanks
Got the problem. Its in ext/nwsaprfc/nwsaprfc.c
need to switch the RFC_IMPORT & RFC_EXPORT parameter switch when invoking the function callback in ruby. This way I can keep the semantics of the original RFC Function too.
Got lots of help from Piers himself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got the problem. Its in ext/nwsaprfc/nwsaprfc.c
need to switch the RFC_IMPORT & RFC_EXPORT parameter switch when invoking the function callback in ruby. This way I can keep the semantics of the original RFC Function too.
Got lots of help from Piers himself.
Edited by: Sharad Gupta on Jan 4, 2010 8:25 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.