Problem when uploading a file with ruby to SAP with an RFC

1

I am trying to automatically upload certain files to SAP using an RFC created for this purpose. If I use the RFC from the application, it works correctly but when I try it from the ruby application, at the time of putting the files in the corresponding table the application fails. Up to that point, everything is correct (marked in the following code with a comment)

Any idea why it can be? I do not know if it will have anything to do with permissions, because SAP asks for confirmation when doing it from its environment and I would be surprised if it is able to load the files just by giving it the route.

Only the following error is displayed:

  

We're sorry, but something went wrong. If you are the application   owner check the logs for more information.

Ruby Code:

def upload
  parametros = Hash.new
  parametros["user"] = "xxx"
  parametros["passwd"] = "xxx"
  parametros["client"] = "xxx"
  parametros["ashost"] = "sapservertest.xxxx.es"
  parametros["sysnr"] = "xxx"

  c = NWRFC::Connection.new(parametros)

  @info = c.connection_info 
  @function = c.get_function("ZRFC_PLM_CREAR_DOC_INFO_ING")
  @call = @function.get_function_call
  @metodos = @function.methods
  @call_metodos = @call.methods

  @call['I_DOKNR'] = 'xxx'
  @call['I_DOKVR'] = '00'
  @call['I_DKTXT'] = 'Prueba xx'
  @call['I_RESP'] = 'xxx'
  @call['I_PAQ_PROD'] = 'ESP'
  @call['I_OBJ_PROD'] = 'MPL'
  @call['I_RELEV_COMPR'] = 'NO'
  @call['I_DOC_ENTREG'] = 'NO'
  @call['I_CLASIF_SEG'] = 'CONF'
  @call['I_DENOM_IDIOMA'] = 'ES'

  @call['IT_ENLACES'].new_row { |r|
    r['TIP_ENLACE'] = 'xxx'
    r['OBJ_ENLACE'] = 'xxx'
  }

  @call['IT_ENLACES'].new_row { |r|
    r['TIP_ENLACE'] = 'xxx'
    r['OBJ_ENLACE'] = 'T-xxx'
  }

  #---------------HASTA AQUI FUNCIONA CORRECTAMENTE

  @call['IT_FILES'].new_row { |r|
    r['RUTA'] = 'C:\Users\xxx\Desktop\ejemplo.html'
  }

  @call.invoke
end

I'm using the gem nwrfc for it, I have not found anything more current.

Thanks in advance,

Greetings

    
asked by Jose Sierra 24.07.2018 в 13:57
source

0 answers