Thursday, May 9, 2013

Create Host/Shell Script Concurrent Program in R12

Below is the step by step process of registering shell script as a host program or concurrent program in Oracle Applications R12

Step 1 : Create the executable name HOST_TEST_PROGRAM and Executable File Name demo_sh


Step 2 : Register the concurrent program Demo Shell Script Concurrent Program




Options : encrypt it will avoid displaying apps password in unix command prompt
wont get the password using unix command ps -ef | grep "apps"

Step 3 : Adding two parameter in the concurrent program
             Parameter1  Parameter2


Step 4:  Add the concurrent program in to the request group & Add that request group into the Responsibility.

Step 5:

1.Create a shell script ( say demo.prog)  in appropriate $CUSTOM_TOP/bin directory
Script name : demo.prog
  #! /bin/ksh
  param1="$5"
  param2="$6"
  echo "Parameter1 : $param1"
  echo "Parameter2 : $param2"

2.Change Permissions to 755 for the demo.prog file. ($chmod 755 $CUSTOM_TOP/bin/demo.prog)
3.Create soft Link to the shell Script ( ln -s $FND_TOP/bin/fndcpesr   $CUSTOM_TOP/bin/demo_sh) to create demo_sh file.
4. First 5 params are reserved for Application, user defined params starts from 5th param


                      ORA_USER_PASS=$1

                     USERID=$2

                     USERNAME=$3

                     REQUESTID=$4


5. fndcpesr is a standard utility available in $FND_TOP directory. Its mainly used by the application to parse arguments for shell scripts.

Step 6:

Submit the concurrent program Demo Shell Script Concurrent Program
from Added responsibility



Program should be completed in normal and out put parameter values are displayed in log file.


Note : The above method should allow spaces in the user defined parameters

10 comments:

  1. Hello,

    Can you explain me if i can execute commands like copy, chmod, gpg... because I did the next shell script but didn't work:

    #! /bin/ksh
    gpg --passphrase "public_key" -c test.txt

    The error was: file not found

    tks for your answer!

    ReplyDelete
    Replies
    1. Hi,

      Follow the above procedure except the step 5

      create the file demo.prog under the custom path $CUSTOM_TOP/bin

      change the file permission:
      chmod 755 $CUSTOM_TOP/bin/demo.prog

      File $CUSTOM_TOP/bin/demo.prog content is

      cp source_file_path/source_file_name destination_file_path/destination_file_name

      chmod 755 file_present_path/file_name


      Run the below command:(Create softlink)
      ln -s $FND_TOP/bin/fndcpesr $CUSTOM_TOP/bin/demo

      Submit the concurrent program.

      Note : The below chmod command
      chmod 755 /u06/home/sftptpc/file_name.txt

      we need to mentioned full file path(/u06/home/sftptpc) in the chmod otherwise this command search the file file_name.txt in the default folder $CUSTOM_TOP/bin (the program is taking the default directory location where the program is running),

      Delete
  2. how to open the code for the execution method is a host
    I mean how to findout the path for seeing that code in toad "Execution Method:Host".

    In the above mentioned executable form "execution file name is demo_sh",I want to see the code for demo_sh file
    can u plz suggest me how to open that file (or) any path to seeing the code.

    ReplyDelete
    Replies
    1. Hi Leela,

      Give the custom application name in the below query, you can get the unix path which the file is located.

      you can get the file from here

      select distinct variable_name, value||'/bin'
      from fnd_env_context
      where variable_name in (
      select distinct basepath from FND_APPLICATION_VL where application_name like '%BCS Custom%'
      )


      Thanks
      Chidambaram

      Delete
  3. Hi Chidambaram,
    How can I get the value from a value set instead of a free text?
    Using the method you mentioned I get the id of the input parameter. I would like to get the value as it appears on the front end for reporting purpose without having to script the fetching of the value using the id. Is it possible?

    ReplyDelete
  4. can you please tell me how can i pass resp_id of FND_GLOBAL.APPS_INITIALIZE in host program where i don't want to get the hard code resp_id

    ReplyDelete
    Replies
    1. Hi do you find this logic. I need this logic to be implemented. Can you let me know if you have any solution for this.

      Delete
  5. How to call host program within plsql

    ReplyDelete
    Replies
    1. Using this method : FND_REQUEST.SUBMIT_REQUEST
      we can call host based concurrent program from plsql

      Delete
  6. This blog is nice and very informative. I like this blog.
    blog Please keep it up.

    ReplyDelete

Price List Query for Item

 SELECT qph.list_header_id,        qph.name,        qph.description,        qphh.start_date_active,        qphh.currency_code,        q...