Sha256: 5906bf617d32cde853061189bd9b4d9c4ba4cb0e24e96ab5b31f37bea56cba6e

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

# initialize Oracle E-Business Suite session with specified user and responsibility
def init_ebs_user(params={})
  # replace with default user name and responsibility and then it will not be necessary
  # to specify default value as parameter
  params = {
      :user_name => "default user name",
      :responsibility_name => "default responsibility"
     }.merge(params)

  row = plsql.select(:first, "SELECT usr.user_name, res.responsibility_name, usr.user_id,
                       urg.responsibility_id, urg.responsibility_application_id resp_appl_id
                  FROM apps.fnd_user_resp_groups urg,
                       applsys.fnd_user usr,
                       fnd_responsibility_vl res
                 WHERE usr.user_name = :user_name
                   AND res.responsibility_name = :responsibility_name
                   AND urg.user_id = usr.user_id
                   AND res.responsibility_id = urg.responsibility_id",
                   params[:user_name], params[:responsibility_name])

  raise ArgumentError, "Wrong user name or responsibility name" unless row

  plsql.fnd_global.apps_initialize(
        :user_id => row[:user_id], 
        :resp_id => row[:responsibility_id], 
        :resp_appl_id => row[:resp_appl_id]
        )

  # uncomment if logging to dbms_output is necessary
  # plsql.dbms_output.put_line("Initialized " + params[:user_name] + " / " + params[:responsibility_name])

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby-plsql-spec-0.5.0 examples/spec/helpers/oracle_ebs_helpers.rb
ruby-plsql-spec-0.4.0 examples/spec/helpers/oracle_ebs_helpers.rb
ruby-plsql-spec-0.3.0 examples/spec/helpers/oracle_ebs_helpers.rb
ruby-plsql-spec-0.2.1 examples/spec/helpers/oracle_ebs_helpers.rb
ruby-plsql-spec-0.1.0 examples/spec/helpers/oracle_ebs_helpers.rb