We are calling a PL/SQL package from Oracle Apps front end. The package in turn calls the standard "Fnd_request.submit_request" function. It is working fine this way. The standard function returns a number which is then assigned as the request_id for Journal Import.
But when we execute the same package through a shell script, the "Fnd_request.submit_request" function returns 0.
We traced the Fnd_request.submit_request function back to fnd_const and fnd_global package.
We found that while calling from Oracle Apps, the login_id, conc_request_id and security_group_id which are populated from Fnd_global, have some numeric values which we believe is a NEXT_VAL() returned number.
But these values are returned as -1 when called from the Unix shell script (we use sqlplus to connect to oracle and we are logging in as the owner of the fnd_request and our custom package).
We could find a function called "get" in fnd_global. It uses the service of another function z_context..exists(VARCHAR2).
It is this function z_context.exists() that returns NULL when logged in from Unix. But when logged in from Oracle Apps, it returns some number.
The problem is that all we could find about z_context is that it is a varable of type t_hashtable defined in fnd_const as a table of varchar2(2000). There is no reference to exists function.
Unix version: AIX 5
Oracle Version: 8