class NWRFC::Parameter

Represents the metadata of a function parameter

Attributes

handle[RW]

Public Class Methods

new(*args) click to toggle source
Create a parameter by setting parameter attributes

@todo For certain types, e.g. :RFCTYPE_BCD, a length specification is

required, otherwise a segfault is the result later down the line.
Find and implement all the types where this is required
# File lib/nwrfc.rb, line 172
def initialize(*args)  

  attr = args[0]
  


  raise "RFCTYPE_BCD requires a length" if attr[:type] == :RFCTYPE_BCD && !(attr[:length])

  @handle                 = NWRFCLib::RFCFuncParam.new
  @handle[:name]          = attr[:name].cU if attr[:name]
  @handle[:direction]     = NWRFCLib::RFC_DIRECTION[attr[:direction]] if attr[:direction]
  @handle[:type]          = NWRFCLib::RFC_TYPE[attr[:type]] if attr[:type]
  @handle[:ucLength]      = attr[:length] * 2 if attr[:length]
  @handle[:nucLength]     = attr[:length] if attr[:length]
  @handle[:decimals]      = attr[:decimals] if attr[:decimals]
  # TODO: Add support for type description
  #@handle[:typeDescHandle]
  @handle[:defaultValue]  = attr[:defaultValue].cU if attr[:defaultValue]
  @handle[:parameterText] = attr[:parameterText].cU if attr[:parameterText]
  @handle[:optional]      = abap_bool(attr[:optional]) if attr[:optional]
end