Free Oracle Magazine Profit:The Executive's Guide to Oracle Applications

Enter your e-mail address to receive notifications when there are new posts

Profit Magazine: The Executive's Guide to Oracle Applications

4 Steps for Host based concurrent program

Posted on June 18th, 2007 by Sanjit Anand |Print This Post Print This Post |Email This Post Email This Post

These are the few steps which is required to make a host based Concurrent Program.

The first steps would be , you have to create a script and save as .prog extension and put into your application top bin folder.
If your custom application is XX then the scripts should goes to $XX_TOP/bin
For example, call the script CUSTOM.prog and place it under

Step 2
Now,you have understood , the execution of unix program is bit different in oracle application. The only things you have to notice is you need to pass 4 mandatory parameter to execute host program.
The other way around is ,you can use fndcpesr and link with your host program.It means the fndcpesr will take care of your 4 mandatory parameter.

You have to simply create a soft link with $XX_TOP/bin folder.

   ln -s $FND_TOP/bin/fndcpesr <script> 

This link should be named the same as your script without the .prog extension.

Step 3
Next you have to make into system administrator responsibly follow 3 steps from these menu

  • sysadmin -> concurrent-> program -> executable
  • sysadmin -> concurrent-> program -> define
  • sysadmin ->security -> responsibility -> request

Register the concurrent program, using an execution method of ‘Host’.
Use the name of your script without the .prog extension as the name of the executable.

Step 4

Your script will be passed at least 4 parameters, between $1 and $4.
These are:
orauser/pwd,
userid,
username,
and request_id

Any other parameters you define will be passed in $5 and higher.
Make sure your script returns an exit status also.

What additional piece need to incorporate in code
you need to simply
ORA_USER_PASS=$1
USERID=$2
USERNAME=$3
REQUESTID=$4

With or without extn ‘.prog’
You can register an host application without the prog extension. Your script will not have any extension. However in order to make this work you must have logic in your host application that parses the parameter string passed to it and extract the individual parameters out of it. This is required because the Concurrent manager passes 1 string containing all the parameters, to the host program. In programs linked to the fndcpesr
program, the fndcpesr parses it into the individual parameters.

How can you return an error status of the concurrent programs?

Yes, By default, a shell script returns success (status code 0). In case of error script traps an error, use the UNIX exit command ‘exit 1′ to return
failure (status code 1) to the concurrent manager running the program.”

Final Note of ‘fndcpesr’
fndcpesr is a standard utility available in $FND_TOP directory. Its mainly used by the application to parse arguments for shell scripts.

Posted in AOL | Email This Post Email This Post | Print This Post Print This Post

11 Responses
  1. ranjith Says:

    hi,

    what if i require to run the shell scripti from another responsibility other than sys admin

    Ranjith

  2. Anand Says:

    Ranjith,

    could you elaborate more….in term of clarity of the quetsion.

    If you are trying to run from other responsiblity , simply attach that requset to requset group under which you are looking for.

    take a note, Respoisblity is tied up with Requset group and menu, more over userid is tied with Resposniblity. There is only exception of not having requset group, when you will take alternate approch like FND_SUBMIT API’or submitting through CONCSUB..ie directly from host.

  3. Amresh Says:

    I am calling pl/sql procedure,from my shell method concurrent prog.
    can i use fnd_file.put_line to log message ?

  4. elmaris Says:

    As log file for Host concurent program contains output whichs is sent to stout from the shell script, I think you have to use for example dbms_output.putline to write log messages. have to check

  5. Ash Says:

    I use a shell script without extension and I have two custom parameters defined in the concurrent manager. I’m able to get the values through my shell script, by reading the whole parameter list and parsing it. However, the parameters are encolosed with double quotes which is causing issues. How do I get rid of the double quotes surrounding my parameters?

    Help is greatly appreciated.

  6. Senthil Kumar.K Says:

    Hi,
    I want to pass 7 parameters to my Shell Script program by using Concurrent Program in Oracle Apps. While i try to Run the program. it didn’t pick the parameters correctly. I use the code in my Shell Scripts are:
    l_to_mail_id=$5
    l_cc_mail_id=$6
    l_file1_path=$7
    l_file1_name=$8
    l_file2_path=&9
    l_file2_name=&10
    l_subject=$11
    But its not working fine. Please help me to correct this.
    Thanks in Advance.

    Regards,
    Senthil Kumar.K

  7. Sanjit Anand Says:

    there should be no problem ….as far as you attached with fndcpesr by mean of soft line…
    additionally you can pass as many parameter as you can….the more over you need to check the corresponding mapping..
    I will check my script, will send you offline

  8. Rajkiran Bingi Says:

    Senthil,
    I guess u have problems catching $10, $11 values.

    These should be ${10}, ${11} and so on.

    Try it.

    regards,
    Rajkiran.

  9. Amresh Says:

    How to get program status or “WARNING” in host method concurrent program?

  10. Martand Joshi Says:

    Hi,

    We have two servers, database node and application node. Concurrent Service is installed on Database Node. I want to write a program to Load the data using SQLLOADER, which I am invoking using Host File. For this program, data file will be residing on Application Node. But as Concurrent Service is on Database Node, I want to know, if I can still run host executable file from application node.

    Regards,
    Martand Joshi

  11. raj Says:

    I have similar problem as Amresh.

    Can some one shed some light on
    how to get program status or “WARNING” in host method concurrent program?

    Regards,
    Raj.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.