Quantcast
Channel: Oracle Maniacs' Notes » Abhijit Ray
Viewing all 128 articles
Browse latest View live

Upload Corporate Credit card transactions for Oracle iExpense

$
0
0

I have discussed about Oracle iExpense flow earlier. In that article we talked about entering credit card expenses in the expense report (Step 3b in the Oracle iExpense Flow).

Credit card expenses are essentially the expenses when an employee makes using the corporate credit card provided by his employer. These expenses are sent as a data file by the bank/credit card company, that has provided the card to the employee on behalf of the employer, to the employer.

The employer then loads the data file into Oracle and keeps the expense lines ready for the employee to log in to Oracle and create his/her expense report. The process of loading the expense report data file is given below.


Step 1: Create a staging table

We have created staging table to load the file sent from the credit card company. The table structure we have created is as follows.

CREATE TABLE APPS.XX_AP_CC_TRXNS_STG_TL
(
  ATTRIBUTE1     VARCHAR2(80 BYTE),
  ATTRIBUTE2     DATE,
  ATTRIBUTE3     DATE,
  ATTRIBUTE4     NUMBER,
  ATTRIBUTE5     NUMBER,
  ATTRIBUTE6     VARCHAR2(240 BYTE),
  ATTRIBUTE7     VARCHAR2(15 BYTE),
  ATTRIBUTE8     VARCHAR2(15 BYTE),
  ATTRIBUTE9     NUMBER,
  ATTRIBUTE10    VARCHAR2(80 BYTE),
  ATTRIBUTE11    VARCHAR2(240 BYTE),
  ATTRIBUTE12    DATE,
  RECORD_STATUS  VARCHAR2(1 BYTE),
  DATA_SOURCE    VARCHAR2(60 BYTE),
  LOAD_SEQUENCE  NUMBER,
  REQUEST_ID     NUMBER,
  ERR_MSG        VARCHAR2(1000 BYTE)
)


Step 2: Create a loader program to load the file into the staging table

We have created a HOST program to load the credit card files. The host program will do the following,

  1. Use SQL Loader to load the bank file into the staging table
  2. Move the data file into a processed folder once the file has been loaded

The HOST program will be executed as a concurrent program.

Program:

Executable:

The control file (XX_AP_CC_CTL.ctl) for SQL loader is given below,

LOAD DATA
INFILE *
APPEND INTO TABLE XX_AP_CC_TRXNS_STG_TL
FIELDS TERMINATED BY ','
 OPTIONALLY ENCLOSED BY "'" TRAILING NULLCOLS
  (
   ATTRIBUTE1               "TRIM(:ATTRIBUTE1)",        -- Credit Card No
   ATTRIBUTE2               DATE 'DD/MM/YYYY',          -- Trans Date
   ATTRIBUTE3               DATE 'DD/MM/YYYY',          -- Posted Date
   ATTRIBUTE4               "TRIM(:ATTRIBUTE4)",        -- Amount Foreign Curr
   ATTRIBUTE5               "TRIM(:ATTRIBUTE5)",        -- Converted Amount in USD
   ATTRIBUTE6               "TRIM(:ATTRIBUTE6)",        -- Trans Ref Number
   ATTRIBUTE7               "TRIM(:ATTRIBUTE8)",        -- Currency Code USD
   ATTRIBUTE8               "TRIM(:ATTRIBUTE7)",        -- Transaction Currency Code
   ATTRIBUTE9               "TRIM(:ATTRIBUTE9)",        -- Currency Conversion Rate
   ATTRIBUTE10              "TRIM(:ATTRIBUTE10)",       -- Supplier Name
   ATTRIBUTE11              "TRIM(:ATTRIBUTE11)",       -- Location
   ATTRIBUTE12              DATE 'DD/MM/YYYY',           -- Statement Date    Not Available
   Record_Status            CONSTANT 'N',
   DATA_SOURCE              CONSTANT 'AP_IEXPENSES_CC',
   LOAD_SEQUENCE            SEQUENCE(MAX,1)
  )

The code for the HOST program

# ******************************************************************************
# Usage:        XX_AP_CC_LOAD.prog
# Description:  This program processes Credit Card files for IExpenses
#               available in IEXPENSES_CC folder and calls associated Data Loader Program
#
#
# History:
#
# ******************************************************************************

#Initialize parameters
#By default these four parameters will be assigned.
p_userid_passwd=$1
p_appl_login=$2
p_user_name=$3
p_request_id=$4
p_support_user=$5

CONTROL_FILE=XX_AP_CC_CTL.ctl
BASE_DIR=$XXCUST_TOP
LOADER_DIR=$BASE_DIR/bin
LOADER=$LOADER_DIR/$CONTROL_FILE
DATA_DIR=$XXCUST_TOP/IEXPENSES_CC/iexpenses_cc_unprocessed/
LOGIN_ID=`echo $1|cut -f3,3 -d=`
LOGIN_ID=`echo $LOGIN_ID|cut -f1 -d ' '`
LOGIN_ID=`echo $LOGIN_ID|tr -d '\042'`

#Initialise system variables (standard variables used for logging)
v_work_dir=$XXCUST_TOP/IEXPENSES_CC/iexpenses_cc_unprocessed/
v_file_path_name=$XXCUST_TOP/IEXPENSES_CC/iexpenses_cc_unprocessed/
v_processed_dir=$XXCUST_TOP/IEXPENSES_CC/iexpenses_cc_processed/
v_error_dir=$XXCUST_TOP/IEXPENSES_CC/iexpenses_cc_errors/
v_check_file=$XXCUST_TOP/log/"check_file_"$p_request_id.log

# --------------------
# SQL*Loader Variables
# --------------------

BAD_FILE=$XXCUST_TOP/IEXPENSES_CC/bad_files
LOG_FILE=$XXCUST_TOP/IEXPENSES_CC/log_files
DIS_FILE=$XXCUST_TOP/IEXPENSES_CC/discard_files

# -------------------
# Get Parameter value
# -------------------

RETCODE=$?
code_error=$RETCODE

cd $v_work_dir

echo "The List of Files in the Current Directory : "
echo " "

ls -1 *.*

if [ $? -ne 0 ]
then
   echo "There are no files to be processed "
   mailx -m -s "There are no files to be processed " $p_support_user
   exit 0
else
   #Main Loop
   for v_file_name in  `ls -1 *.*`
   do

   echo " \n----------------------------------------------------"
        echo " Process begin for data file  :  "$v_file_name
        echo " ----------------------------------------------------"

        v_log_file=`echo $v_file_name|cut -f1,1 -d.`
        v_bad_file=`echo $v_file_name|cut -f1,1 -d.`
        v_out_file=`echo $v_file_name|cut -f1,1 -d.`

   if [ -s $v_processed_dir$v_file_name ]
    then
     echo "The data file "$v_file_name" already exists"
     rm $v_file_name
   else
              # ----------------------------------------------------------------
              #  Count records in data file, if empty - abort.Echo to Log file
              # ----------------------------------------------------------------
              RECORD_CNT=`wc -l < $v_file_name`
              if [ "$RECORD_CNT" -eq 0 ]
              then
                 echo "Current Data File is empty, can not process...."
                 echo "The data file is moved to XXCUST_TOP/IEXPENSES_CC/iexpenses_cc_errors folder with name: "$4"-"$v_file_name
                  mv $v_file_name $v_error_dir$4"-"$v_file_name
              else
                 # ------------------------------------------------------
                 #     SQL loader to import data into interim table
                 # ------------------------------------------------------
                 echo "LOADER is: $LOADER"
                 echo "FILENAME is: $DATA_DIR/$v_file_name"
                 echo "LOG FILE is: $LOG_FILE/$v_log_file.log"
                 echo "BAD FILE is: $BAD_FILE/$v_bad_file.bad\n"

                 sqlldr userid=$LOGIN_ID \
                        control=$LOADER \
                          data=$DATA_DIR/$v_file_name \
                          log=$LOG_FILE/$v_log_file.log \
                          bad=$BAD_FILE/$v_bad_file.bad \

                echo " SQLLDR COMPLETED"
                echo " Return Code is: $RETCODE"

                 if [ $? = 0 ]
                 then
                    echo "The following file has been processed and moved to XXCUST_TOP/IEXPENSES_CC/iexpenses_cc_processed folder: "$v_file_name
                    uuencode $LOG_FILE/$v_log_file.log $v_log_file.log|mailx -m -s "AP Invoices Log File for IExpenses " $p_support_user
                    mv $v_file_name $v_processed_dir
                    if [ -s $BAD_FILE/$v_bad_file.bad ]
                      then
                        echo "The following data file has error records which are moved to XXCUST_TOP/IEXPENSES_CC/iexpenses_cc_errors folder with name: "$4"-"$v_bad_file.bad
                        uuencode $BAD_FILE/$v_bad_file.bad $v_bad_file.bad|mailx -m -s "AP Invoices Bad File for IExpenses" $p_support_user
                        mv $BAD_FILE/$v_bad_file.bad $v_error_dir$4"-"$v_bad_file.bad
                     fi
                 else
                    echo "SQL*Loader Failed for Current Data File \n"
                    mailx -m -s "SQL*Loader Failed for Current Data File" $p_support_user
                 fi
              fi
   fi
 done
fi
exit 0

Check the loaded records in the staging table by running the following query,

select * from xx_ap_cc_trxns_stg_tl


Step 3: Validate and load the credit card lines from the staging table to the base table

We have written a validation package to validate the credit card lines and to insert the valid records from the staging table, XX_AP_CC_TRXNS_STG_TL, into the base table, AP_CREDIT_CARD_TRXNS_ALL, table. This package will be called from a concurrent program.

Note: We can decide not validate the credit card lines and load the expense lines into AP_CREDIT_CARD_TRXNS_ALL table. In that case we need to call the seeded validation program,
Credit Card Transactions Validation Program
, to validate the data. This process is demonstrated in the appendix section below.

The concurrent program definition is as follows,

Program:

Executable:

The PL/SQL code is as follows,

CREATE OR REPLACE PACKAGE xx_ap_cc_iexpense_pkg
AS
--==============================================================================
--                            XXXXX
--                           YYYYYY
--==============================================================================
--
--
-- MODULE NAME : xx_ap_cc_iexpense_pkg.pkb
-- AUTHOR      :
-- DATE        :
-- DESCRIPTION : This Program Validates Credit Card data from Staging Table and
--               if there are no errors encountered then data is inserted into
--                 AP_CREDIT_CARD_TRXNS_ALL table. If errors then the program is
--                 aborted and logged
--
-- Change Record:
-- =============
-- VERSION    DATE             AUTHOR(S)           Remarks
-- ========   ============     ===============     ============
--
--
--==============================================================================
   gn_request_id   NUMBER;
   gn_user_id      NUMBER;
   gn_email_id     VARCHAR2 (30);

   PROCEDURE xx_ap_validate_cc_proc (errbuf OUT VARCHAR2, retcode OUT NUMBER);
END xx_ap_cc_iexpense_pkg;

CREATE OR REPLACE PACKAGE BODY xx_ap_cc_iexpense_pkg
AS
--==============================================================================
--                            XXXXX
--                           YYYYYY
--==============================================================================
--
--
-- MODULE NAME : xx_ap_cc_iexpense_pkg.pkb
-- AUTHOR      :
-- DATE        :
-- DESCRIPTION : This Program Validates Credit Card data from Staging Table and
--               if there are no errors encountered then data is inserted into
--                 AP_CREDIT_CARD_TRXMS_ALL table. If errors then the program is
--                 aborted and logged
--
-- Change Record:
-- =============
-- VERSION    DATE             AUTHOR(S)           Remarks
-- ========   ============     ===============     ============
--
--==============================================================================
   PROCEDURE xx_ap_validate_cc_proc (errbuf OUT VARCHAR2, retcode OUT NUMBER)
   AS
      lv_org_id             NUMBER;
      lv_card_prg_id        VARCHAR2 (80);
      lv_err_message        VARCHAR2 (1000);
      lv_err_flag           VARCHAR2 (1);
      lv_trx_id             NUMBER;
      lv_card_number        VARCHAR2 (80);
      ln_total_emp_count    NUMBER;
      ln_total_count        NUMBER;
      ln_processed_count    NUMBER;
      ln_total_emp_failed   NUMBER;
      ln_reject_count       NUMBER;
      lc_status             VARCHAR2 (50);
      lc_wf_status          VARCHAR2 (50);

      CURSOR trans_cur (lv_request_id NUMBER)
      IS
         SELECT   attribute1   -- credit card Number
             FROM xxeyap_cc_trxns_stg_tl
            WHERE record_status <> 'P' AND request_id = lv_request_id AND data_source = 'AP_IEXPENSES_CC'
         GROUP BY attribute1, data_source;

      CURSOR trans_details_cur (l_card_no VARCHAR2, ln_request_id NUMBER)
      IS
         SELECT attribute1,   -- Credit Card Number
                attribute2,   -- Trans Date
                attribute3,   -- Posted Date
                attribute4,   -- Amount Foreign Curr
                attribute5,   -- Converted Amount in USD
                attribute6,   -- Trans Ref Number
                attribute7,   -- Currency Code USD
                attribute8,   -- Transaction Currency Code
                attribute9,   -- Currency Conversion Rate
                attribute10,  -- Supplier Name
                attribute11,  -- Location
                attribute12,  -- Statement Date
                record_status,
				data_source,
				load_sequence,
				ROWID
           FROM xx_ap_cc_trxns_stg_tl
          WHERE record_status <> 'P' AND request_id = ln_request_id AND attribute1 = l_card_no AND data_source = 'AP_IEXPENSES_CC';

      CURSOR check_ceo_trans (c_card_number VARCHAR2)
      IS
         SELECT lookup_code
           FROM fnd_lookup_values
          WHERE lookup_type = 'EY_CC_CEO_EXCLUSION'
            AND TRIM (meaning) = c_card_number
            AND NVL (enabled_flag, 'N') = 'Y'
            AND TRUNC (SYSDATE) BETWEEN TRUNC (start_date_active) AND TRUNC (NVL (end_date_active, SYSDATE));

      CURSOR status_cur (p_request_id NUMBER)
      IS
         SELECT   attribute1,   -- Credit Card Number
                             err_msg
             FROM xxeyap_cc_trxns_stg_tl
            WHERE record_status = 'E' AND data_source = 'AP_IEXPENSES_CC'
         GROUP BY attribute1, err_msg, record_status, data_source
         ORDER BY attribute1;

      lcu_check_ceo_trans   check_ceo_trans%ROWTYPE;
   BEGIN
      gn_request_id := fnd_global.conc_request_id;
      gn_user_id := fnd_profile.VALUE ('USER_ID');
      ln_total_emp_count := 0;
      ln_total_emp_failed := 0;

---------------------------------------------------------------------------
-----update the Receipt staging table with WHO columns
---------------------------------------------------------------------------
      BEGIN
         --      fnd_file.put_line (fnd_file.output, 'Request Id' ||gn_request_id);
         UPDATE xxeyap_cc_trxns_stg_tl
            SET request_id = gn_request_id
          WHERE record_status <> 'P';

         COMMIT;
      EXCEPTION
         WHEN OTHERS
         THEN
            lv_err_flag := 'E';
            lv_err_message := 'Error while Updating the Staging Table' || 'with Request Id - ' || SQLERRM;
            fnd_file.put_line (fnd_file.LOG, ' ' || lv_err_message);
      END;

      FOR trans_rec IN trans_cur (gn_request_id)
      LOOP
         lv_err_flag := 'S';
         lcu_check_ceo_trans := NULL;
---------------------------------------------------------------------------
---  Validate the Credit Card Number
---------------------------------------------------------------------------
         ln_total_emp_count := ln_total_emp_count + 1;

         BEGIN
            --       fnd_file.put_line (fnd_file.output, 'Card Number ' || SUBSTR(trans_rec.attribute1,9,16));
            SELECT card_number
              INTO lv_card_number
              FROM ap_cards_all
             WHERE SUBSTR (card_number,
                           9,
                           16
                          ) = SUBSTR (trans_rec.attribute1,
                                      9,
                                      16
                                     ) AND inactive_date IS NULL;
         EXCEPTION
            WHEN OTHERS
            THEN
               lv_err_flag := 'E';
               lv_err_message := 'Credit Card Number Not Exists';
               fnd_file.put_line (fnd_file.LOG, lv_err_message);
         END;

---------------------------------------------------------------------------
---  Check the transaction Belongs to CEO (Ver 1.1 Starts Here)
---------------------------------------------------------------------------
         OPEN check_ceo_trans (trans_rec.attribute1);

         FETCH check_ceo_trans
          INTO lcu_check_ceo_trans;

         CLOSE check_ceo_trans;

         IF lcu_check_ceo_trans.lookup_code IS NOT NULL
         THEN
            lv_err_flag := 'E';
            lv_err_message := 'CEO Credit Card Transacation';
            fnd_file.put_line (fnd_file.LOG, lv_err_message);
         END IF;   --Ver 1.1 Ends Here

---------------------------------------------------------------------------
---  Fetch the Org_id and Card Program Id, Based on the Credit Card Number
---------------------------------------------------------------------------
         BEGIN
            SELECT org_id, card_program_id
              INTO lv_org_id, lv_card_prg_id
              FROM ap_cards_all
             WHERE SUBSTR (card_number,
                           9,
                           16
                          ) = SUBSTR (trans_rec.attribute1,
                                      9,
                                      16
                                     ) AND inactive_date IS NULL;
         EXCEPTION
            WHEN OTHERS
            THEN
               lv_err_flag := 'E';
               lv_err_message := 'Error while getting the details Based on Credit Card No';
               fnd_file.put_line (fnd_file.LOG, lv_err_message);
         END;

         IF lv_err_flag <> 'E'
         THEN
            FOR trans_details_rec IN trans_details_cur (trans_rec.attribute1, gn_request_id)
            LOOP
               --To Fetch the trx_id sequence numbering
               SELECT xxey_ap_cc_seq_s.NEXTVAL
                 INTO lv_trx_id
                 FROM DUAL;

               BEGIN
                  INSERT INTO ap_credit_card_trxns_all
                              (trx_id, validate_code, card_program_id, expensed_amount, card_number,
                               reference_number,
                                                --                            transaction_type,
                                                transaction_date,
                               transaction_amount, debit_flag,
                               billed_date, billed_amount, billed_currency_code,
                               posted_date, posted_amount, posted_currency_code,
                               currency_conversion_rate,
                                                        --                            sic_code,
                                                        --                            merchant_reference,
                                                        merchant_name1, merchant_city,
                                                                                      --                            merchant_country,
                                                                                      org_id,
                               last_update_date, last_updated_by, last_update_login, creation_date, created_by, payment_flag,
                               merchant_activity, CATEGORY, payment_due_from_code, request_id, trx_available_date
                              )
                       VALUES (lv_trx_id, 'N', lv_card_prg_id, 0, trans_details_rec.attribute1,   -- Credit Card Num
                               trans_details_rec.attribute6 || '_' || lv_trx_id,   -- Trx Ref Num
                                                                                --                             trans_details_rec.transaction_type,
                                                                                trans_details_rec.attribute2,   -- Trx Date
                               trans_details_rec.attribute4,   -- Amount Foreign Curr
                                                            DECODE (SIGN (trans_details_rec.attribute4),
                                                                    -1, 'F',
                                                                    'T'
                                                                   ),
                               trans_details_rec.attribute3,   -- Posted date
                                                            trans_details_rec.attribute5,   -- Amount Foreign Curr
                                                                                         trans_details_rec.attribute8,   -- Transaction Currency Code
                               trans_details_rec.attribute3,   -- Posted Date
                                                            trans_details_rec.attribute5,   -- Amount Foreign Curr
                                                                                         trans_details_rec.attribute7,   -- Currency Code USD
                               trans_details_rec.attribute9,   -- Currency Conversion Rate
                                                            --                             trans_details_rec.sic_code,
                                                            --                             trans_details_rec.merchant_reference,
                                                            trans_details_rec.attribute10,   -- Supplier Name
                                                                                          trans_details_rec.attribute11,   -- Location
                                                                                                                        --                             trans_details_rec.merchant_country,
                                                                                                                        lv_org_id,
                               SYSDATE, gn_user_id, gn_user_id, SYSDATE, gn_user_id, 'N',
                               'M', 'BUSINESS', 'COMPANY', gn_request_id, trans_details_rec.attribute12
                              );

                  UPDATE xxeyap_cc_trxns_stg_tl
                     SET record_status = 'P',
                         err_msg = 'Record Processed'
                   WHERE ROWID = trans_details_rec.ROWID AND data_source = 'AP_IEXPENSES_CC';

                  -- AND SUBSTR(card_number,9,16) = SUBSTR(trans_rec.card_number,9,16);
                  COMMIT;
               EXCEPTION
                  WHEN OTHERS
                  THEN
                     fnd_file.put_line (fnd_file.LOG, 'Error in inserting record Data :-' || SQLERRM);
               END;
            END LOOP;
         ELSE
            ln_total_emp_failed := ln_total_emp_failed + 1;

            UPDATE xxeyap_cc_trxns_stg_tl
               SET record_status = 'E',
                   err_msg = lv_err_message
             WHERE SUBSTR (attribute1,
                           9,
                           16
                          ) = SUBSTR (trans_rec.attribute1,
                                      9,
                                      16
                                     );
         --           fnd_file.put_line (fnd_file.output, 'In Else of If for Error') ;
         END IF;
      END LOOP;

      BEGIN
         SELECT COUNT (*)
           INTO ln_total_count
           FROM xxeyap_cc_trxns_stg_tl
          WHERE request_id = gn_request_id;
      EXCEPTION
         WHEN OTHERS
         THEN
            fnd_file.put_line (fnd_file.LOG, 'Error in Others Exception for Receipt Created Count');
      END;

      BEGIN
         SELECT COUNT (*)
           INTO ln_processed_count
           FROM xxeyap_cc_trxns_stg_tl
          WHERE record_status = 'P' AND request_id = gn_request_id;
      EXCEPTION
         WHEN OTHERS
         THEN
            fnd_file.put_line (fnd_file.LOG, 'Error in Others Exception for Receipt Processed Count');
      END;

      BEGIN
         SELECT COUNT (*)
           INTO ln_reject_count
           FROM xxeyap_cc_trxns_stg_tl
          WHERE record_status = 'E' AND request_id = gn_request_id;
      EXCEPTION
         WHEN OTHERS
         THEN
            fnd_file.put_line (fnd_file.LOG, 'Error in Others Exception for Receipt Reject Count');
      END;

      fnd_file.put_line (fnd_file.output, 'EY IExpenses Credit Card Validation Program To AP, Run ON ' || SYSDATE);
      fnd_file.put_line (fnd_file.output, 'Summary Of Run : ');
      fnd_file.put_line (fnd_file.output, ' ');
      fnd_file.put_line (fnd_file.output, ' ');
      fnd_file.put_line (fnd_file.output, RPAD ('*',
                                                90,
                                                '*'
                                               ));
      fnd_file.put_line (fnd_file.output, '    Result of EY IExpenses Credit Card Validation Program       ');
      fnd_file.put_line (fnd_file.output, RPAD ('*',
                                                90,
                                                '*'
                                               ));
      fnd_file.put_line (fnd_file.output, 'Total No. Of Records Avaliable in Staging Table       :- ' || ln_total_count);
      fnd_file.put_line (fnd_file.output, 'Total No. Of Employees Records Processed              :- ' || ln_processed_count);
      fnd_file.put_line (fnd_file.output, 'Total No. Of Employees Records to be Processed        :- ' || ln_total_emp_count);
      fnd_file.put_line (fnd_file.output, 'Total No. Of Employees Records Failed                 :- ' || ln_total_emp_failed);
      fnd_file.put_line (fnd_file.output, 'Total No. Of Records Failed                           :- ' || ln_reject_count);
      fnd_file.put_line (fnd_file.output, RPAD ('*',
                                                90,
                                                '*'
                                               ));
      fnd_file.put_line (fnd_file.output, ' ');

      IF (ln_reject_count > 0)
      THEN
         fnd_file.put_line (fnd_file.output, RPAD ('*',
                                                   90,
                                                   '*'
                                                  ));
         fnd_file.put_line (fnd_file.output, ' ');
         fnd_file.put_line (fnd_file.output, ' Failed Records Information');
         fnd_file.put_line (fnd_file.output, '*****************************');
         fnd_file.put_line (fnd_file.output, '  ');
         fnd_file.put_line (fnd_file.output, RPAD ('*',
                                                   90,
                                                   '*'
                                                  ));
         fnd_file.put_line (fnd_file.output, RPAD ('Card Number ',
                                                   25,
                                                   ' '
                                                  ) || RPAD ('Error Message',
                                                             65,
                                                             ' '
                                                            ));
         fnd_file.put_line (fnd_file.output, RPAD ('*',
                                                   90,
                                                   '*'
                                                  ));
         fnd_file.put_line (fnd_file.output, ' ');

         FOR i IN status_cur (gn_request_id)
         LOOP
            fnd_file.put_line (fnd_file.output, RPAD (i.attribute1, 25) || RPAD (i.err_msg, 65));
         END LOOP;
      END IF;

      fnd_file.put_line (fnd_file.output, ' ');
      fnd_file.put_line (fnd_file.output, ' ');
      fnd_file.put_line (fnd_file.output, 'Request Id : ' || gn_request_id);
      fnd_file.put_line (fnd_file.output,
                         '****** Please See the Log of Request Id for Errors and Exceptions occured during execution In-Detail');
      fnd_file.put_line (fnd_file.output, ' ');
      fnd_file.put_line (fnd_file.output, ' ');
      fnd_file.put_line (fnd_file.output, '***** End of the Report *****');

      /*
      BEGIN
       XXEY_CC_INT_PK.INIT_NOTY_PR(gn_request_id,lc_status);
      EXCEPTION
       WHEN OTHERS THEN
          fnd_file.put_line (fnd_file.log, 'Error while Initiate the Workflow :-'||SQLERRM ) ;
      END;
      */
      BEGIN
         xxey_cc_notify.init_wf (gn_request_id, lc_wf_status);
      EXCEPTION
         WHEN OTHERS
         THEN
            fnd_file.put_line (fnd_file.LOG, 'Error while Initiate the Workflow :-' || SQLERRM);
      END;
   EXCEPTION
      WHEN OTHERS
      THEN
         fnd_file.put_line (fnd_file.LOG, 'Error while Inserting data into Base Table :-' || SQLERRM);
   END xx_ap_validate_cc_proc;
END xx_ap_cc_iexpense_pkg;
/


Step 4: Check the records

Query the credit card transactions base table to view the loaded records,

select * from ap_credit_card_trxns_all


Step 5: Create request set for both programs

You can create a request set so that both programs are executed in sequence. The request set will be like the following,

Stages

Once the programs are executed the credit card lines are loaded into AP_CREDIT_CARD_TRXNS_ALL table. The users subsequently create their own expense report after logging in to Oracle iExpense as shown in Step 3a in this article.

Important:
Only when the expense report is submitted for Credit Card, the expense lines are created in AP_EXPENSE_REPORT_LINES_ALL table. If the expense report is created but saved for later the expense lines remain in the AP_CREDIT_CARD_TRXNS_ALL table.


Code to list pending credit card transactions

The following code lists the employees for whom there are pending credit card transactions that have to be submitted as expense reports.

SELECT   ppx.employee_number, ppx.full_name, accta.card_number, COUNT (accta.card_number) "Num of Transactions"
    FROM ap_cards_all aca, ap_credit_card_trxns_all accta, per_people_x ppx
   WHERE aca.card_number = accta.card_number AND aca.employee_id = ppx.person_id
GROUP BY ppx.employee_number, ppx.full_name, accta.card_number

Appendix

When the seeded validation program, , is used to validate the credit card expense lines the custom program in step 3 above, only needs to transfer the data from the custom table to the credit card table, AP_CREDIT_CARD_TRXNS_ALL.

Once the records are loaded in the table, execute the seeded program named, Credit Card Transactions Validation Program

Responsibility: Payables responsibility

Navigation: View > Requests

After the program completes you can check the credit card table, AP_CREDIT_CARD_TRXNS_ALL, table to view the transactions from the database.

Execute query

select * from ap_credit_card_trxns_all order by trx_id desc

The output

Note the column, VALIDATE_CODE. The value “Y” in this column indicates that the credit card data is valid. You can see some lines with “Y” and some lines with an error message, “INVALID_CARD_NUMBER“.

Now the iExpense credit card users can log in and create their expense reports for the valid credit card transactions in the database against their user names and credit cards (Step 3b in the Oracle iExpense Flow)

Cheers!



PO/Requisition hierarchy change – Error handling/prevention process

$
0
0

When an organization uses Oracle Purchasing, employees are assigned in the PO/Requisition hierarchy. Actually the position of an employee is assigned to the hierarchy. Certain issues can creep in if more than 1 employee is assigned to a position that is in the hierarchy or if an existing position in the hierarchy is end dated. The issues and my resolutions are discussed below.

To notify administrator of position changes

Query the PO hierarchy

You will notice that certain positions show up as No Holders. E.g. position 5440 in the diagram.

This is because the position 5440 was attached to an employee but the employee has been assigned a new position by the HR department. Therefore this position in the PO hierarchy remains in the hierarchy but does not have an employee. Now any PO that goes for approval to position 5440, the workflow stops with a message to the user saying “No Approver found“.

There can be a problem with multiple holders for a position as well. As shown in the diagram below the position 0065 has got 9 holders. This means when the PO approval is sent to this position for approval the workflow will end saying that there multiple holders for a single position and the PO will not be approved.

The requisition workflow behaves in the same manner if similar problems exist in the requisition hierarchy.

To avoid No Holders on a position we created a notification email process so that the administrator can make necessary changes manually, on the PO/Requisition hierarchy.

Step 1: Create a custom table to store the old positions

We have created a custom table, xxhr_position_in_heirarchy, to store the old positions, i.e. the old positions of an employee at the time of a position change of an employee.

Table definition

CREATE TABLE xxhr_position_in_heirarchy
(
person_id NUMBER,
full_name VARCHAR2(50 BYTE),
employee_number VARCHAR2(15 BYTE),
POSITION VARCHAR2(100 BYTE),
position_id NUMBER(15),
record_inserted_on DATE
)

 
Step 2: Write a procedure to identify and store the old positions

We have written a custom procedure, xxhr_pos_in_heirarchy, to identify the old positions for an employee.


CREATE OR REPLACE PROCEDURE apps.xxhr_pos_in_heirarchy (errbuf OUT VARCHAR2, retcode OUT NUMBER)
-- +======================================================================+
-- | XXXXX
-- | YYYYY
-- +======================================================================+
-- |
-- | $Id$
-- |
-- | MODULE NAME: xxey_generate_org_prc
-- | AUTHOR:
-- | DATE:
-- | DESCRIPTION: This procedure is used to store the old positions
-- |
-- |
-- |
-- | PARAMETERS :
-- |
-- |Change Record:
-- |=============
-- |Version Date Author Remarks
-- |======= ==== ====== =======
-- |
-- +======================================================================+
AS
   l_err_message    VARCHAR2 (1000);
   l_record_count   NUMBER          := 0;
BEGIN
   fnd_file.put_line (fnd_file.output, '=========================== Deleted Records =======================================');

   SELECT COUNT (*)
     INTO l_record_count
     FROM xxcust.xxhr_position_in_heirarchy;

   fnd_file.put_line (fnd_file.output, '=======================================================================');
   fnd_file.put_line (fnd_file.output, 'Records Deleted: ' || l_record_count);
   fnd_file.put_line (fnd_file.output, '=======================================================================');

   DELETE      xxcust.xxhr_position_in_heirarchy;

   COMMIT;

   BEGIN
      l_record_count := 0;
      fnd_file.put_line (fnd_file.output, '========= Upoad Position in Hierarchy in xxcust.xxhr_position_in_heirarchy Table =============');

      INSERT INTO xxcust.xxhr_position_in_heirarchy
                  (person_id, full_name, employee_number, POSITION, position_id, record_inserted_on)
         (SELECT papf.person_id, papf.full_name, papf.employee_number, pp.NAME, pp.position_id, SYSDATE record_inserted_on
            FROM per_positions pp, per_all_assignments_f paaf, per_all_people_f papf
           WHERE paaf.position_id = pp.position_id
             AND papf.person_id = paaf.person_id
             AND TRUNC (SYSDATE) BETWEEN paaf.effective_start_date AND paaf.effective_end_date
             AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date
             AND papf.current_employee_flag = 'Y'
             AND (   (pp.position_id IN (
                         SELECT ose.subordinate_position_id
                           FROM per_pos_structure_elements ose, per_position_structures pos, per_pos_structure_versions posv
                          WHERE posv.position_structure_id = pos.position_structure_id
                            AND ose.pos_structure_version_id = posv.pos_structure_version_id
                            AND posv.date_to IS NULL
                            AND UPPER (pos.NAME) LIKE UPPER ('EY PO Approval Hierarchy'))
                     )
                  OR (pp.position_id IN (
                         SELECT ose.subordinate_position_id
                           FROM per_pos_structure_elements ose, per_position_structures pos, per_pos_structure_versions posv
                          WHERE posv.position_structure_id = pos.position_structure_id
                            AND ose.pos_structure_version_id = posv.pos_structure_version_id
                            AND posv.date_to IS NULL
                            AND UPPER (pos.NAME) LIKE UPPER ('EY Requisition Hierarchy'))
                     )
                 ));

      COMMIT;

      SELECT COUNT (*)
        INTO l_record_count
        FROM xxcust.xxhr_position_in_heirarchy;

      fnd_file.put_line (fnd_file.output, '=======================================================================');
      fnd_file.put_line (fnd_file.output, 'Records Uploaded: ' || l_record_count);
   EXCEPTION
      WHEN OTHERS
      THEN
         fnd_file.put_line (fnd_file.LOG, SQLERRM);
   END;
EXCEPTION
   WHEN OTHERS
   THEN
      fnd_file.put_line (fnd_file.LOG, SQLERRM);
END xxhr_pos_in_heirarchy;
/

 
Step 3: Create a concurrent program for executing the procedure

We created a concurrent program to execute the procedure.

Concurrent program name: EY HR Load Positions in Hierarchy To Temp Table

Executable name: xxhr_pos_in_heirarchy

This concurrent program is scheduled to run every day so that the position changes for each day is noted in the custom table.

 
Step 4: Create an alert to send position change emails

We created an Oracle alert that will check the change in positions and send emails to the team that maintains the Purchasing and Requisition hierarchy. The email will contain the positions of employees whose old positions exist in either the Purchasing or Requisition hierarchy and their new positions. These positions are changed manually by the team that maintains the hierarchy.

Alert definition

SQL

SELECT papf.full_name, papf.employee_number, pp.NAME new_position, xph.POSITION old_position
INTO &name, &emp_no, &posi2, &posi1
FROM   per_all_assignments_f paaf, per_all_people_f papf, per_positions pp, xxcust.xxhr_position_in_heirarchy xph
 WHERE paaf.person_id = papf.person_id
   AND papf.person_id = xph.person_id
   AND pp.position_id = paaf.position_id
   AND paaf.position_id != xph.position_id
   AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
   AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
   AND NOT EXISTS (
          SELECT 1
            /*
            v1.output_value
            ,v2.output_value old_position
            ,v3.output_value new_position
            */
          FROM   apps.alr_alert_history_view v1, apps.alr_alert_history_view v2, apps.alr_alert_history_view v3
           WHERE v1.alert_name = 'EY HR Position Change Alert New'
             AND v2.alert_name = 'EY HR Position Change Alert New'
             AND v3.alert_name = 'EY HR Position Change Alert New'
             AND v1.exception_sequence = v2.exception_sequence
             AND v2.exception_sequence = v3.exception_sequence
             AND v1.output_name = 'EMP_NO'
             AND v2.output_name = 'POSI1'
             AND v3.output_name = 'POSI2'
             AND v1.output_value = papf.employee_number
             AND v2.output_value = xph.POSITION
             AND v3.output_value = pp.NAME)

Action

Action Details

Message text

For the &name (Employee number &Emp_No) position has been changed with the following details.

Position Old :&Posi1

Position new :&posi2

This is for your information and necessary action.

----------------------------------------------------------------------------------------------

The alert LDT file is given in the URL below for reference.

Alert LDT document

Once the alert is executed it sends the email. The email that will be delivered to the recipients will look like the following,

We can schedule this alert to execute on a regular basis and email for the changes in positions. Using this process, the old positions on the PO and Requisition hierarchies can be changed manually by the administrator with the new positions.

    
To avoid multiple holders for a position

In the previous customization we had talked about a process to notify the Purchasing administrator about position changes of an employee if he/she is on the PO/Requisition hierarchy.

Now we can also have a problem with the PO/Requisition hierarchy if a position on the hierarchy is assigned to more than 1 person. It will be very straightforward if we assign the position in Oracle HR to be a single incumbent position. The problem arises when the position is multiple incumbent.

We thought of stopping the Oracle HR administrator from assigning multiple employees to a multiple incumbent if the position already exists on the PO/Requisition hierarchy. We personalized the Assignment form to do so.

Step 1: Create a function to validate an assigned position for an employee

We created a function, XXEY_GET_POSITION_VAL, to validate whether a position has holders or not.

CREATE OR REPLACE FUNCTION apps.xxey_get_position_val (p_person_id NUMBER)
   RETURN NUMBER
IS
   l_position_id                NUMBER;
   l_pos_req                    VARCHAR2 (10);
   l_pos_po                     VARCHAR2 (10);
   l_val                        NUMBER;
   l_pos_structure_version_id   per_pos_structure_versions.pos_structure_version_id%TYPE;
BEGIN
   BEGIN
      SELECT position_id
        INTO l_position_id
        FROM per_all_assignments_f
       WHERE person_id = p_person_id AND SYSDATE BETWEEN effective_start_date AND effective_end_date;
   EXCEPTION
      WHEN NO_DATA_FOUND
      THEN
         NULL;
   END;

   --Checking the position in "PO Hierarchy"
   SELECT ppsv.pos_structure_version_id
     INTO l_pos_structure_version_id
     FROM per_position_structures pps, per_pos_structure_versions ppsv
    WHERE pps.position_structure_id = ppsv.position_structure_id
      AND pps.NAME = 'EY PO Approval Hierarchy'
      -- Change as per the PO hierarchy name
      AND SYSDATE BETWEEN date_from AND NVL (date_to, TO_DATE ('31-DEC-4712', 'DD-MON-YYYY'));

   SELECT per_positions_pkg.exists_in_hierarchy (x_pos_structure_version_id    => l_pos_structure_version_id,
                                                 x_position_id                 => l_position_id)
     INTO l_pos_req
     FROM DUAL;

   -- if the employee does not exist in the PO hierarchy check the requisition hierarchy
   IF l_pos_req = 'N'
   THEN
      --Checking the position in "Requisition Hierarchy"
      SELECT ppsv.pos_structure_version_id
        INTO l_pos_structure_version_id
        FROM per_position_structures pps, per_pos_structure_versions ppsv
       WHERE pps.position_structure_id = ppsv.position_structure_id
         AND pps.NAME = 'EY Requisition Hierarchy'
         -- Change as per the REQ hierarchy name
         AND SYSDATE BETWEEN date_from AND NVL (date_to, TO_DATE ('31-DEC-4712', 'DD-MON-YYYY'));

      SELECT per_positions_pkg.exists_in_hierarchy (x_pos_structure_version_id    => l_pos_structure_version_id,
                                                    x_position_id                 => l_position_id)
        INTO l_pos_po
        FROM DUAL;

      IF l_pos_po = 'Y'
      THEN
         l_val := 1;
      ELSE
         l_val := 0;
      END IF;
   ELSE
      l_val := 1;
   END IF;

   RETURN (l_val);
END;
/

 
Step 2: Create a personalization on the Assignment form in HRMS

Open the Assignment form in Oracle HRMS

Click on Help > Diagnostics > Custom Code > Personalize. Add a personalization as shown below.

Condition tab

The condition is as follows,

 WHERE xxey_get_position_val (:assgt.person_id) = 1
   AND (SELECT hap.position_type
          FROM hr_all_positions_f hap
         WHERE position_id = :assgt.position_id AND SYSDATE BETWEEN effective_start_date AND effective_end_date) <> 'SINGLE'
   AND :SYSTEM.block_status = 'CHANGED'

Action tab

Action 1:

The error message defined for this personalization is,

Only Single Incumbent position assignment is allowed for this employee as he/she is part of part of Purchasing / Requisition Hierarchy

Action 2:

Save the form and close all forms.

 
Test the personalization

Open the Assignment form

We shall change the position of this employee to a position that has already been assigned to an employee.

Click on the Position field and type in 7126%

Tab out of the field

Select whether you want to Update or Correct the record. This message is due to the Date Tracking feature in HRMS.

Once you have selected the Date Track option the next popup message appears asking whether the default values attached to the new position are applicable to this employee or not. Press either Yes or No for the position change to take place.

Now save the form.

Now the error message from the personalization is displayed and you are not allowed to save the record. This means that this position cannot be assigned to this employee. This way we can prevent the HR department from assigning multiple employees on a position that exists in the PO/Req hierarchy.

Cheers!


Account generation workflow setup and customization

$
0
0

Accounting information for PO and Requisitions can be derived from multiple places within Oracle Apps. Accounts are setup on Employees, Items, Subinventories, Item Categories, etc. Whenever a PO/Requisition is raised the accounting combination for the document lines are derived by the corresponding account generator workflow. The workflows can be customized as well to deviate from the seeded rules of account generation.

Oracle has defined account generator processes for many types of documents/transactions. If you need to modify the account generation logic then you need to customize the corresponding logic. You can check the Account Generator workflow names and the process names within Oracle.

Responsibility: General Ledger SuperUser

Navigation: Setup > Financials > Flexfields > Key >Accounts

Query the form

You can see that we can have a set of Account generation based on the Accounting Flexfield structure. Therefore if we have multiple accounting structures we will also have multiple account generation workflow processes. Essentially within 1 instance the workflow items will be the same but we can customize the workflows or add new processes for the workflows for different flexfield structures.

Requisition Account Generator workflow modification

We have added a function called Expense Account to modify the default expense account generation. This function has been added in the process, Build Expense Charge Account.

Build Expense Charge Account process

The properties for the function, Expense Account is as follows

This customization will generate different segment values based on the business logic in the PL/SQL code.

You will find examples of account generator at the following link,

Account setup in Employee Master

Responsibility: HRMS

Enter employee number, say 11854

Click on Find

Click on Assignment

Click on extra Tab button as shown below

Click on Purchasing Order Information

Note the default set of books and expense account for the employee

Accounts setup on Inventory organization

Navigation: Setup > Organization > Subinventories

Select a subinventory. We selected CMS

Click on OK.

Now query on this form for the subinventories. Click on Ctrl+F11.

Select a name, FURNTIURE.

Click on Open.

The subinventory is displayed. Click on Accounts tab.

The accounts set on the sub inventory are displayed as those are setup. As an alternate you can check the accounts from the previous screen.

Scroll right on the Subinventories screen

Now you can view the accounts

Accounts setup on Item Master

Responsibility: Inventory SuperUser

Navigation: Items > Master Items

You will be first prompted to change the organization to the correct subinventory

Choose a subinventory. We have chosen, CMS.

Query for an item, say CMS002.

Go to Purchasing tab

Note the account segment of the Expense account, i.e. 5774.

Account setup on Item Categories

Responsibility: Inventory SuperUser responsibility

Navigation: Setup > Items > Categories > Category Codes

Enter the following

Structure: Item Categories

Item Segment: Non-Stock

Item Family: Printing – Revenue Documents (5772)

Click on OK

Click on Find

Click on the DFF for Structure name=Item Categories

The account code is set on this DFF. This value is used by the PO/Requisition Account Generator when the PO or the Requisition is raised for a Non Stock item with these categories.

If we did not enter a particular Structure Name and Category and clicked on Find, then we would have got the records as shown below.

All the item categories are displayed. We have enabled a DFF for item categories on the prior form.

DFF Name: Item Categories

The segments are the following

Let us check the accounts for each scenario now.

Requisition for a Stock item

In this requisition the item, CMS002, is a stock item (as we have checked in Item master earlier). Check the distribution account.

The charge account is being picked up by the Requisition Account generator from the org setup. This is the expense account and it is picked from the material account of the subinventory.

Requisition for a Non Stock Item

The Non Stock item will not have an item number. Instead it goes by the category. In this requisition the category is Non-Stock.Printing – Revenue Documents (5772)..

Check the distributions for this requisition line.

The Requisition charge account, i.e. the item expense account, is derived from the Item Categories setup for the category used on the item line (as shown in the setup earlier)

Logic for PO account generation in this Oracle instance

Item type Document type Account generation rule
Non stock item Internal requisition There is no such scenario as this can only be done for a Purchase requisition
Stock item Internal requisition 1st 3 segments from emp master 4th seg from item master expense acc – Req acc generator
Non stock item Purchase requisition 1st 3 segments from emp master 4th seg from item category – PO acc generator
Stock item Purchase requisition Complete accountingl combination from organization setup

This logic is built into the PO account generator and you will see the results when you raise a PO and add distributions on the PO.

Cheers!


Configure Oracle to receive inbound Sales Orders from Siebel through PIP

$
0
0

The following setup steps are to be completed to enable Oracle to receive sales orders raised by Siebel through Oracle AIA Process Integration Pack (PIP).

  1. Profile option: HZ: Raise API Events

  1. Profile option: HZ: Format Business Object Business Events as Bulk

  1. Profile option: HZ: Generate Party Number

 

  1. Profile option: HZ: Generate Party Site Number

  1. Profile option: OM: Create Account Information

  1. Profile option: OM: Roll Up Charges on Header Level for AIA Synch

 

  1. Profile option: OM: Roll Up Charges on Line Level for AIA Synch

 

  1. Profile option: OM: Roll Up Tax on Header Level for AIA Synch

  1. Profile option, OM: Price Adjustment Modifier for AIA Order Lines

  1. Set the value System Parameters

Set the value of parameter, Customer Relationships, to All Customers.

  1. Profile option: OM: Default Salesrep

Instead of using the profile option we can set up the defaulting rules for a default sales representative. You can see the steps in this article.

  1. System Options

    Open the System Options form in Order Management

Click on Miscellaneous tab

Check Require Salesperson. The operating unit for which this option is checked will start using the default sales person that has been defined in the previous step.

Cheers!


Set up Oracle to send Items through PIP to Siebel

$
0
0

Items in Oracle Apps can be integrated with Siebel through Oracle AIA Process Integration Pack (PIP). PIP comes packaged with the necessary mappings to pick up the newly created items/modified items and insert into Siebel. The following setup steps have to be completed to enable PIP integration.

Configuration steps

Step 1: Add the license

Responsibility: System Administrator

Navigation: System Administration > Oracle Applications Manager > License Manager

Click on Products under the heading License

Click on the () sign to get more options.

Select License Applications Product and click on Continue

Identify Advanced Pricing Catalog

Select this line by clicking on the checkbox

Click on Next button

Review the information and click on Submit

You will get the message. Click on OK to go back to the License Manager home page.

   
Step 2: Enable the following events and their corresponding subscriptions

The following item events have to be enabled along with their subscriptions

  • oracle.apps.ego.item.postItemCreate
  • oracle.apps.ego.item.postItemUpdate
  • oracle.apps.ego.item.postItemBulkload

The following steps are to be done to enable the events and their subscriptions

Responsibility: System Administrator

Navigation: Workflow > Administrator Workflow > Business Events

Enter an event name from the list above

Click on Go

Now the event is queried on the form. Click on Update icon () on this page.

Ensure that the Status field shows Enabled. If it displays, Disabled, then change it to enabled and click on Apply button.

Go back to the Business Events form where you queried the event.

Click on Subscriptions icon ().

The subscriptions for this event are displayed.

Note that there are 2 subscriptions. All events will not have 2 subscriptions but all events will contain at least 1 subscription to the function, WF_RULE.DEFAULT.RULE.

Click on the edit button () of the first subscription, i.e. non WF_RULE subscription.

Ensure that Status is set to Enabled. Click on Next button.

Click on Apply button. Once the operation is over go back to the Subscriptions page.

Now click on update icon for the WF_RULE subscription.

On this form update the following,

  • Phase = 50
  • Status = Enabled

Click on Apply and ensure that the changes are saved. Repeat these steps for all the events to ensure that all the subscriptions of the events are set to the right values.

   
Verify the configuration

After the front end configurations are done you can verify the setup using the following sql

  1. Verify the advanced queue

SELECT NAME, enqueue_enabled, dequeue_enabled
  FROM user_queues
 WHERE NAME LIKE 'WF_BPEL%'

The output will be like this,

 

  1. Verify if the events are enabled and licensed

SELECT NAME, status, licensed_flag
  FROM wf_events
 WHERE NAME IN ('oracle.apps.ego.item.postItemBulkload',
                'oracle.apps.ego.item.postItemCreate',
                'oracle.apps.ego.item.postItemUpdate')

The events should have Status = Enabled and Licensed_Flag = Y.

If the field, licensed_flag, is set to N (Non Licensed) then we can also update the value from the back end instead of licensing it from the front end.

UPDATE wf_events
   SET licensed_flag = 'Y'
 WHERE NAME IN ('oracle.apps.ego.item.postItemCreate',
                'oracle.apps.ego.item.postItemUpdate',
                'oracle.apps.ego.item.postItemBulkload');

 

 

Test the setup

Open the Item form.

We shall create a new item first. On the top menu, click on Tools > Copy From…

Now we can copy the item attributes from either a template or an item. We shall copy the item attributes from an existing item. Thus we shall enter the item name first.

Click on Done

The item form is now populated with the attributes of the existing item. Enter an Item name.

Before saving the item let us quickly query the database. We know that this item should flow through an advanced queue named, WF_BPEL_QAGENT. The queue table corresponding to this queue is WF_BPEL_QTAB.

Let us check how many the records there are in this table that has been enqueued within the last 1 hour.

SELECT *
  FROM wf_bpel_qtab
 WHERE enq_time > SYSDATE - 1 / 24

The output is shown below

We find that 2 records are in the queue table.

Now go back to the Item form in Oracle. Save the record.

Query the database once again with the previous query. The output shows 3 records.

The record at the bottom has been sent just now. Now you can try updating the same item in Oracle. We updated the description of the item.

Save the item and query the queue table with the previous query.

There are 4 records in the queue table now, indicating that the item update has also been sent to PIP.

Important:

The item business events that we have enabled earlier have 2 subscriptions as you have seen earlier. 1 subscription stores the item message in a table, EGO_BUSINESS_EVENTS_TRACKING, and the other subscription enqueues the message to WF_BPEL_QAGENT.

If you query the table you will see,

You can track outbound Item messages on this table with more detail than the queue table, WF_BPEL_QTAB.

Cheers!


Oracle setup steps for Customer outbound interface through PIP to Siebel

$
0
0

We would like to integrate customer from Oracle Apps/EBS with Siebel. The integration will be done using PIP (Process Integration Pack) that has been supplied by Oracle.

Step 1: Enable the business events

As per the setup document given by Oracle the business events the following business events have to be enabled in Oracle apps.

  1. oracle.apps.ar.hz.OrgCustBO.create
  2. oracle.apps.ar.hz.OrgCustBO.update
  3. oracle.apps.ar.hz.CustAccount.merge
  4. oracle.apps.ar.hz.Party.merge

Login to Oracle Apps. Go to System Administrator responsibility

Navigation: Workflow > Workflow Administrator > Business Events

Search for an event, say oracle.apps.ar.hz.OrgCustBO.create.

Ensure that the Status is Enabled. For details on business events you can refer to the following article. Now you need to ensure that all the business events are enabled for the outbound integration to work.


Step 2: Add the TCA programs to the responsibility

Add the following programs to the responsibility from where you will execute

  1. TCA Business Object Events: Raise Events Program
  2. TCA Business Object Events: Generate Infrastructure Packages Program

We have added the programs to a request group for Order Management


Step 3: Execute Generate Infrastructure Packages Program

Execute the program, TCA Business Object Events: Generate Infrastructure Packages Program, to generate the packages that will be used by TCA Business Object Events: Raise Events Program.

Go to the responsibility to which you have added the programs in step 1. Execute the program.

Note:

If the Raise Events Program is executed before Generate Infrastructure Packages Program, the program will error out with message as shown below,

+---------------------------------------------------------------------------+

**Starts**25-NOV-2012 11:38:34
**Ends**25-NOV-2012 11:38:35
+---------------------------------------------------------------------------+
Start of log messages from FND_FILE
+---------------------------------------------------------------------------+
bes_main(+)

get BO versions from BOD

delete duplicate rows from BOT

populate missing links

populate_missing_links()+
populate_missing_links()-

insert into GT the root nodes with short circuting

completness check for Person BO

ORA-06508: PL/SQL: could not find program unit being called

Error: Aborting concurrent program

+---------------------------------------------------------------------------+
End of log messages from FND_FILE
+---------------------------------------------------------------------------+

You can check Metalink note ID 1317394.1 for the same.


Step 4: Update a customer

Open a customer in the customer form

Update some details for this customer and save it record.


Step 5: Execute the Raise Events Program

Go to the responsibility where you had added the program as per step 2. Execute the program, TCA Business Object Events: Raise Events Program.

Click on Submit button to execute the program.

Once the program completes click on View Log button. The log file shows the following,

+---------------------------------------------------------------------------+
Start of log messages from FND_FILE
+---------------------------------------------------------------------------+
bes_main(+)

get BO versions from BOD

delete duplicate rows from BOT

populate missing links

populate_missing_links()+

populate_missing_links()-

insert into GT the root nodes with short circuting

completness check for Person BO

event type check for Person BO

completness check for Org BO

event type check for Org BO

insert (in GT) all those related PERSON/ORG CUST BO records that are not in GT

completness check for Person Cust BO

event type check for Person Cust BO

completness check for Org Cust BO

event type check for Org Cust BO

raise the one event per object instance

Total count in GT is:2

CDH_EVENT_ID  is: 10376

CDH_OBJECT_ID is: 170040

Updating BOT object hierarchy with event_id

Raise oracle.apps.ar.hz.OrgBO.update

CDH_EVENT_ID  is: 10377

CDH_OBJECT_ID is: 170040

Updating BOT object hierarchy with event_id

Raise oracle.apps.ar.hz.OrgCustBO.update

Updating hz_parties for future short circuiting

Person Business Object bo_version_number is: 1

Organization Business Object bo_version_number is: 1

Person Customer Business Object bo_version_number is: 1

Organization Customer Business Object bo_version_number is: 1

Concurrent Program completed successfully.

+---------------------------------------------------------------------------+
End of log messages from FND_FILE
+---------------------------------------------------------------------------+

The log file gives the event ID for update event.


Step 6: Check BPEL console

Log in to BPEL console

Enter your credentials. Go to Instances tab

You can see that the customer message has been passed into PIP.

Cheers!


Instance health check queries

$
0
0

I regularly use the following queries to check the health of the Oracle instance. I use the output of the queries to create my own graphs that I present to management/client. You can modify the queries by changing the KFF names, custom object naming standard (for me the custom objects have been named by starting the names with XXEY), etc.

Program runs (runs in seconds)

SELECT *
  FROM (SELECT   TRUNC (fcr.request_date) request_date,
                 fct.user_concurrent_program_name program_name,
                 COUNT (1) num_runs,
                 MAX (  (fcr.actual_completion_date - fcr.actual_start_date)
                      * 24
                      * 60
                      * 60
                     ) worst_time,
                 MIN (  (fcr.actual_completion_date - fcr.actual_start_date)
                      * 24
                      * 60
                      * 60
                     ) best_time,
                 ROUND (AVG (  (  fcr.actual_completion_date
                                - fcr.actual_start_date
                               )
                             * 24
                             * 60
                             * 60
                            ),
                        2
                       ) avg_time
            FROM fnd_concurrent_requests fcr,
                 fnd_concurrent_programs fcp,
                 fnd_concurrent_programs_tl fct
           WHERE fcr.concurrent_program_id = fcp.concurrent_program_id
             AND fcr.concurrent_program_id = fct.concurrent_program_id
             AND fct.LANGUAGE = 'US'
             AND fcr.status_code != 'R'
             AND TRUNC (fcr.request_date) BETWEEN (SYSDATE - 7) AND SYSDATE
        GROUP BY TRUNC (fcr.request_date), fct.user_concurrent_program_name
        ORDER BY 1, 2)
 WHERE avg_time > 1800

Sample output

REQUEST_DATE PROGRAM_NAME NUM_RUNS WORST_TIME BEST_TIME AVG_TIME
7/9/2012 Autoinvoice Import Program 12 3394 3147 3247.83
7/9/2012 Autoinvoice Master Program 4 4282 3940 4095.5
7/9/2012 EY Common Data Loader 1 2894 2894 2894
7/9/2012 Report Set 1 4390 4390 4390
7/10/2012 Autoinvoice Import Program 12 2561 2439 2495.75
7/10/2012 Autoinvoice Master Program 4 2949 2859 2891.5
7/10/2012 EY Common Data Loader 1 2639 2639 2639
7/11/2012 Autoinvoice Import Program 9 3040 2961 3007.78
7/11/2012 Autoinvoice Master Program 1 3377 3377 3377
7/11/2012 Report Set 3 5277 3 3453.33

   
Code to monitor growth in custom objects

SELECT   object_type, mon, dt, num,
         SUM (num) OVER (PARTITION BY object_type ORDER BY object_type,
          dt) run_tot
    FROM (SELECT   object_type, TO_CHAR (created, 'MON-YY') mon,
                   TO_CHAR (created, 'YYYYMM') dt, COUNT (1) num
              FROM all_objects
             WHERE (object_name LIKE 'EY%' OR object_name LIKE 'XX%')
          GROUP BY object_type,
                   TO_CHAR (created, 'MON-YY'),
                   TO_CHAR (created, 'YYYYMM')) obj_data
ORDER BY 3, 1

Sample output

OBJECT_TYPE MON DT NUM RUN_TOT
PACKAGE SEP-05

200509

1

1

PACKAGE BODY SEP-05

200509

1

1

PROCEDURE SEP-05

200509

6

6

SEQUENCE SEP-05

200509

1

1

SYNONYM SEP-05

200509

5

5

TABLE SEP-05

200509

12

12

VIEW SEP-05

200509

1

1

FUNCTION OCT-05

200510

1

1

TABLE ‘OCT-05

200510

30

42

VIEW ‘NOV-05

200511

1

2

PROCEDURE MAY-06

200605

1

7

TABLE MAY-06

200605

1

43

PACKAGE JUN-06

200606

1

2

PACKAGE BODY JUN-06

200606

1

2

TABLE JUN-06

200606

1

44

VIEW JUN-06

200606

1

3

FUNCTION JUL-06

200607

1

2

INDEX JUL-06

200607

2

2

PACKAGE JUL-06

200607

1

3

PACKAGE BODY JUL-06

200607

1

3

PROCEDURE JUL-06

200607

6

13

SEQUENCE JUL-06

200607

13

14

SYNONYM JUL-06

200607

25

30

TABLE JUL-06

200607

18

62

VIEW JUL-06

200607

3

6

SEQUENCE AUG-06

200608

1

15

SYNONYM AUG-06

200608

11

41

PROCEDURE SEP-06

200609

1

14

PROCEDURE OCT-06

200610

2

16

SYNONYM OCT-06

200610

1

42

TABLE OCT-06

200610

1

63

VIEW OCT-06

200610

5

11

PACKAGE NOV-06

200611

1

4

PACKAGE BODY NOV-06

200611

1

4

PROCEDURE NOV-06

200611

2

18

SYNONYM NOV-06

200611

1

43

TABLE NOV-06

200611

3

66

VIEW NOV-06

200611

9

20

FUNCTION DEC-06

200612

2

4

INDEX DEC-06

200612

5

7

TABLE DEC-06

200612

3

69

VIEW DEC-06

200612

1

21

FUNCTION JAN-07

200701

1

5

PACKAGE JAN-07

200701

2

6

PACKAGE BODY JAN-07

200701

2

6

PROCEDURE JAN-07

200701

1

19

VIEW JAN-07

200701

7

28

MATERIALIZED VIEW FEB-07

200702

1

1

SEQUENCE FEB-07

200702

2

17

SYNONYM FEB-07

200702

3

46

TABLE FEB-07

200702

6

75

VIEW FEB-07

200702

12

40

TABLE MAR-07

200703

3

78

VIEW MAR-07

200703

9

49

INDEX APR-07

200704

4

11

PROCEDURE APR-07

200704

1

20

TABLE APR-07

200704

1

79

VIEW APR-07

200704

1

50

PROCEDURE MAY-07

200705

1

21

SYNONYM MAY-07

200705

1

47

VIEW MAY-07

200705

13

63

PACKAGE JUN-07

200706

5

11

PACKAGE BODY JUN-07

200706

5

11

PROCEDURE JUN-07

200706

1

22

VIEW JUN-07

200706

1

64

PACKAGE JUL-07

200707

5

16

PACKAGE BODY JUL-07

200707

5

16

TABLE JUL-07

200707

1

80

VIEW JUL-07

200707

2

66

   
Check the running times for all programs run in the last 7 days (Executes in 5 seconds)

SELECT   trunc(fcr.request_date) Request_date, fct.user_concurrent_program_name,
         COUNT (1) "Num of runs",
         MAX (  (fcr.actual_completion_date - fcr.actual_start_date)
              * 24
              * 60
              * 60
             ) "Worst time (in secs)",
         MIN (  (fcr.actual_completion_date - fcr.actual_start_date)
              * 24
              * 60
              * 60
             ) "Best time (in secs)",
         ROUND
            (AVG (  (fcr.actual_completion_date
                     - fcr.actual_start_date
                    )
                  * 24
                  * 60
                  * 60
                 ),
             2
            ) "Avg time (in secs)",
         ROUND
            (MEDIAN (  (  fcr.actual_completion_date
                        - fcr.actual_start_date
                       )
                     * 24
                     * 60
                     * 60
                    ),
             2
            ) "Median time (in secs)"
    FROM fnd_concurrent_requests fcr, fnd_concurrent_programs fcp, fnd_concurrent_programs_tl fct
   WHERE fcr.concurrent_program_id = fcp.concurrent_program_id
     AND fcr.concurrent_program_id = fct.concurrent_program_id
     AND fct.language = 'US'
     AND fcr.status_code != 'R'
     AND trunc(fcr.request_date) BETWEEN (SYSDATE - 7) AND SYSDATE
GROUP BY trunc(fcr.request_date), fct.user_concurrent_program_name
ORDER BY 1

Sample output

REQUEST_DATE USER_CONCURRENT_PROGRAM_NAME Num of runs Worst time (in secs) Best time (in secs) Avg time (in secs) Median time (in secs)
7/5/2012 AutoReconciliation 6048 28 0 2.89 2
7/5/2012 AutoReconciliation Execution Report 6048 19 1 4 3
7/5/2012 AutoSelect 1 5 5 5 5
7/5/2012 Build Payments 2 2 1 1.5 1.5
7/5/2012 Check Periodic Alert 4 48 1 15.25 6
7/5/2012 Compile value set hierarchies 4 1 0 0.5 0.5
7/5/2012 Confirm Payment Batch 1 3 3 3 3
7/5/2012 Create and Maintain Company Cost Center Organizations 1 1 1 1 1
7/5/2012 EY Account Analysis 3 9 3 5.33 4
7/5/2012 EY HR Miscellaneous Run 2 1 1 1 1
7/5/2012 EY Payment Voucher 2 22 2 12 12
7/5/2012 EY Purchase Order Print – Outstations With Tax 2 24 22 23 23
7/5/2012 EY Purchase Order Print – Outstations Without Tax 2 4 3 3.5 3.5
7/5/2012 EY SUPPLIER BANK LETTER 2 42 22 32 32
7/5/2012 Final Payment Register 2 1 1 1 1
7/6/2012 EY Purchase Order Print – Outstations Without Tax 1 4 4 4 4
7/6/2012 Gather Schema Statistics 4        
7/6/2012 Gather Table Statistics 9 886 161 514.89 533
7/6/2012 OAM Applications Dashboard Collection 1 8 8 8 8
7/6/2012 Periodic Alert Scheduler 1 74 74 74 74
7/6/2012 Print Adjustments 1 4 4 4 4
7/6/2012 Purge Concurrent Request and/or Manager Data 1 210 210 210 210
7/6/2012 Workflow Background Process 864 18 0 0.63 1
7/6/2012 Workflow Control Queue Cleanup 1 2 2 2 2
7/6/2012 XXEY TMS Trip Scheduler 24 1 0 0.33 0
7/7/2012 AutoReconciliation 6048 15 0 2.86 2
7/7/2012 AutoReconciliation Execution Report 6048 15 1 3.85 3
7/7/2012 Check Periodic Alert 4 52 1 16.5 6.5
7/7/2012 EY HR Miscellaneous Run 2 2 1 1.5 1.5
7/7/2012 Gather Table Statistics 9 717 185 431.67 478
7/7/2012 OAM Applications Dashboard Collection 1 9 9 9 9
7/7/2012 Periodic Alert Scheduler 1 77 77 77 77
7/7/2012 Print Adjustments 1 5 5 5 5
7/8/2012 AutoReconciliation 6048 22 0 2.96 2
7/8/2012 AutoReconciliation Execution Report 6048 21 1 3.92 3
7/8/2012 Bank Account Listing 2 5 2 3.5 3.5
7/8/2012 Check Periodic Alert 4 37 2 17.25 15
7/8/2012 Compile Security 15 7 0 1.87 1
7/8/2012 Delete Item Information 16 6 1 2.25 1
7/8/2012 EY Copy PDF file 1 1 1 1 1
7/8/2012 EY HR Miscellaneous Run 2 1 1 1 1
7/8/2012 EY Purchase Order Print – XML 1 18 18 18 18
7/9/2012 EY Supplier Aging Detail Report Revised 2 12 11 11.5 11.5
7/9/2012 Gather Table Statistics 9 1229 162 515.11 458
7/9/2012 General Ledger Transfer Program 4 1 0 0.5 0.5
7/9/2012 Maintain Oracle Office Messages 4 4 1 2.5 2.5
7/9/2012 OAM Applications Dashboard Collection 1 8 8 8 8
7/9/2012 Payables Open Interface Import 6 15 2 7.33 7
7/9/2012 Periodic Alert Scheduler 1 86 86 86 86
7/9/2012 Prepayments Matching Program 4 53 51 52 52
7/9/2012 Print Adjustments 1 11 11 11 11
7/9/2012 Purge Concurrent Request and/or Manager Data 1 206 206 206 206
7/9/2012 Report Set 1 4390 4390 4390 4390
7/9/2012 Request Set Stage 3 2895 2 1461.33 1487
7/9/2012 Workflow Background Process 864 49 0 0.95 1
7/9/2012 Workflow Control Queue Cleanup 1 4 4 4 4
7/10/2012 Autoinvoice Import Program 12 2561 2439 2495.75 2506
7/10/2012 Autoinvoice Master Program 4 2949 2859 2891.5 2879
7/10/2012 Check Event Alert 1 4 4 4 4
7/10/2012 Check Periodic Alert 4 54 1 20.5 13.5
7/10/2012 Create and Maintain Company Cost Center Organizations 4 1 0 0.5 0.5
7/10/2012 Deactivate Concurrent Manager 2        
7/10/2012 EY AR Credit Card BSP Import Program 1 313 313 313 313
7/10/2012 EY BSP DDS Create Data Batches Program 3 3517 5 1181 21
7/10/2012 EY Catering Requisitions and Transactions 1 1 1 1 1
7/10/2012 EY Common Data Loader 1 2639 2639 2639 2639
7/10/2012 EY Create Supplier Site 1 56 56 56 56
7/10/2012 EY HO Invoice Validation 2 109 4 56.5 56.5
7/10/2012 EY HO Invoice and OST DM Creation Program 2 197 160 178.5 178.5
7/10/2012 EY HR Miscellaneous Run 2        
7/10/2012 EY Payment Voucher 2 7 2 4.5 4.5
7/10/2012 EY Purchase Order Print – Outstations Without Tax 9 35 1 10.22 4
7/10/2012 Gather Table Statistics 9 664 115 455.33 475
7/10/2012 Inventory transaction worker 1 20 20 20 20
7/11/2012 Print Adjustments 1        
7/11/2012 Program – Automatic Posting 1 4 4 4 4
7/11/2012 Purge Concurrent Request and/or Manager Data 1        
7/11/2012 Report Set 3 5277 3 3453.33 5080
7/11/2012 Request Set Stage 11 3394 1 940.27 556
7/11/2012 Workflow Background Process 658 50 0 1.35 1
7/11/2012 Workflow Control Queue Cleanup 1        
7/11/2012 Workflow Definitions Loader 2 1 0 0.5 0.5
7/11/2012 XXEY MBS Exception Report 2 160 5 82.5 82.5
7/11/2012 XXEY TMS Trip Scheduler 17 2 0 0.38 0

   
SQL to get the running time buckets of programs (executes in 5 seconds)

SELECT COUNT (DECODE (SIGN ((actual_completion_date - actual_start_date) * 24 * 60 * 60 - 60),
                      -1, 1
                     )) "Num_less_1_min",
         COUNT (DECODE (SIGN ((actual_completion_date - actual_start_date) * 24 * 60 * 60 - 300),
                        -1, 1,
                        0, 1
                       ))
       - COUNT (DECODE (SIGN ((actual_completion_date - actual_start_date) * 24 * 60 * 60 - 60),
                        -1, 1
                       )) "Num_1_5_min",
         COUNT (DECODE (SIGN ((actual_completion_date - actual_start_date) * 24 * 60 * 60 - 900),
                        -1, 1,
                        0, 1
                       ))
       - COUNT (DECODE (SIGN ((actual_completion_date - actual_start_date) * 24 * 60 * 60 - 300),
                        -1, 1
                       )) "Num_5_15_min",
       COUNT (DECODE (SIGN ((actual_completion_date - actual_start_date) * 24 * 60 * 60 - 900),
                      1, 1,
                      0, 1
                     )) "Num_15_min"
  FROM fnd_concurrent_requests fcr
 WHERE fcr.status_code != 'R' AND TRUNC (fcr.request_date) BETWEEN (SYSDATE - 7) AND SYSDATE

Sample output

Num_less_1_min Num_1_5_min Num_5_15_min Num_15_min
88168 163 143 88

   
SQL to get space of the schemas

select 'All' Schema, ROUND(sum(BYTES) / 1024 / 1024, 3) Size_MB, sysdate from dba_data_files
UNION ALL
-- Add the modules being used
select owner Schema, ROUND(sum(BYTES) / 1024 / 1024, 3) Size_MB, sysdate from dba_segments where owner in ('GL', 'AR', 'AP', 'FA', 'CE', 'PO', 'INV', 'XXCUST') group by owner
UNION ALL
select 'Rest' Schema, ROUND(sum(BYTES) / 1024 / 1024, 3), sysdate from dba_segments where owner not in ('GL', 'AR', 'AP', 'FA', 'CE', 'PO', 'INV', 'XXCUST', 'SYS', 'SYSTEM')
UNION ALL
select 'Free' Schema, ROUND(sum(BYTES) / 1024 / 1024, 3) Size_MB, sysdate from dba_free_space

Sample output

SCHEMA SIZE_MB SYSDATE
All 1062106.58 7/11/2012 16:51
AR 27258.5 7/11/2012 16:51
GL 163434.875 7/11/2012 16:51
FA 665.375 7/11/2012 16:51
PO 4749.125 7/11/2012 16:51
XXCUST 191872.07 7/11/2012 16:51
CE 132.125 7/11/2012 16:51
AP 10818.75 7/11/2012 16:51
INV 3206.625 7/11/2012 16:51
Rest 411927.945 7/11/2012 16:51
Free 197018.992 7/11/2012 16:51

  
SQL to get the KFF Segment growth

select ffv.flex_value_set_id, ffs.FLEX_VALUE_SET_NAME SEGMENT_NAME, glp.period_name, count(1)
from fnd_flex_values ffv, fnd_flex_value_sets ffs, gl_periods glp
where ffv.flex_value_set_id = ffs.flex_value_set_id
and ffs.flex_value_set_name in (
select ffvs.flex_value_set_name
from FND_ID_FLEX_STRUCTURES_VL ffv, FND_ID_FLEX_SEGMENTS_VL fft, fnd_flex_value_sets ffvs
where 1 = 1
and fft.id_flex_num = ffv.id_flex_num
and ffvs.flex_value_set_id = fft.flex_value_set_id
and ffv.id_flex_code = 'GL#'
and ffv.id_flex_structure_name = 'EY_ACC_FLEX' -- To be changed as per KFF name
)
and glp.period_type = '21'
and glp.period_set_name = 'EY Monthly'
and ffv.last_update_date between glp.start_date and glp.end_date
group by  ffv.flex_value_set_id, ffs.FLEX_VALUE_SET_NAME, glp.period_name

Sample output

FLEX_VALUE_SET_ID SEGMENT_NAME PERIOD_NAME COUNT(1)
1009608 EY_LOCATION 8-Apr 8
1009608 EY_LOCATION 8-Nov 8
1009608 EY_LOCATION 11-Apr 1
1009609 EY_COST_CENTRE 5-Sep 14
1009609 EY_COST_CENTRE 8-Nov 3
1009609 EY_COST_CENTRE 8-Sep 19
1009610 EY_ACCOUNT 9-Nov 19
1009610 EY_ACCOUNT 7-Dec 15
1009610 EY_ACCOUNT 11-Nov 11
1009610 EY_ACCOUNT 10-Jun 4
1009610 EY_ACCOUNT 7-Sep 6
1009610 EY_ACCOUNT 9-Sep 13
1009611 EY_COST_OBJECT 6-Aug 18
1009611 EY_COST_OBJECT 8-Jul 38
1009611 EY_COST_OBJECT 10-Nov 53
1009611 EY_COST_OBJECT 7-Sep 28
1009611 EY_COST_OBJECT 7-Aug 22
1009611 EY_COST_OBJECT 7-Jun 18
1009612 EY_AIRCRAFT_CODE 5-Dec 5
1009612 EY_AIRCRAFT_CODE 7-Oct 14
1009612 EY_AIRCRAFT_CODE 9-Mar 106
. . . . . . . . . . .
. . . . . . . . . . .
1009610 EY_ACCOUNT 7-Aug 5
1009612 EY_AIRCRAFT_CODE 10-May 2
1009608 EY_LOCATION 10-Jun 7
1009608 EY_LOCATION 6-Nov 3
1009608 EY_LOCATION 10-Sep 3
1009610 EY_ACCOUNT 10-Sep 2
1009609 EY_COST_CENTRE 9-Sep 1
1009609 EY_COST_CENTRE 6-Oct 2
1009609 EY_COST_CENTRE 6-Jun 2
1009610 EY_ACCOUNT 9-Dec 2
1009612 EY_AIRCRAFT_CODE 8-May 1

   
SQL to get the KFF details

select ffv.id_flex_code, ffv.id_flex_structure_name, ffv.id_flex_structure_code, fft.segment_name, fft.application_column_name, fft.form_left_prompt, fft.form_above_prompt, fft.flex_value_set_id, ffvs.flex_value_set_name
from FND_ID_FLEX_STRUCTURES_VL ffv, FND_ID_FLEX_SEGMENTS_VL fft, fnd_flex_value_sets ffvs
where 1 = 1
and fft.id_flex_num = ffv.id_flex_num
and ffvs.flex_value_set_id = fft.flex_value_set_id
and ffv.id_flex_code = 'GL#'
and ffv.id_flex_structure_name = 'EY_ACC_FLEX'

Sample output

ID_FLEX_CODE ID_FLEX_STRUCTURE_NAME ID_FLEX_STRUCTURE_CODE SEGMENT_NAME APPLICATION_COLUMN_NAME FORM_LEFT_PROMPT FORM_ABOVE_PROMPT FLEX_VALUE_SET_ID FLEX_VALUE_SET_NAME
GL# EY_ACC_FLEX EY_ACC_FLEX Company SEGMENT1 Company Company 1009607 EY_COMPANY
GL# EY_ACC_FLEX EY_ACC_FLEX Location SEGMENT2 Location Location 1009608 EY_LOCATION
GL# EY_ACC_FLEX EY_ACC_FLEX Cost Centre SEGMENT3 Cost Centre Cost Centre 1009609 EY_COST_CENTRE
GL# EY_ACC_FLEX EY_ACC_FLEX Account SEGMENT4 Account Account 1009610 EY_ACCOUNT
GL# EY_ACC_FLEX EY_ACC_FLEX Cost Object SEGMENT5 Cost Object Cost Object 1009611 EY_COST_OBJECT
GL# EY_ACC_FLEX EY_ACC_FLEX Aircraft Code SEGMENT6 Aircraft Code Aircraft Code 1009612 EY_AIRCRAFT_CODE

Cheers!


Order to Cash (O2C) process flow

$
0
0

The Order to Cash or O2C cycle, as it is popularly called, is one of the basic and common business flows within Oracle apps. This cycle is common for any manufacturing or related companies which have implemented Oracle eBusiness Suite.

The phases in the Order to Cash cycle are,

  • Enter Order
  • Book Order
  • Pick Release
  • Pick Confirm (Optional)
  • Ship Confirm
  • Create Invoice
  • Create Receipt
  • Transfer to GL
  • Bank Reconciliation

Step (i): Check item assignment to sub inventory

We shall first check the warehouses which can transact for the item in question. We shall raise a sales order for this item later on.

Responsibility: Inventory

Navigation: Items > Master Items

You will be first asked to select the sub inventory. We shall choose the sub inventory numbered 125.

Click on OK

Now that the item form is opened, query for the item APX.L600M11.A.

Note:
The item flexfield has 3 segments and hence the item code has 3 values.

Click on the Organization Assignment tab () on the left.

We see that the item, APX.L600M11.A, is assigned to the sub inventory 125. Therefore the sub inventory can store and issue this particular item.

   
Step (ii): Receive goods in sub inventory

We shall provide stock in the sub inventory for this item so that sales orders can be created. To increase stock of this item we shall issue a miscellaneous receipt. If we use a miscellaneous receipt then we do not have to go through a P2P cycle.

Responsibility: Inventory

Navigation: Transactions > Miscellanous Transaction

If you are asked to select the organization/sub inventory, select 125.

Click on OK

Select Type as Miscellanous Issue.

Click on Transaction Lines.

Now enter the Item details. We shall create miscellaneous issue of quantity 50 for item, APX.L600M11.A.

As this item is lot controlled (you can find it from the item master form in step 1) click on Lot/Serial button.

The Lot/Serial form opens. Click on Generate Lot button to generate a new Lot number. Then assign the entire quantity to the same lot.

Click on Done. You will be taken back to the Miscellanous Transaction form.

Save the form. The transaction will complete and the form will be cleared automatically. Close the form.

  
Step (iii): Verify the quantity

We shall now check the current on hand quantity of the item, APX.L600M11.A.

Responsibility: Inventory

Navigation: On-Hand Quantity > On-hand Quantity

Enter the item name.

Click on Find

Click on Availability button.

You can see that the warehouse or sub inventory 125 has a quantity of 650 of item, APX.L600M11.A.

Close the form.

  
Step 1: Enter the sales order

Open the Sales Order form.

Responsibility: Order Management

Navigation: Orders, Returns > Sales Orders

Enter the sales order header information

Enter the Order Type as it is a mandatory field. Notice that the Order Number and Status fields are blank. Also, the Sales Person and Price List fields are set to default values of “No Sales Credit” and “RPL01“. These 2 values come from the setup. Save the form.

Important:

Setup for Pricelist

The profile option, OM: Default Salesrep, is set.


When the form is saved Order Number is populated along with Status. The status of the order now is “Entered”. Click on Others tab.

Ensure that Payment terms is filled out.

Enter the Warehouse if all the order lines will be fulfilled from a single warehouse. We shall enter the value of the Warehouse. This value will be 125, i.e. that the warehouse where we had received the goods initially in step (ii).

We have entered the order header. We shall now enter the order line(s). Notice the top tab on the form.

Click on Line Items tab.

Enter the line details. We shall enter the item number, APX.L600M11.A. In step (ii) we had received the same item into the warehouse. We shall order a quantity of 2.

The price is automatically populated from the price list. The price list in use is RPL01 (which is set as the default price list on the order header)

Click on Pricing tab

The price list is populated from the header. Now click on Shipping tab.

The warehouse is populated from the order header. Save the form to save the order.

Tables Affected:
OE_ORDER_HEADERS_ALL
OE_ORDER_LINES_ALL
FLOW_STATUS_CODE in both the tables is ENTERED

Note:
Whenever an order is entered and saved 2 workflows are kicked off. These 2 workflows move the order from Entered phase to Completed phase. You might find that the order has not progressed into the next phase even though the current phase has been completed. In such a case you need to execute the program, Workflow Background Process. You will find this program under System Administrator responsibility.

The names of the 2 workflows are,

  1. OM Order Header (OEOH)
  2. OM Order Line (OEOL)

You can follow the workflows in Workflow Status Monitor,

You can get details on how to track workflows in this article.

  
Step 2: Book the sales order

Click on Availability button on the sales order form.

We can now check whether there are enough items available to be ordered from the warehouse. We see that the warehouse number 125 has total quantity of 650 and the ordered quantity is 2. Therefore the order can be fulfilled. Close the Availability window.

Click on Book Order button.

A pop message is displayed showing that the order has been booked. Now close the popup message by click on OK and go to the Order header by clicking on Order Information tab.

Notice that Status is now changed to Booked. Close the sales order form.

Tables affected:
The FLOW_STATUS_CODE in OE_ORDER_HEADERS_ALL will be BOOKED.

The FLOW_STATUS_CODE in OE_ORDER_LINES_ALL will be AWAITING_SHIPPING.
New records will be created in WSH_DELIVERY_DETAILS with RELEASED_STATUS=’R’ (Ready to Release)
New record(s) will be created in WSH_DELIVERY_ASSIGNMENTS
When the order is booked the DEMAND INTERFACE PROGRAM will run in the background and insert records into MTL_DEMAND table.

   
Step 3: Pick the order

There are 2 ways of picking the ordered items.

1. Release Sales Order form

Navigation: Shipping > Release Sales Orders > Release Sales Orders

Enter the Order number

Enter Document Set as All Pick Release Documents. Click on Shipping tab.

Enter the following,

AutoCreate Delivery: Yes

Auto pick Confirm: Yes

Autopack Delivery: Yes

Release Sequence Rule: All Standard Orders

Ship From: <The organization from which the item is shipped>

Click on Inventory tab.

Enter the Subinventory

Click on Execute Now button to pick the items. After this the ordered items will be picked from the warehouse and Pick Slip report will be executed. Once this is done we have to go to the Shipping Transaction form in step (ii).

If we pick the order from this form we have more control over the picking process but we will not follow this process to pick the order. We shall use step 2 to pick the order.

2. Shipping Transaction Form

If we pick the items using the Shipping Transaction form we have to manually execute the Move Order.

Navigation: Shipping > Transactions

Enter the Order Number.

Click on Find button.

The order is displayed and the line status shows Ready to Release. The next step is displayed also. It is Pick Release.

Click on the Actions drop down at the bottom of the form.

Select Launch Pick Release.

Click on Go button.

You will get a popup message. Click on OK button. Close the Shipping Transactions form.

Go to the SRS (Standard Request Submission) form by clicking on View > Requests on the main menu. Query for all the requests.

You will find 3 requests executed,

  1. Pick Selection List Generation
  2. Pick Slip Report
  3. Shipping Exceptions Report

Now the items have been picked. You can check the output of Pick Slip Report. It will look like the following.

                                                                                                Report Date:02-MAR-2013 21:08

                                                            Pick Slip                           Report Page:     1
                                                                                             Pick Slip Page:     1

          Warehouse:125     Medical Devices & Consumables, Dubai

          Pick Slip:1079165                       Pick Batch:35483804
 ----------------------------------------------------------------------------------------------------------------------------------
        Grouping Rule: Default: Order Number
                       ----------------------------------
    Customer:AL AHALI PHARMACY - DXB             Delivery:                                             Order:441726
    Ship to:                                         Stop:                                          Priority:
                                                                                                     Carrier:
                                                                                                Subinventory:
                                                                                                 Requisition:

----------------------------------------------------------------------------------------------------------------------------------

Pick From       Pick To         Pick To
Subinv          Subinv          Location
--------------  --------------  --------------
Buset Bulk      Staging

 Move Order
 --------------

 35483804

                                                                    Tolerance
                                                                        Below
                                                             Tolerance      |
                                   Unit                          Above      |
       Move                        |                                 |      |                   Sales
      Order                        |       Quantity    Quantity      |      |       Sales       Order  Ship
   Line No. Item                   |      Requested     Shipped      |      |       Order    Line No.  Set      Trip     Delivery
    ------- ---------------------  ----   ---------    --------  ----- ------  ----------     -------  ----     -----    ---------
          1 14176 LYNCO CASUAL,    PAR            2                  0      0      441726           1                    103577630
            L600M11

                      Lot Number       From Serial       To Serial         Quantity  Revision       Pick from Location
                      --------------   -----------       ---------    -------------  ----------     ------------------

                      1250469993                                                  2

                                                        ** End of Data **

Tables Affected:
If Autocreate Delivery is set to ‘Yes’ on the “Release Sales Order” form then a new record is created in the table WSH_NEW_DELIVERIES
DELIVERY_ID is populated in the table WSH_DELIVERY_ASSIGNMENTS
The RELEASED_STATUS in WSH_DELIVERY_DETAILS would be now set to ‘Y’ (Pick Confirmed) if Auto Pick Confirm is set to Yes otherwise RELEASED_STATUS is ‘S’ (Release to Warehouse)

Step 4: Pick Confirm

We have to transact a Move Order to confirm picking of the items.

Open the Shipping Transactions form again and query for the order, i.e. 441726.

Now the Line Status has changed to Release to Warehouse and the Next Step is Transact Move Order. Scroll the line to the right.

Note the Move Order Number. It is 35483804. Close the form.

Change the responsibility.

Responsibility: Inventory

Navigation: Move Orders > Transact Move Orders

As we are picking the items from Warehouse, 125, we need to select the organization as 125.

Click OK button and the Transact Move Order form will open for this organization.

Enter the Order Number we had got earlier from the Shipping Transaction form.

Click on Find button.

Now check the line.

Now the Transact button is enabled. Click on Transact button.

Once the transaction is processed a popup is displayed. Click on OK to close the popup. Close the form.

      
Step 5: Ship Confirm

Now open the Shipping Transaction form.

Responsibility: Order Management

Navigation: Shipping > Transactions

Query for the Order, 441726.

Now the Line Status is Staged/Pick Confirmed and Next Step is Ship Confirm/Close Trip Stop. Click on Delivery tab at the bottom.

Change the Actions dropdown to Ship Confirm.

Click on Go button. The Confirm Delivery form opens.

Click on OK button.

A popup message is displayed. Click on OK button.

Now the line status shows Closed. Close the form.

Now go to the SRS form and view the requests. The following requests will have run.

The programs are,

  1. Packing Slip Report
  2. Interface Trip Stop
  3. Bill of Lading (if Create Bill of Lading is checked)

The output of Packing Slip Report is,

Medical Devices & Consumables, Dubai                 Packing Slip                                Date:  02-MAR-13
Draft                                                   482899                                   Page:     1     of      1

Ship From:                                  Ship To:                                     Bill To:
Medical Devices & Consumables, Dubai        AL AHALI PHARMACY - DXB                      AL AHALI PHARMACY - DXB
Gulf Drug Establishment Warehouse 2         NEAR DUBAI HOSPITAL                          NEAR DUBAI HOSPITAL
Rashidiya                                   DEIRA DUBAI                                  DEIRA DUBAI
2                                           DUBAI, U.A.E                                 DUBAI, U.A.E
,  , United Arab Emirates                   TEL:04-2626353   FAX:04-2620453              TEL:04-2626353   FAX:04-2620453
                                            , United Arab Emirates                       ,  , United Arab Emirates

                 Tax Name:                                                         Tax Number:
            Delivery Name: 103577630                                             Pick Up Date: 02-MAR-13
                      FOB:                                                        Ship Method: Van-LTL-Door to Door
            Freight Terms:                                                           Way Bill:
      Reason of Transport:                                                   Service Contract:
                  PO Number                Order Number                            Description
                  ------------             --------------                          -------------
                                           441726                                  14176 LYNCO CASUAL, L600M11

   Lot Number             Grade          Order Line Number UOM     Qty Requested      Qty Shipped
   -----------            -----          ----------------- ---     -------------      -----------
   1250469993                                          1.1 PAR              2.00             2.00
                     Secondary  Qty:                                        0.00             0.00

            Gross Weight:                        PCS     Net Weight:                    PCS     Volume:                       PCS
         External Aspect:
        Additional Information:
           Total Cartons: 0
 Unshipped Details
 -----------------
 Item Number                            Order Number     Line Number Unshipped Qty
 -------------------------------------- ---------------- ----------- -------------

                                *** End Of Report ***

Once the programs complete, the order is shipped.

Tables Affected:
RELEASED_STATUS in WSH_DELIVERY_DETAILS will become ‘C’ (Ship Confirmed)
FLOW_STATUS_CODE in OE_ORDER_HEADERS_ALL will become “BOOKED”
FLOW_STATUS_CODE in OE_ORDER_LINES_ALL will become ”SHIPPED”

Execute the program named, Workflow Background Process from System Administrator responsibility. Enter the parameters,

Process Deferred: Yes

Process Timeout: No

Once the program completes go back to order management responsibility and query for the order in Shipping Transaction form.

Notice that the Line Status shows Interfaced and Next Step is Not Applicable. This means that the order has been fulfilled and the invoice can be raised.

Workflow Background Process inserts the records RA_INTERFACE_LINES_ALL with
INTERFACE_LINE_CONTEXT = “ORDER ENTRY”
INTERFACE_LINE_ATTRIBUTE1 = <<Order number>>
INTERFACE_LINE_ATTRIBUTE3 = <<Delivery id>>

   
Step (iv): Check on hand quantity

Open the On hand Quantity as we did in step (iii).

Click on Availability button.

We see that the quantity has been reduced by 2 as Primary Quantity is 648 (650 -2). Availability to Reserve and Transact are 646 as another order with a quantity of 2 for the same item has been picked from the inventory but not shipped.

  
Step 6: Create Invoice in AR

Go to the Receivables responsibility for the corresponding operating unit.

Navigation: View > Requests

Click on Submit a New Request. Select Single Request.

Enter the program name as Autoinvoice Master Program. Enter the following parameters

Invoice Source: Order Entry

Default Date: <Any date. Normally current date>

Click OK

Click on Submit button.

The programs executed are,

  1. Autoinvoice Master Program
  2. Autoinvoice Import Program

After the programs complete, you can check the output of Autoinvoice Import Program.

GDE SET OF BOOKS                                    AutoInvoice Execution Report                             Date: 02-MAR-2013 22:01
                                                                                                             Page:       1 of      4
             Request Id: 51488875

           Batch Source: Order Entry

  Transaction Flexfield:

       Transaction Type:
Bill To Customer Number:                                          to
  Bill To Customer Name:                                          to
                GL Date:                                          to
              Ship Date:                                          to
     Transaction Number:                                          to
     Sales Order Number:                                          to
       Transaction Date:                                          to
    Ship To Cust Number:                                          to
      Ship To Cust Name:                                          to

Interface Lines:                                 Interface Distributions:

                   Selected:          6                             Selected:          0
     Successfully Processed:          1               Successfully Processed:          0
                   Rejected:          5                             Rejected:          0

Interface Salesreps:                             Interface Contingencies:

                   Selected:          6                             Selected:          0
     Successfully Processed:          1               Successfully Processed:          0
                   Rejected:          5                             Rejected:          0

Transactions Created:

     Currency Name UAE Dirham

                                        Number of     Number of     Number of     Number of     Number of    Invoice Currency
     Class                           Transactions     Lines (*) Sales Credits Distributions Contingencies              Amount
     ------------------------------ ------------- ------------- ------------- ------------- -------------   -----------------
     Invoice                                    1             1             1                           0              257.50
                                    ------------- ------------- ------------- ------------- -------------   -----------------
                                                1             1             1                                          257.50

GDE SET OF BOOKS                                    AutoInvoice Execution Report                             Date: 02-MAR-2013 22:01
                                                                                                             Page:       2 of      4
             Request Id: 51488875

    Grand Totals:

                                        Number of     Number of     Number of     Number of     Number of
     Class                           Transactions     Lines (*) Sales Credits Distributions Contingencies      Invoice Amount
     ------------------------------ ------------- ------------- ------------- ------------- ------------- -------------------
     Invoice                                    1             1             1                                          257.50
                                    ------------- ------------- ------------- ------------- ------------- -------------------
                                                1             1             1                                          257.50

    * Number of Lines includes Tax lines

View the invoice.

Navigation: Transactions > Transactions

Query for the invoice.

Reference: 412726 (This is the order number)

Date: 02-Mar-13

The invoice, 1092025, for the order has been created. This invoice will be paid off with a standard receipt.

Affected Tables:
RA_CUSTOMER_TRX_ALL will have the Invoice header information. The column INTERFACE_HEADER_ATTRIBUTE1 will have the Order Number.
RA_CUSTOMER_TRX_LINES_ALL will have the Invoice lines information. The column INTERFACE_LINE_ATTRIBUTE1 will have the Order Number.

  
Step 7: Create receipt for the invoice

After the invoice is created it is sent to the customer. It could be via email after running the Invoice report or an interface program or via a middleware. The customer receives the invoice and makes a payment.

Responsibility: Receivables Manager

Navigation: Receipts > Receipts

Create the receipt, ALAHALI-001, for the payment

Click on Apply button.

Enter the invoice number in the Apply To field. The Applications form opens.

Click on OK.

Close this form to go back to the Receipts form.

You can now see that the receipt has been applied on the invoice. Click on Tools menu item on the main menu.

Select View Accounting. A new web page opens which shows the accounting.

Click on View Journal Entry

Save and close this form.

  
Step 8: Transfer to General Ledger

After the receipt has been applied to the invoice the details will be transferred to General Ledger and journals will be created.

Responsibility: Receivables

Click on View > Requests. Click on Submit a New Request and the Single Request.

Enter program name, Transfer Journal Entries to GL.

Enter the parameters

Click on OK and submit the request.

We shall now view the journal that has been created in General Ledger.

Responsibility: General Ledger

Navigation: Journals > Enter

Enter the Category as Receipts and Period as Mar-13.

Click on Find.

You have 2 journals. Select the 2nd journal that has debit and credit values as 257.50 and click on Review Journal.

Now you can see the created journal. This journal can now be posted and this amount will reflect in the trial balance report.

   
Step 9: Bank Reconciliation

For this demonstration we do not have a bank file that can be loaded into Oracle and then reconciled for the receipt that was applied on the Invoice. You can check the reconciliation process at the following link. In that article we have reconciled payments for Payables module. In this process we have to reconcile for Receivables module.

Cheers!



How to create a multilingual report in Oracle

$
0
0

Oracle gives a very straightforward method to create multilingual reports if we use XML Publisher to design the reports. We no longer need to create very different report layouts for the same report to be used across languages. Once a language has been installed in addition to the default language, English, then we only need to assign the layout to the language and the characteristics of the language will determine how the output will look like.

I have created a new report below on an Oracle instance where 2 languages are installed, English and Arabic.

Step 1: Check enabled languages

Responsibility: System Administrator

Navigation: Install > Languages

Hit Ctrl+F11 to query for all the records

All the languages are displayed. Now scroll to the right.

You will notice that US English is the base language. This is true for all Oracle Apps installations. Along with English, Arabic (language code AR) in the second line is installed.

You will notice the languages on the Oracle home page.

You can see the option of languages at the bottom as Arabic is installed for this Oracle instance. This means we can have English reports as well as Arabic reports running in this instance.

Step 2: Register a report

We have already created a report named Employee.rdf and have dropped this rdf in $PER_TOP/reports/US in Unix because the concurrent executable is registered in Human Resources application. We shall now register this report to work as a XML Publisher report.

Executable definition

Responsibility: System Administrator

Navigation: Concurrent > Program > Executable

We have created a report named, XXMULTILINGO.

Program definition

We have created concurrent program named, XX Multi-lingual report.

Responsibility: System Administrator

Navigation: Concurrent > Program > Define

No parameters are defined for this report as the rdf does not take any parameter.

Step 3: Attach the report to a request group

Now this report will be attached to a request group so that it can be executed. We will attach the report to a request group named, OM Concurrent Programs, that is attached to the responsibility, Order Management – Medical Eqpt.

Responsibility: System Administrator

Navigation: Security > Responsibility > Request

Save and close the form.

Step 4: Create the Data Definition

We shall now create the data definition of the XML Publisher report with the same name as the concurrent program, i.e. XX Multi-lingual report, and same code, XXMULTILINGO.

Responsibility: XML Publisher Administrator

Navigation: Data Definitions

Step 5: Create the template

We have created 2 rtf templates, 1 for English and 1 for Arabic.

Arabic template (File Name: Arabic template.rtf)

English template (File name: English template.rtf)

Now we will register these templates in Oracle.

Responsibility: XML Publisher Administrator

Navigation: Templates

We created the template with the same name and short name as the concurrent program.

Now we shall add the templates.

Click on Browse to add a template.

We first added the English template and saved the template by clicking on Apply.

Now the English template has been added to this report. We shall now add the Arabic template. Click on Add File button.

The Add file section opens. Add the Arabic template file. Enter Language as Arabic.

Click on Apply button to save the template.

Now you can see that both the templates have been attached to the concurrent program.

Test the report

We shall first test the report in Arabic. To do so we shall log in from the home page by changing the language to Arabic.

After logging in we will have to go to the responsibility Order Management – Medical Equipment. Open the SRS form.

Submit a new request

Enter the program name as XX Multi-lingual report.

Submit the request.

When the program ends, check the output.

The MS word template allowed us to enter Arabic but the XML Publisher engine does not have the same font and therefore the Arabic letters could not be displayed properly and are being displayed as question marks (???). Note that the data is now right justified.

Now log out of Oracle and change the language to English on the home page. Go to the same responsibility and run the report. You will get the output as the following,

Appendix:

Suppose we used the same template for Arabic that we have used for English (the file named English template.rtf used above), the output will look like the following,

Note that the order of the columns has been reversed. In English the column order was Employee #, Title, Name. Since Arabic is right justified and the order of writing is from right to left the same order is now from right to left.

Cheers!


How to invoke Flexfield form to enter GL accounts as parameters in a report

$
0
0

We have seen in seeded GL reports that take the accounting flexfield as parameters, the DFF form opens on the SRS form when we click on the flexfield parameter. The user enters the flexfield into the form. The flexfield is then transferred into the report and the output is generated. This is a very handy way of allowing the user to enter the Accounting KFF.

I have created a custom report to allow the same functionality on its form parameters. The report will take the accounting flexfield data as input in the same way.

Step 1: Define the parameters of the new report

We shall start by creating a new report, XX_PARAM.rdf. First we shall declare the required user parameters of the report.

We need to add the following 4 parameters

User Parameter Name Parameter Data Type Width Initial Value
P_CONC_REQUEST_ID NUMBER 15 0
P_FLEX_HIGH Character 1000  
P_FLEX_LOW Character 1000  
P_STRUCT_NUM Character 15  

After defining the user parameters the report will look like thefollowing,

   
Step 2: Define the data model

We shall define the data model with the following query.

select gcc.concatenated_segments,
glb.period_net_dr, glb.period_net_cr from gl_balances glb, gl_code_combinations_kfv gcc
where glb.code_combination_id = gcc.code_combination_id
and glb.actual_flag = 'A'
and glb.period_name = <period name parameter>
and glb.currency_code = <currency code parameter>
and glb.chart_of_accounts_id = <chart of accounts parameter>

We see that the WHERE clause of the query is being decided by three parameters. Therefore it is better to set a lexical parameter to create a dynamic WHERE clause. This is required so that the WHERE clause is generated based on whether a parameter is entered by the user or not.

Now we will modify the query to use a lexical parameter named, WHERE_CLAUSE. The query will become,

select gcc.concatenated_segments,
glb.period_net_dr, glb.period_net_cr from gl_balances glb, gl_code_combinations_kfv gcc
where glb.code_combination_id = gcc.code_combination_id
and glb.actual_flag = 'A'
&WHERE_CLAUSE

In reports builder data model,

Press OK button. You will get the following message,

The data model will look like the following,

On the User Parameters it looks like this,

As we shall be using 3 more parameters, PERIOD_NAME, CURRENCY_CODE and CHART_OF_ACCOUNTS_ID, (to generate the WHERE clause) we shall add these parameters in the User Parameters section.

User Parameter Name Parameter Data Type Width Initial Value
P_PERIOD_NAME Character 15  
P_CURRENCY_CODE Character 10  
P_CHART_OF_ACCOUNTS_ID Number 10  

After the parameters are created the user parameter list will look like the following,

Now double click on the lexical parameter WHERE_CLAUSE (this parameter has been created from the query). The Datatype is set automatically to Character. Change the Width of the parameter to 4000.

Important:
If the width is not set to 4000 we shall get run time error in the report log file as given below,

APP-FND-01618: Column :WHERE_CLAUSE not found

Cause: The column :WHERE_CLAUSE could not be found.

Action: Check your report to make sure this column exists. Contact your support representative.

APP-FND-01238: Cannot set value for field :WHERE_CLAUSE.

.
APP-FND-01618: Column :WHERE_CLAUSE not found

Save and compile the rdf in reports builder to check for syntax errors.

   
Step 3: Add code in BEFORE REPORT trigger

Now open the BEFORE REPORT trigger. Enter the trigger code as given below,

function BeforeReport return boolean is
begin
  srw.user_exit('FND SRWINIT');

	-- Set the check on the accounts from the accounting flexfield
  srw.reference( :P _STRUCT_NUM );
  srw.reference( :P _FLEX_LOW );
  srw.reference( :P _FLEX_HIGH );
  srw.user_exit( 'FND FLEXSQL
                  CODE = "GL#"
                  NUM = ":P_STRUCT_NUM"
                  APPL_SHORT_NAME = "SQLGL"
                  OUTPUT = ":WHERE_CLAUSE"
                  TABLEALIAS="GCC"
                  MODE = "WHERE"
                  DISPLAY = "ALL"
                  OPERATOR = "BETWEEN"
                  OPERAND1=":P_FLEX_LOW"
                  OPERAND2=":P_FLEX_HIGH"' );

	srw.message(01, 'WHERE clause is: '||:WHERE_CLAUSE);

	-- Set the WHERE_CLAUSE lexical parameter
/*
	IF :P _PERIOD_NAME IS NOT NULL THEN
		:WHERE_CLAUSE := :WHERE_CLAUSE||' AND glb.period_name = '''||:P_PERIOD_NAME||'''';
	END IF;

	IF :P _CURRENCY_CODE IS NOT NULL THEN
		:WHERE_CLAUSE := :WHERE_CLAUSE||' AND glb.currency_code = '''||:P_CURRENCY_CODE||'''';
	END IF;

	IF :P _CHART_OF_ACCOUNTS_ID IS NOT NULL THEN
		:WHERE_CLAUSE := :WHERE_CLAUSE||' AND glb.chart_of_accounts_id = '||:P_CHART_OF_ACCOUNTS_ID;
	END IF;
*/

  return (TRUE);
end;

In the code above we are calling the USER EXITS,

SRW INIT

FND FLEXSQL

Note:
We are setting the value of the report parameters, P_STRUCT_NUM, P_FLEX_LOW, P_FLEX_HIGH and then creating a dynamic WHERE clause from the report parameters. We have commented out the section where we dynamically set the where clause as per the other parameters entered by the user for this example.

To get more information on the user exists used in the code you can go to the following URL.

Also add the following user exit in AFTER REPORT trigger,

srw.user_exit(‘FND SRWEXIT’);

The trigger code becomes,

function AfterReport return boolean is
begin
  srw.user_exit('FND SRWEXIT');
  return (TRUE);
end;

Now save, compile and transfer the rdf file in binary format to $GL_TOP on the application server. We are keeping the file in $GL_TOP for this example. The rdf file should be located under the custom top as it is a custom report.

   
Step 4: Create the concurrent program

Log in to Oracle Apps with System Administrator responsibility.

Navigation: Concurrent > Program > Executable

Enter the details as shown below

Save the form and close it. We have created the concurrent executable name as XX_PARAM. Then open the concurrent program form.

Navigation: Concurrent > Program > Define

Enter the details on this form as shown,

Save the form and click on Parameters button.

We shall enter the parameter details now. There will be 6 (we shall not create a parameter for P_CONC_REQUEST_ID) parameters for the report (3 defined in Step 1 and 3 defined in Step 2)

Parameter 1: P_STRUCT_NUM

Seq: 10

Parameter: Chart of Accounts ID

Value Set: GL_SRS_COA_UNVALIDATED

Default Type: SQL Statement

Default Value: SELECT chart_of_accounts_id FROM gl_access_sets WHERE access_set_id=:$PROFILES$.GL_ACCESS_SET_ID

Required: <Checked>

Display: <Unchecked>

Token: P_STRUCT_NUM

Parameter 2: P_FLEX_LOW

Seq: 20

Parameter: Account From

Value Set: GL_SRS_LEDGER_FLEXFIELD

Required: <Checked>

Description Size: 240

Concatenated Description Size: 240

Token: P_FLEX_LOW

Parameter 3: P_FLEX_HIGH

Seq: 30

Parameter: Account To

Value Set: GL_SRS_LEDGER_FLEXFIELD

Required: <Checked>

Description Size: 240

Concatenated Description Size: 240

Token: P_FLEX_HIGH

Parameter 4: P_PERIOD_NAME

Seq: 40

Parameter: Period

Value Set: 10 Characters

Token: P_PERIOD_NAME

Parameter 5: P_CURRENCY_CODE

Seq:540

Parameter: Currency Code

Value Set: 10 Characters

Token: P_PERIOD_NAME

Save the form. You might get an error like the following,

Click on Details button.

The message is because we have used a LOV of type Pair. This means that we cannot call this concurrent program from an OAF page, in case we thought of calling the program as we have in this article. We can click on OK and ignore this message as we shall submit the concurrent program from the SRS form.

Close the concurrent program form. We have now registered our concurrent program, XX Account Balance Report.

  
Step 5: Add the concurrent program to the request set

We shall execute the concurrent program from a General Ledger responsibility named, General Ledger Super User GDE. Let us check the name of the request set attached to this responsibility.

Responsibility: System Administrator

Navigation: Security > Responsibility > Define

Query for the responsibility, General Ledger Super User GDE.

We see that the Request Group name is GL Concurrent Program Group. Close this form.

Navigation: Security > Responsibility > Group

Query for group named, GL Concurrent Program Group.

Add the concurrent program we have created, i.e. XX Account Balance Report.

Save and close the form.

  
Test the concurrent program

Log into General Ledger Super User GDE responsibility. Go to View > Requests to execute a concurrent program.

Enter the concurrent program name, XX Account Balance report.

The parameter screen opens

The KFF form opens as Account From field is the first parameter. We can enter the accounts in the KFF form as parameters.

Click on OK and submit the concurrent program. Check the program in the SRS form.

We are not going to check the output of the concurrent program as we have not created a layout of the report as this is not essential for this article.

We are more interested to know what the log file looks like, as we had logged the WHERE_CLAUSE value into the log file. Click on View Log button.

+—————————————————————————+
General Ledger: Version : 12.0.0

Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.

XX_PARAM module: XX Account Balance report
+—————————————————————————+

Current system time is 19-MAR-2013 17:18:35

+—————————————————————————+

+—————————–
| Starting concurrent program execution…
+—————————–

Arguments
————
P_STRUCT_NUM=’101′
P_FLEX_LOW=’001.0000.000000.00000.00000′
P_FLEX_HIGH=’001.ZZZZ.ZZZZZZ.ZZZZZ.ZZZZZ’
————

APPLLCSP Environment Variable set to :

Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
American_America.UTF8

‘.,’

Enter Password:
MSG-00001: WHERE clause is: GCC.SEGMENT1 = ’001′ AND GCC.SEGMENT2 BETWEEN ’0000′ AND ‘ZZZZ’ AND GCC.SEGMENT3 BETWEEN ’000000′ AND ‘ZZZZZZ’ AND GCC.SEGMENT4 BETWEEN ’00000′ AND ‘ZZZZZ’ AND GCC.SEGMENT5 BETWEEN ’00000′ AND ‘ZZZZZ’

Report Builder: Release 10.1.2.3.0 – Production on Tue Mar 19 17:18:36 2013

Copyright (c) 1982, 2005, Oracle. All rights reserved.

+—————————————————————————+
Start of log messages from FND_FILE
+—————————————————————————+
+—————————————————————————+
End of log messages from FND_FILE
+—————————————————————————+

+—————————————————————————+
Executing request completion options…

+————- 1) PRINT ————-+

Printing output file.
Request ID : 51513943
Number of copies : 0
Printer : noprint

+————————————–+

Finished executing request completion options.

+—————————————————————————+
Concurrent request completed successfully
Current system time is 19-MAR-2013 17:18:38

+—————————————————————————+

The log file clearly shows that the WHERE clause generated for the accounts is the following,

GCC.SEGMENT1 = ’001′ AND GCC.SEGMENT2 BETWEEN ’0000′ AND ‘ZZZZ’ AND GCC.SEGMENT3 BETWEEN ’000000′ AND ‘ZZZZZZ’ AND GCC.SEGMENT4 BETWEEN ’00000′ AND ‘ZZZZZ’ AND GCC.SEGMENT5 BETWEEN ’00000′ AND ‘ZZZZZ’

This will be appended to the query as you have set it up.

    
Appendix:

If you are interested in the seeded LOVs which called the KFF form you can view the details in the LOV form.

Open the LOV named GL_SRS_LEDGER_FLEXFIELD.

Click on Edit Information button.

The KFF form is invoked from these functions in the LOV.

Cheers!


SQL to list all form personalizations in Oracle

$
0
0

The following query will provide the dump of all form personalizations in Oracle.

SELECT ffcr.function_name, ffcr.form_name, ffcr.SEQUENCE "P Seq", ffcr.enabled "Rule Enabled?", ffcr.fire_in_enter_query, ffcr.rule_type,
       ffcr.description "Rule Description", ffcr.trigger_event, ffcr.condition, ffca.SEQUENCE "Action sequence",
       DECODE (ffca.action_type,
               'P', 'Property',
               'M', 'Message',
               'S', 'Menu',
               'B', 'Builtin'
              ) "Action Type", ffca.summary " Action Desc", ffca.enabled "Action Enabled?", ffca.object_type, ffca.target_object, ffca.property_value,
       DECODE (ffca.MESSAGE_TYPE,
               'W', 'Warn',
               'H', 'Hint',
               'E', 'Error',
               'D', 'Debug',
               'S', 'Show',
               NULL
              ) "Message Type",
decode(ffca.builtin_type, 'G', 'Go Item', 'C', 'Launch SRS Form', 'E', 'Launch a Function', 'U', 'Launch a URL', 'D', 'Do Key',
'P', 'Execute a Procedure', 'B', 'GO_BLOCK', 'F', 'FORMS_DDL', 'R', 'RAISE_FORM_TRIGGER_FAILURE', 'T', 'EXECUTE_TRIGGER', 'S', 'SYNCHRONIZE',
'L', 'Call Custom Library', 'Q', 'Create Record Group from Query', 'X', 'Set Profile Value in Cache', NULL) "Builtin Type",
              ffca.builtin_arguments, ffca.property_name, ffca.menu_entry, ffca.menu_label, ffca.menu_seperator,
       ffca.menu_enabled_in, ffca.menu_argument_long, ffca.menu_argument_short
  FROM fnd_form_custom_rules ffcr, fnd_form_custom_actions ffca
WHERE ffcr.ID = ffca.rule_id

Cheers!


How to display error messages on an OAF page using a URL

$
0
0

You can display an error on an OAF page by calling the standard JSP page, fnderror.jsp. if you open a web browser and type in the URL,

http://<App server>:/OA_HTML/jsp/fnd/fnderror.jsp?text=<word1+word2+wor< body=”">d3+….+WordN> then an error message will be displayed on the OAF page. This works even if you are not logged into Oracle. The page, fnderror.jsp, takes in the text as input and displays it on the browser.

Suppose we would like to display the message, “This is not a correct procedure. Please contact Abhijit Ray” then our URL is going to look like the following,

http://<App server>:/OA_HTML/jsp/fnd/fnderror.jsp?text= This+ is+not+a+correct+procedure.+ Please+contact+Abhijit+Ray

Now copy and paste it on the browser and it will look like the following,

This process can be used to throw out error messages to the user.

Cheers!


Login error in Oracle Apps r12

$
0
0

I have got a strange kind of error when I tried to login to a freshly cloned r12 instance. The version of Oracle was 12.1.3

Entered the user name and password

Pressed Login button and got the following error


The error is strange, “You are not authorized to access the function Transfer Process Process Migrate. Please contact your System Administrator”

If I close the browser and again try to go to the Oracle login page I would come back to the same error until the session has timed out. This is based on the session time out profile value set in Oracle.

I found out the way to work around the error is note the actual page URL that the browser should be taking me to. The URL will be,

http://<apps link>:<port>/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE

Now, on the error page paste the URL in the address bar and you will be taken to the Oracle home page.

Cause for this error

The apps URL was originally saved in the web browser favourites as,

http://uxitcl1b.com:8010/OA_HTML/RF.jsp?function_id=1024773&resp_id=-1&resp_appl_id=-1&security_group_id=0&lang_code=US&params=BbXnXbfUXCvU05mSO.nQVVsNLylo-g4Lz-AHKzt5t9PPjPQfHIIAbmmpSde0VQ3V.uCO9jcGtmeup7UEUfs4DAVDUGegHdO43ruUg.SQkBjW1b8WPp6osRGBCJ9O4YyaYgI1G6PHhAb3WoKOfjWvOrRoA0GW0d6bhmpuoFZ0hKdQgYkhy9tJI.s.7jLizb3PF-res4tLun01HNiZBeh0GQOMLUZV7ZwZuA88-7rU6enifZcae4Ncrq.9La2KFsaFZ-iWN4s4NdsHa7L-fDkdWnA1OvbdfuhFC6rAZ5DczRjsfIpL-R3jdj2QGWHCiY91UUL9sYGOUVhpx1tcBFyWt1zlYx7irGzzimxEHKb91A6NViWzR9bB-vgxnmYYGhUu-jPEaOSRQzcIS33rkKWFqia9UQhEDhPx4-.QSq813yJpr8iFXeE8iiFuPoUqA-ih&oas=FzpsgOBCs8xgjrVDLBecHw..

The URL is saved like this because when we type the basic URL for Oracle, i.e. http://oracleappslink:<port>/ it automatically redirects the browser to the home page which is the link above and we save the same URL in the web browser favourites.

Once the instance was cloned from a different instance accessing it through the same link created this issue.

Solution

  1. Type in the URL http://<apps link>:<port>/OA_HTML/OA.jsp?OAFunc=OAHOMEPAGE
    after getting the error
  2. After Oracle is cloned, access Oracle using the default URL of http://oracleappslink:<port>/ and save the redirected URL in the web browser favourites once again.

Cheers!


How to get access to AME configurations

$
0
0

For working on AME or Approval Management we would need access to the responsibility, Approvals Management Business Analyst. In this responsibility we can configure the different approval hierarchy for each transaction. If we provide the responsibility to a user the user might not get access to AME. This is because the user might not have the privileges to access AME functions.

We have created a user in Oracle, JDOE, and given this user the System Administrator responsibilities.

We will add the responsibility, Approvals Management Business Analyst.

As Approvals Management Business Analyst is a self service responsibility, we will click on this responsibility from the Oracle home page.

On clicking Oracle displays a message saying “There are no functions available for this responsibility”. This is because user JDOE does not have privileges to access AME functions.

How do we provide the user with AME functions?

Step 1: Assign AME roles

Log in to Oracle as SYSADMIN user or any other user that has SYSADMIN privileges/role. In this case let us assign user JDOE with AME and SYSADMIN role.

The list of responsibilities are displayed

Click on the responsibility named, User Management.

Click on Users function.

Enter the user name as JDOE and press Go button.

Click on the Update button next to the user.

First we shall assign AME roles to the JDOE. Click on Assign Roles button and the popup window to select roles will open.

Type in Roles and Responsibilities as Approval% and click on Go

We will check all the roles except for Approvals Management System Viewer as it is a view only role for AME. After checking the boxes click on Select button and you will be taken back to the User Management responsibility.

Enter the justification for each of the roles you have just added

Click on Apply button

You will get a confirmation message. Once the Workflow Background Engine program has run the roles will be assigned to the user.

Now we shall assign SYSADMIN privileges to JDOE user. You need to through the same steps as we have gone through to add the AME privilege. Only the role this time will be different. The role that will be added is, Security Administrator. The search screen is shown below.

After accessing the roles log out of Oracle.

Step 2: Grant Transaction Type Access

Log in to Oracle as SYSADMIN user. Check the responsibilities.


Click on Functional Administrator responsibility

The Grants page opens by default. Click on Create Grant button

We shall create a new grant with the following information.

The grant entries will be,

Name: AME access for JDOE

Grantee Type: All Users

Grantee: <The user who wishes to get AME access>

Object: AME Transaction Types

Click on Next

Keep Data Context Type as All Rows and click on Next.

Enter Set as AME Calling Applications and click on Next

On the next page you can review the data you had entered. Now click on Finish and you will be taken to Grants page.

Now you can see the confirmation message from Oracle. Hence the grant has been created successfully. Log out of Oracle.


Test AME responsibility

Log in to Oracle as JDOE user

Notice the responsibilities attached to JDOE user. We had only assigned Approvals Management Business Analyst from the User form after creating the user. Now we have 2 responsibilities added automatically because we added the roles in step 1.

  1. Approvals Management Administrator responsibility added for Approvals Management Administrator role
  2. User Management responsibility added for Security Administrator role.

Click on Approvals Management Business Analyst responsibility

The responsibility now opens as the user has full access to the AME roles (from Step 1) and has the grants on AME transactions (Step 2).

Cheers!


How to trace a form/session in Oracle Apps

$
0
0

We are getting the following error in Oracle when we are trying to cancel a PO.

We need to find out the code running behind the scenes to identify the issue. We need to generate a trace file and check that file.

Method 1: Generate debug log file

Step 1: Set profile option values

Set the following profile options on the User level so that it does not affect the entire application.

Profile Option Name Value Description
FND: Debug Log Enabled Yes Trace will be enabled at that level. In our case it is on the user, SA1, level.
FND: Debug Log Filename for Middle-Tier /usr/tmp/PO_ERROR.trc The file path and file name is set. The file path should be a valid path accessible to Oracle on the middle tier.
FND: Debug Log Level Statement

The kind of tracing. Options are

  1. Statement
  2. Procedure
  3. Event
  4. Exception
  5. Error
  6. Unexpected
FND: Debug Log Module % For all modules

Responsibility: System Administrator

Navigation: Profile > System

Query for User = SA1 and Profile = FND%LOG%

Click on Find and change the values on user level.

Execute the query

select max(log_sequence) from fnd_log_messages

Note the number, i.e. 384854630

Step 2: Reproduce the error

Recreate the error in Oracle Apps

Execute the query

select * from fnd_log_messages

where log_sequence > 34854630 – Max seq num from query of Step 2

and module like ‘%’

order by log_sequence

Step 3: Check the log file

Log in to the middle tier operating system and go to the path set in the profile option name, FND: Debug Log Filename for Middle-Tier. We have set the value to /usr/tmp/PO_ERROR.trc. let us go to /usr/tmp directory

$ cd /usr/tmp

Now check for the trace file, PO_ERROR.trc

$ ls –l PO_ERROR.trc

Open the trace file and review

$ view PO_ERROR.trc

You can go through the file and analyse the issue.

Method 2: Generate session level trace

Step 1: Enable trace

Open the form and reach the point from which you want to enable trace and generate the file. Click on Help > Diagnostics > Trace > Regular Trace on the menu.

Once trace is enabled Oracle will give a popup message with the trace file name and location and mentioning that trace has been enabled.

Note the file name. It is DEV_ora_22141_SA1.trc. The location is the same as the value that you get from running the following query,

select * from v$parameter where name = ‘user_dump_dest’

Step 2: Replicate the error

Now you need to recreate the error in Oracle Apps.

Step 3: Turn off trace

We shall turn off trace or else every action we take on this session after the error will also be added into the trace file.

Click on Help > Diagnostics > Trace > No Trace

Now you will again get a popup message saying that tracing is disabled.

Step 4: Review the trace file

Let us go to the trace directory on the middle tier or application server.

$ cd /d02/oraprod/proddb/11.2.0/admin/DEV_eyerpqa/diag/rdbms/dev/DEV/trace

Search for the trace file

$ ls –ltr DEV_ora_22141_SA1.trc

Now that we know that the trace file has been generated, we shall view the file

$ view DEV_ora_22141_SA1.trc

The file is as follows,

Close the file. We shall generate a TKPROF output so that the file can be easily read.

Step 5: Generate TKPROF output

On the command prompt type in

$ tkprof DEV_ora_22141_SA1.trc output.tkp

Open the generated file, output.tkp

$ view output.tkp

Now it is a lot easier to identify all the SQLs in the trace file than the trace file.

The difference between the 2 methods

Method 1 Method 2
The calls to the procedure or form level triggers are logged Only the executed SQLs are logged
Only application code is logged Database/System level SQLs are also logged
The trace file path, file name, logging level have to be set by the administrator The trace file path and name are preset by Oracle

You can now decide for yourself what kind of trace you need and work accordingly.

Cheers!



Bounce Oracle Mobile server in Apps

$
0
0

The steps to bounce the Oracle Mobile server is given below.

Start Oracle Mobile server

$INST_TOP/admin/scripts/mwactl.sh start 10260

We are assuming that the mobile server runs only on 1 port. If the server ran on say 2 ports, 10260 & 10261 then we would have had to run

mwactl.sh start 10260

mwactl.sh start 10261


Stop Oracle Mobile server

$INST_TOP/admin/scripts/mwactl.sh -login apps_user/apps_password stop 10260

$INST_TOP/admin/scripts/mwactlwrpr.sh stop apps/<apps pwd>


Check running mwa processes

$ps –ef | grep mwa


Find the port number for mobile services

$grep mwa $CONTEXT_FILE

Connect to Mobile Services

telnet hostname.domainname portnumber

$ telnet uxitcl1b 10260

We have discussed how to bounce the Oracle web server in another article.

Cheers!


Security Profile usage in Oracle HRMS

$
0
0

The security profile determines which applicant, employee, contingent worker and other person type records are available to holders of the responsibility the profile is linked to.

This is a very effective way of restricting access to employee records on responsibilities/users. The security profile determines which applicant, employee, contingent worker and other person type records are available to holders of the responsibility the profile is linked to.

If you are using HRMS Standard security, you link a security profile to one responsibility using the HR:Security Profile profile option.

If you are using Security Groups Enabled security, you link a security profile to the user’s responsibility and business group using the Assign Security Profile window. You can also link more than one security profile to a responsibility, as long as the user is different. This saves you setting up a new responsibility for each security profile you use.

Note: If you are using the Security Groups Enabled security model you must not use the HR:Security Profile profile option. This is automatically set up when you assign security profiles using the Assign Security Profile window.

Here is how security profile is created and used.

Step 1: Create a security profile

Responsibility: Global HRMS Manager

Navigation: Security > Profile

By default Oracle provides a security profile named, Setup Business Group.

Note: Setup Business Group is also a business group given by Oracle to allow us to install business groups. This is because business groups are created in HRMS responsibilities and a HRMS responsibility cannot exist without being assigned to a business group. Therefore the default HR responsibility, Global HRMS Manager, is assigned a business group, Setup Business Group, and the same security profile until it is changed.

We shall create security profile as shown below

Save and close the form

Step 2: Assign the security profile to the responsibility

Responsibility: System Administrator

Navigation: Profile > System

Query for profile options,

HR: Security Profile

HR:User Type         – This profile option is optional

HR:Business Group     – Business group of the responsibility

Important:

  1. The business groups in the profile option, HR:Business Group, and the Security Profile should match else we shall get the following error.

  1. When Standard HRMS Security is used you will get the following error when trying to access the Assign Security Profiles form from the menu.

Important notes from Oracle:

Restricting Access to Records

You set up a security profile by identifying records of employees, applicants, contingent workers, and candidates in the system which you want users to be able to access. You identify the records by selecting work structures or other criteria in the application to which employees, applicants, contingent workers, or candidates are attached. For example, you could give users access only to the records of employees, applicants, contingent workers, or candidates in a single organization.

You can also create restrictions on records with a person type of “Other“. This includes contacts for employees or applicants, and any other people with a person type in the category of “Other“. You do this using the “View Contacts” option.

You can combine different types of restriction to create a set of rules giving exactly the security access permissions you require.

When you create a business group a view-all security profile is automatically created. This has the same name as the business group. The security profile provides access to all employee, contingent worker, and
applicant records in the business group. The system administrator links this view-all profile to users who are setting up the system. They in turn can set up security for other users.

The criteria you can use to identify records are:

  • Internal organizations and organization hierarchies
  • Positions and position hierarchies
  • Payrolls
  • Supervisors and supervisor hierarchies
  • Custom restrictions
  • Assignments

Tip: Oracle recommends that you use either a supervisor or position hierarchy for Self-Service Human Resources (SSHR).

Cheers!


Bounce concurrent managers in Apps

$
0
0

In a previous article I had discussed how to bounce Apache/Web server on Oracle. In this article I have discussed how concurrent managers are bounced.

Check the running concurrent managers from the front end

Responsibility: System Administrator

Navigation: Concurrent > Manager > Administrator

You can see that the concurrent managers are running. You can individually stop the managers from this form by selecting the concurrent manager and clicking on Deactivate. If you do so, Oracle will spawn the concurrent program, Deactivate All Managers (Deactivate), to stop the individual manager.

To activate an individual manager you need to select the manager and click on Activate (the deactivate button changes to Activate when the manager is deactivated). Once the Activate button is clicked it spawns the concurrent program, Activate Cost Worker Manager (Activate).

To bounce all the running concurrent managers together we need to run an admin script from Unix.

Log into Unix.

Go to the admin scripts directory

$cd $INST_TOP/admin/scripts

Execute the script adcmctl.sh in stop mode to stop all the running concurrent managers.

Enter adcmctl.sh stop


Enter the apps user name and password


The script output shows that all running concurrent managers are being shut down.

Now check the concurrent managers in Apps

You will notice that the managers are deactivated.

We shall now start the managers. Execute the script adcmctl.sh in start mode

$adcmctl.sh start

Enter apps database user name and password

The script gives the output that the managers have been started.

Now let’s check the managers from the front end.

We see that the managers have been activated.

Cheers!


How to debug and trace XML Bursting program

$
0
0

XML bursting program has run successfully several times but have not given the output via email or print or the appropriate delivery option. It was very difficult to figure out the problem as I needed to trace the issue. The program can be traced in the following way.

Step 1: Create a new file xdodebug.cfg

The file content is as follows,

LogLevel=STATEMENT
LogDir=/erpdev3_app/apps/dev3/apps/apps_st/appl/xdo/12.0.0/resource/temp

The value for LogDir is the directory in which the temporary debug files will be generated for analysing after running XML bursting. Ensure that this directory exists else you will get error in Step 2.


Step 2: Execute bursting

Execute XML Publisher Bursting Program. Ensure that DebugFlag is set to yes.

After the program completes check the log file.

The log file is very detailed as we have passed DebugFlag=Yes,

+---------------------------------------------------------------------------+
XML Publisher: Version : 12.0.0

Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.

XDOBURSTREP module: XML Publisher Report Bursting Program
+---------------------------------------------------------------------------+

Current system time is 29-AUG-2013 09:15:32

+---------------------------------------------------------------------------+

XML/BI Publisher Version : 5.6.3
Request ID: 57546216
All Parameters: Dummy for Data Security=Y:ReportRequestID=57546199:DebugFlag=Y
Report Req ID: 57546199
Debug Flag: Y
Updating request description
Updated description
Retrieving XML request information
Node Name:UXITCL1B
Preparing parameters
null output =/erpdev3_app/apps/dev3/inst/apps/dev3_uxitcl1b/logs/appl/conc/out/o57546216.out
inputfilename =/erpdev3_app/apps/dev3/inst/apps/dev3_uxitcl1b/logs/appl/conc/out/o57546199.out
Data XML File:/erpdev3_app/apps/dev3/inst/apps/dev3_uxitcl1b/logs/appl/conc/out/o57546199.out
Set Bursting parameters..
Bursting propertes.....
{user-variable:cp:territory=US, user-variable:cp:ReportRequestID=57546199, user-variable:cp:language=en, user-variable:cp:responsibility=20420, user-variable.OA_MEDIA=http://uxitcl1b.na.fellowes.com:8012/OA_MEDIA, burstng-source=EBS, user-variable:cp:DebugFlag=Y, user-variable:cp:parent_request_id=57546199, user-variable:cp:locale=en-US, user-variable:cp:user=ARAY, user-variable:cp:application_short_name=XDO, user-variable:cp:request_id=57546216, user-variable:cp:org_id=52, user-variable:cp:reportdescription=XX Employee Detail, user-variable:cp:Dummy for Data Security=Y}
Start bursting process..
[082913_091541769][][STATEMENT] /usr/tmp
[082913_091541778][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:territory : value=>US
[082913_091541779][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:ReportRequestID : value=>57546199
[082913_091541779][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:language : value=>en
[082913_091541779][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:responsibility : value=>20420
[082913_091541779][][STATEMENT] BurstingProcessor:Property Key=>user-variable.OA_MEDIA : value=>http://uxitcl1b.na.fellowes.com:8012/OA_MEDIA
[082913_091541779][][STATEMENT] BurstingProcessor:Property Key=>burstng-source : value=>EBS
[082913_091541779][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:DebugFlag : value=>Y
[082913_091541780][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:locale : value=>en-US
[082913_091541780][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:parent_request_id : value=>57546199
[082913_091541780][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:user : value=>ARAY
[082913_091541780][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:application_short_name : value=>XDO
[082913_091541780][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:request_id : value=>57546216
[082913_091541780][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:org_id : value=>52
[082913_091541781][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:Dummy for Data Security : value=>Y
[082913_091541781][][STATEMENT] BurstingProcessor:Property Key=>user-variable:cp:reportdescription : value=>XX Employee Detail
[082913_091541781][][STATEMENT] Inside burstingConfigParser
[082913_091541786][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: startDocument is entered <========================
[082913_091541796][][STATEMENT] ATTR_TEMPLATE_FIELD_ALIAS:null
[082913_091541874][oracle.apps.xdo.batch.BurstingProcessorEngine][STATEMENT] ========================> startElement() ::: startDocument is entered <========================
[082913_091541879][][STATEMENT] Template Location:/usr/tmp/XXEMPDET.rtf
[082913_091541881][][STATEMENT] template File/usr/tmp/XXEMPDET.rtf
[082913_091541891][][STATEMENT] Logger.init(): *** DEBUG MODE IS ON. ***
[082913_091541892][][STATEMENT] Logger.init(): LogDir=/erpdev3_app/apps/dev3/apps/apps_st/appl/xdo/12.0.0/resource/temp
[082913_091542411][][STATEMENT] [ PDF GENERATOR ]---------------------------------------------
[082913_091542411][][STATEMENT] XDO version   = Oracle XML Publisher 5.6.3
[082913_091542412][][STATEMENT] java.home     = /erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre
[082913_091542412][][STATEMENT] XDO_TOP       = /erpdev3_app/apps/dev3/apps/apps_st/appl/xdo/12.0.0/
[082913_091542412][][STATEMENT] Config Path   = null
[082913_091542413][][STATEMENT] Debug Cfg Path= /erpdev3_app/apps/dev3/apps/apps_st/appl/xdo/12.0.0/resource/xdodebug.cfg
[082913_091542413][][STATEMENT] Font dir      = /erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/
[082913_091542414][][STATEMENT] Locale        = en
[082913_091542414][][STATEMENT] Fallback font = type1.Helvetica
[082913_091542414][][STATEMENT] [ PDF GENERATOR PROPERTIES ]----------------------------------
[082913_091542416][][STATEMENT] digit-substitution=null(not set)
[082913_091542417][][STATEMENT] font.ALBANY WT J.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ALBANWTJ.ttf
[082913_091542417][][STATEMENT] font.ALBANY WT K.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ALBANWTK.ttf
[082913_091542417][][STATEMENT] font.ALBANY WT SC.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ALBANWTS.ttf
[082913_091542418][][STATEMENT] font.ALBANY WT TC.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ALBANWTT.ttf
[082913_091542418][][STATEMENT] font.ALBANY WT.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ALBANYWT.ttf
[082913_091542419][][STATEMENT] font.ANDALE DUOSPACE WT J.normal.bold=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUOJB.ttf
[082913_091542419][][STATEMENT] font.ANDALE DUOSPACE WT J.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUOJ.ttf
[082913_091542419][][STATEMENT] font.ANDALE DUOSPACE WT K.normal.bold=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUOKB.ttf
[082913_091542420][][STATEMENT] font.ANDALE DUOSPACE WT K.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUOK.ttf
[082913_091542420][][STATEMENT] font.ANDALE DUOSPACE WT SC.normal.bold=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUOSCB.ttf
[082913_091542420][][STATEMENT] font.ANDALE DUOSPACE WT SC.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUOSC.ttf
[082913_091542421][][STATEMENT] font.ANDALE DUOSPACE WT TC.normal.bold=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUOTCB.ttf
[082913_091542421][][STATEMENT] font.ANDALE DUOSPACE WT TC.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUOTC.ttf
[082913_091542421][][STATEMENT] font.ANDALE DUOSPACE WT.normal.bold=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUOB.ttf
[082913_091542422][][STATEMENT] font.ANDALE DUOSPACE WT.normal.normal=truetype./erpdev3_app/apps/dev3/apps/tech_st/10.1.3/appsutil/jdk/jre/lib/fonts/ADUO.ttf
[082913_091542422][][STATEMENT] font.CG TIMES.italic.bold=type1.Times-BoldItalic
[082913_091542422][][STATEMENT] font.CG TIMES.italic.normal=type1.Times-Italic
[082913_091542423][][STATEMENT] font.CG TIMES.normal.bold=type1.Times-Bold
[082913_091542423][][STATEMENT] font.CG TIMES.normal.normal=type1.Times-Roman
[082913_091542423][][STATEMENT] font.COURIER NEW.italic.bold=type1.Courier-BoldOblique
[082913_091542424][][STATEMENT] font.COURIER NEW.italic.normal=type1.Courier-Oblique
[082913_091542424][][STATEMENT] font.COURIER NEW.normal.bold=type1.Courier-Bold
[082913_091542425][][STATEMENT] font.COURIER NEW.normal.normal=type1.Courier
[082913_091542425][][STATEMENT] font.COURIER.italic.bold=type1.Courier-BoldOblique
[082913_091542425][][STATEMENT] font.COURIER.italic.normal=type1.Courier-Oblique
[082913_091542426][][STATEMENT] font.COURIER.normal.bold=type1.Courier-Bold
[082913_091542426][][STATEMENT] font.COURIER.normal.normal=type1.Courier
[082913_091542426][][STATEMENT] font.DEFAULT.italic.bold=type1.Helvetica-BoldOblique
[082913_091542427][][STATEMENT] font.DEFAULT.italic.normal=type1.Helvetica-Oblique
[082913_091542427][][STATEMENT] font.DEFAULT.normal.bold=type1.Helvetica-Bold
[082913_091542427][][STATEMENT] font.DEFAULT.normal.normal=type1.Helvetica
[082913_091542428][][STATEMENT] font.HELVETICA.italic.bold=type1.Helvetica-BoldOblique
[082913_091542428][][STATEMENT] font.HELVETICA.italic.normal=type1.Helvetica-Oblique
[082913_091542428][][STATEMENT] font.HELVETICA.normal.bold=type1.Helvetica-Bold
[082913_091542429][][STATEMENT] font.HELVETICA.normal.normal=type1.Helvetica
[082913_091542429][][STATEMENT] font.MONOSPACE.italic.bold=type1.Courier-BoldOblique
[082913_091542429][][STATEMENT] font.MONOSPACE.italic.normal=type1.Courier-Oblique
[082913_091542430][][STATEMENT] font.MONOSPACE.normal.bold=type1.Courier-Bold
[082913_091542430][][STATEMENT] font.MONOSPACE.normal.normal=type1.Courier
[082913_091542430][][STATEMENT] font.SANS-SERIF.italic.bold=type1.Helvetica-BoldOblique
[082913_091542431][][STATEMENT] font.SANS-SERIF.italic.normal=type1.Helvetica-Oblique
[082913_091542431][][STATEMENT] font.SANS-SERIF.normal.bold=type1.Helvetica-Bold
[082913_091542431][][STATEMENT] font.SANS-SERIF.normal.normal=type1.Helvetica
[082913_091542432][][STATEMENT] font.SERIF.italic.bold=type1.Times-BoldItalic
[082913_091542432][][STATEMENT] font.SERIF.italic.normal=type1.Times-Italic
[082913_091542432][][STATEMENT] font.SERIF.normal.bold=type1.Times-Bold
[082913_091542433][][STATEMENT] font.SERIF.normal.normal=type1.Times-Roman

….
….


Step 3: Analyze the files

Now go back to unix to the directory you had set in step 1 as LogDir.

You will notice that the trace files have been generated. These files can now be analysed by the developer.

Step 4: Remove xdodebug.cfg

Once the issue has been reproduced and analysed, remove the file, xdodebug.cfg, and trace file logging will be disabled.

Cheers!


MLS effect on forms/OAF pages in Apps

$
0
0

MLS is a feature in Oracle Apps that allow users to run the instance in more than 1 language. Once Multi language packs are installed in Oracle by DBAs language functionality is enhanced. Here is how language can be selected on various forms/OAF pages.

MLS Effect on Oracle Login page

Once the Oracle instance has multiple languages enabled the login page shows the list of languages

Notice the section, Select a language, under Accessibility. The user can select any language from this page to change the default language.

Click on Deutsch.

Now the login page is changed to German and the language is highlighted in blue.

MLS effect on user preferences

After the MLS patches have been applied login to Oracle

On the home page click on Preferences and the user preferences page will open

On the preferences form the user can change the language as well.

Select French for the current session

Click on Apply

Now the entire session language changes to French.


MLS effect on Oracle Forms

When the packs are installed the Translations button ( ) on the menu bar is added. The menu bar looks like the following,

The button is enabled () when a multi language enabled form is opened, E.g. Lookup form. The button is not enabled for all forms.

Let us query for a lookup

Now click on the Translations button.

If you click on any field on this form and click on the Translations button you will get the corresponding translated value.

Cheers!


Viewing all 128 articles
Browse latest View live