cancel
Showing results for 
Search instead for 
Did you mean: 

Ruby SAPRFC: undefined method pack

Former Member
0 Kudos

Hi

executing the following call


rfc = SAP::Rfc.new(:ashost => "iwdf3018.wdf.sap.corp" , :sysnr => "50" ,:lang => "EN" , :client => "800" , :user => "++" , :passwd => "++" , :trace => "0" )
iface = rfc.discover("BAPI_BUPA_ADDRESSES_GET")
iface.BUSINESSPARTNER.value = "0000002036"
rfc.call(iface)

I am getting the following error:


.../saprfc-0.35-mswin32/lib/SAP/rfc.rb:729:in `discover': undefined method `pack' for #<SAP::Rfc:0x2c8c8d8> (NoMethodError)
 from .../saprfc-0.35-mswin32/lib/SAP/rfc.rb:664:in `each'
 from .../saprfc-0.35-mswin32/lib/SAP/rfc.rb:664:in `discover'

Am I missing a detail? What does it try to tell me? And how can I handle this issue?

Regards,

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi -

This is a bug- that has never been put to the test. Can you change line 729 of Rfc.rb which should look like this:


            default = pack("H*", default)

to:


            default = [default].pack("H*")

Cheers.

Former Member
0 Kudos

This fix has been rolled into version 0.36 -> http://www.piersharding.com/download/ruby/saprfc-0.36.tar.gz.

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks again, Piers

Best,

Stefan