Module: NWRFC

Defined in:
lib/nwrfc.rb,
lib/nwrfc.old.rb

Overview

This library provides a way to call the functions of the SAP Netweaver RFC SDK, i.e. opening a connection to an ABAP system, calling functions etc., as well as running an RFC service


TODO: Create an error class that wraps the SAP error struct, so it can be raised and the caller can get all the information from there +++

Defined Under Namespace

Modules: DataContainer Classes: Connection, Function, FunctionCall, Server, Structure, Table

Constant Summary collapse

NW_TIME_FORMAT =
"%H%M%S"
NW_DATE_FORMAT =
"%Y%m%d"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.check_error(error_handle) ⇒ Object



40
41
42
43
# File 'lib/nwrfc.rb', line 40

def NWRFC.check_error(error_handle)
  raise "Error code #{error_handle[:code]} group #{error_handle[:group]} message #{error_handle[:message].get_str}" \
    if error_handle[:code] > 0
end

.get_versionObject



30
31
32
33
34
35
36
37
38
# File 'lib/nwrfc.rb', line 30

def NWRFC.get_version
  # See custom method FFI::Pointer#read_string_dn in nwrfclib.rb
  # http://stackoverflow.com/questions/9293307/ruby-ffi-ruby-1-8-reading-utf-16le-encoded-strings
  major = FFI::MemoryPointer.new(:uint)
  minor = FFI::MemoryPointer.new(:uint)
  patch = FFI::MemoryPointer.new(:uint)
  version = NWRFCLib.get_version(major, minor, patch)
  [version.read_string_dn.uC, major.read_uint, minor.read_uint, patch.read_uint]
end

Instance Method Details

#inspectObject



26
27
28
# File 'lib/nwrfc.rb', line 26

def inspect
  self.to_s
end