Search This Blog

Monday, April 9, 2012

Back to Back Orders in Oracle Order Management

Back to Back Orders:
In Back to Back Orders, the shipment process is completed through Order Management(OM) as a
standard order after the item is received against a Purchase Order(PO).

For Example,
 1. Customer 'A' Order Item X from B
 2. B Orders Item X form C
 3. C Ships Item X to B
 4. B Ships Item X to A
 5. B Bills A for the Order and C Bills B for the Order

Sales Order Line Status for a Back to Back Order
 1. After saving the Order,  Line Status: "Entered"
 2. After Booking, Line Status: "Supply Eligible"
 3. After Actions-> Progress Order, Line Status changed to      "PO-ReqRequested"
4. After running the program, Requisition Import, Line Status changed to "PO-ReqCreated"
5. After Creating PO, Line Status changed to "PO-Created"
6. After creating Receipt for the Purchase Order, Line Status changes to "Awaiting Shipping"


Steps:
1. Create an Item
    1.1 Navigation: Inventory -> Master Items ->  Master  Organization.
    1.2 Enter Below Details:
        Enter Item Number and Desciption
        Tools -> Copy from -> Give Template as  "Purchased Item"
        Go to Order Management Tab, check the Assemble to Order flag (ATO)
        Go to Purchasing Tab, enter a value in List Price Field
        Go to Work In Process tab, check Build in WIP flag
        Go to General Planning tab, set the Make or Buy field to "Buy"
    1.3 Save the details entered.
    1.4 Assign the item to appropriate Organizations (For ex M1)

2. Assign the Item to a Price List
     2.1 Navigation:  Oracle Pricing Manager(resp) -> Price Lists -> Price List Setup
     2.2 Query for your Price List
     2.3 Go to Price List Lines -> Click New -> Enter Details as below:
            Product Context: Item
            Product Attribute: Item Number
            Product Value:  Item Name(created in step 1.2)
            Product Description: Automatically be populated
            UOM: Automatically be Populated
            Line Type: Price List Line
            Application Method: Unit Price
            Value: Price to be given for the Item (For Ex, $250.00)
    2.4 Save the details entered.
   
3. Make sure the following periods are open for this testflow.
   3.1  Inventory Periods:
           Inventory (resp) -> Accounting Clsoe Cycle -> Inventory Accounting Periods   
           Select the Organization(Ex, M1) and Open the required periods.
    3.2 Purchasing Periods:
           Purchasing (resp) -> Setup -> Financials -> Accounting ->  Control Purchasing Periods

4. Create a Sales Order:
     4.1 Navigation: Order Management Super User(resp)  -> Orders. Returns -> Sales Order
     4.2 Enter Below Information:
            Customer Name/Customer Number
            Price List: Name of the Price list(To which our test item has been assigned)
            Order Type: Mixed
      4.3 Go to Lines Tab, Enter below Information
             Item: Item Created above
             Qty:
             Save the details entered.
             Make a note of Sales Order Number.
             Order Line Status will be "Entered" .
     4.4  Book the Sales Order(Click on Book Order button)
              Now the Order Line will be in  "Supply Eligible".

5. Place the cursor on sales order line and go to actions -> Select "Progress Order"
     Select the work flow activity, "Create Supply Order - Eligible"
   Now the Line Status will be moved to "PO-ReqRequested"
   Note: WIth the above step, OM has inserted a record in PO Requisition Interface table

6. Importing the Requisition.
    6.1 Navigation: Purchasing(resp) -> Reports -> Run
    6.2 Run the concurrent program, "Requisition Import"
           Parameters: Import Source as "CTO" and Leave the other parameters as default.
           Note: This program can be submitted from Order Management Super User(resp) -> Orders, Returns -> Requisition Import
    6.3 Check the program status, View -> Requests -> Find -> Make sure that the concurrent request submitted successfully.
    6.4 Now the Sales Order Line status will be changed to "PO-ReqCreated".
    6.5 Open the Sales Order, go  to Tools -> Shceduling -> Reservation Details -> Supply Tab -> We can see the Order Line is reserved against
            the Requisition nad note down the Requisition Number.
    6.6 Check the status of Requisition:
            Purchasing(resp) -> Requisitions -> Requisition Summary -> Enter the Requisition Number and click on Find.
             Verify that the status should be "Approved".

7. Auto Create Purchase Order from the Requisition
     7.1 Purchasing (resp) -> Auto Create
     7.2 Clear all the data that defaulted in the form
     7.3 Enter the Requisition Number and Click on Find
     7.4 Check the check box to the left of the requisition line and click on Automatic
     7.5 Enter the Supplier & Supplier Site and click on Create
     7.6 The Purchase Order form will automatically open with the PO that got created.
            Click on the Approve button.
            Click on the OK button in the Approval Documents window to approve the PO.
            Note down the PO number, and verify that the status is Approved.
     7.7 Now the Sales Order line status will be changed to "PO-Created".
     7.8 Open the Sales Order, Go to Order Line, Tools ->  Scheduling -> Reservation Details -> Supply Tab -> We can see the Type as Purchase Order
            and note down the Purchase Order Number.

8. Create Receipts against the Purchase Order:
     8.1 Purchasing -> Receiving -> Receipts
     8.2 Enter Purchase Order Number and Click on Find
     8.3 In the Receipts window, check the checkbox to the left of the line and enter
            Destination Type : Inventory
            Subinventory : FGI
             save the Receipt
     8.4 Go to Purchasing(resp) > Receiving > Receiving Transactions Summary
     8.5 Enter the Purchase Order number and click on Find.
     8.6 Click on the Transactions button.
     8.7 Verify a Receive and Delivery transaction. This means that the B2B item has been received into Inventory.

9. The line status of the sales order line will now shows Awaiting Shipping
     9.1 On the sales order line, Tools > Scheduling > Reservation Details will now show that the item is reserved against
             Inventory in Subinventory = FGI.

10. The line can now be pick released, shipped and invoiced to the customer.

Oracle Report Triggers

There are eight report triggers. Of these, there are five global triggers called the Report Triggers. They are fired in the following order :
* Before Parameter Form
* After Parameter Form
* Before Report
* Between Pages
* After Report

Apart from the above Five Report Triggers, there are three other types of triggers :
* Validation Triggers
* Format Triggers
* Action Triggers

Before Form: Fires before the run-time Parameter Form is displayed. From this trigger, you can access and change the values of parameters, PL/SQL global variables, and report-level columns.

After Form: Fires after the run-time Parameter Form is displayed. From this trigger, you can access parameters and check their values. This trigger can also be used to change parameter values or, if an error occurs, return to the run-time Parameter Form. Columns from the data model are not accessible from this trigger.

Before Report: Fires before the report is executed but after queries are parsed and data is fetched.

Between Pages: Fires before each page of the report is formatted, except the very first page. This trigger can be used for customized page formatting.

After Report: Fires after you exit the Previewer, or after report output is sent to a specified destination, such as a file, a printer. This trigger can be used to clean up any initial processing that was done, such as deleting tables.

Validation Triggers: Validation Triggers are PL/SQL functions that are executed when parameter values are specified on the command line and when you accept the run-time Parameter Form. Validation Triggers are also used to validate the Initial Value of the parameter in the Parameter property sheet.

Format Triggers: Format Triggers are PL/SQL functions executed before the object is formatted. The trigger can be used to dynamically change the formatting attributes of the object.

Action Triggers: Action Triggers are PL/SQL procedures executed when a button is selected in the Previewer. The trigger can be used to dynamically call another report (drill down) or execute any other PL/SQL.

Anchors in Oracle Reports

Anchors in Oracle Reports:
      An anchor defines the relative position of an object to the object to which it is anchored. Anchors are used to determine the vertical and horizontal positioning of a child object relative to its parent. Since the size of some layout objects may change when the report runs (and data is actually fetched), you need anchors to define where you want objects to appear relative to one another.

There are two types of anchors in Oracle Reports:
* Implicit(anchors that Oracle Reports create when report is run)
* Explicit (anchors that you create)

Implicit Anchors: At run-time, Oracle Reports generates an implicit anchor for each layout object that does not already have an explicit anchor. It determines for each layout object which objects, if any,  can overwrite it, then creates an anchor from the layout object to the closest object that can overwrite it. This prevents the object from being overwritten. The implicit anchor functionality saves you from having to define the positioning of each object. Implicit anchors are not visible in the Layout editor. However, you can specify that the Object Navigator display anchoring information using the Object Navigator Options dialog.

Explicit Anchors: Create an anchor in the Layout editor by clicking on the Anchor tool, dragging from one edge of the child to the one of the parent's edges, then specifying the anchor's properties in its property sheet. Any anchor you create for an object will override its implicit anchoring. Explicit anchors are always visible in the Layout editor unless you specify otherwise via the Layout Options dialog.

Saturday, April 7, 2012

SQL Query to Extract Oracle Pricing Agreements

SELECT oat.NAME "Agreement name", oab.revision_date "Revision Date",
       hca.account_number "Bill to customer number",
       hp.party_name "Bill to customer name", rt.NAME "Agreement terms",
       oab.start_date_active "Effective date from",
       oab.end_date_active "Effective date to",
       oab.attribute1 "Meter reading digits",
       qp_price_list_line_util.get_product_value
                             ('QP_ATTR_DEFNS_PRICING',
                              qppr.product_attribute_context,
                              qppr.product_attribute,
                              qppr.product_attr_value
                             ) "Product Value",
       msi.description "Product description",
       qppr.product_uom_code "Unit of measure",
       flv_line_type.meaning "Line Type",
       flv_price_brk.meaning "Price Break Type",
       flv_arth_oprtr.meaning "Application Meansure",
       qpll.start_date_active "Start Date",
       qpll.end_date_active "End Date",
       qppr.pricing_attribute_context "Pricing Context",
       (SELECT qpst.seeded_segment_name
          FROM apps.qp_prc_contexts_b qpcb,
               apps.qp_segments_b qpsb,
               apps.qp_segments_tl qpst
         WHERE 1 = 1
           AND qppr.pricing_attribute_context = qpcb.prc_context_code
           AND qpcb.prc_context_type = 'PRICING_ATTRIBUTE'
           AND qpcb.prc_context_id = qpsb.prc_context_id
           AND qpsb.segment_id = qpst.segment_id
           AND qpsb.segment_mapping_column = qppr.pricing_attribute)
                                                              "Pricing Value",
       qppr.pricing_attr_value_from_number "From Value",
       qppr.pricing_attr_value_to_number "To Value", qpll1.operand price
  FROM apps.oe_agreements_tl oat,
       apps.oe_agreements_b oab,
       apps.hz_cust_accounts hca,
       apps.hz_parties hp,
       apps.ra_terms_tl rt,
       apps.qp_pricing_attributes qppr,
       apps.qp_list_lines qpll,
       apps.qp_list_lines qpll1,
       apps.mtl_system_items_b msi,
       apps.fnd_lookup_values flv_line_type,
       apps.fnd_lookup_values flv_price_brk,
       apps.fnd_lookup_values flv_arth_oprtr,
       apps.qp_list_headers_b qplh
 WHERE 1 = 1
   AND oat.agreement_id = oab.agreement_id
   AND oab.sold_to_org_id = hca.cust_account_id
   AND hca.party_id = hp.party_id
   AND oab.term_id = rt.term_id
   AND oab.price_list_id = qplh.list_header_id
   AND qplh.list_header_id = qpll.list_header_id
   AND qplh.list_header_id = qpll1.list_header_id
   AND qpll.list_line_type_code = 'PBH'
   AND qpll1.list_line_id = qppr.list_line_id
   AND qpll.revision_date = qpll1.revision_date
   AND qpll1.list_line_type_code = 'PLL'
   AND msi.inventory_item_id = qppr.product_attr_value
   AND flv_line_type.lookup_code = qpll.list_line_type_code
   AND flv_line_type.lookup_type = 'LIST_LINE_TYPE_CODE'
   AND flv_price_brk.lookup_code = qpll.price_break_type_code
   AND flv_price_brk.lookup_type = 'PRICE_BREAK_TYPE_CODE'
   AND flv_arth_oprtr.lookup_code = qpll.arithmetic_operator
   and flv_arth_oprtr.lookup_type = 'ARITHMETIC_OPERATOR'
   and msi.organization_id = 141;

SQL Query to Extract Service Contracts Lines Information

SELECT DISTINCT msib.segment1 NAME,
                (SELECT klt.invoice_text
                   FROM apps.okc_k_lines_b okl2,
                        apps.oks_k_lines_b klb,
                        apps.oks_k_lines_tl klt
                  WHERE okl2.cle_id = okl.ID
                    AND okl2.ID = klb.cle_id
                    AND klb.ID = klt.ID
                    AND klt.invoice_text IS NOT NULL
                    AND ROWNUM < 2) invoice_text,  --Version 1.2
                okl.*,
                (SELECT oisv.NAME
                   FROM apps.okc_k_lines_b okl2,
                        apps.okc_k_lines_b okl1,
                        apps.okc_k_items oki,
                        apps.oks_cov_action_times_v cov,
                        apps.okx_incident_severits_v oisv
                  WHERE okl.ID = okl1.cle_id
                    AND okl1.ID = okl2.cle_id
                    AND okl2.ID = oki.cle_id
                    AND oki.cle_id = cov.bus_process_cle_id
                    AND cov.incident_severity_id1 = oisv.id1
                    AND ROWNUM < 2) severity,
                osl.sequence_no seq_num, osl.level_periods number_of_periods,
                osl.start_date bill_start_date, osl.end_date bill_end_date,
                osl.uom_per_period DURATION,
                (SELECT unit_of_measure
                   FROM apps.mtl_units_of_measure
                  WHERE uom_code = osl.uom_code) period,
                osl.level_amount amount,
                  NVL (osl.level_periods, 0)
                * NVL (osl.level_amount, 0) total_amount,
                osl.invoice_offset_days, osl.interface_offset_days
           FROM apps.okc_k_headers_b okh,
                apps.okc_k_lines_b okl,
                apps.mtl_system_items_b msib,
                apps.oks_stream_levels_b osl,
                apps.okc_k_items oki1
          WHERE okh.ID = okl.dnz_chr_id
            AND okl.ID = oki1.cle_id
            AND msib.inventory_item_id = oki1.object1_id1
            AND msib.organization_id = 144
            AND okl.ID = osl.cle_id
            AND okl.lse_id IN (1, 12)
            AND okh.sts_code IN ('ACTIVE', 'EXPIRED', 'QA_HOLD')
            AND okh.contract_number = &CONTRACT_NUMBER
       ORDER BY okl.line_number;

SQL Query to Extract Oracle Service Contracts Header Information


SELECT   okh.*, okt.description,
         (SELECT hca.account_number
            FROM apps.hz_cust_accounts hca,
                 apps.hz_cust_acct_sites_all hcs,
                 apps.hz_cust_site_uses_all hcsu
           WHERE hca.cust_account_id = hcs.cust_account_id
             AND hcs.cust_acct_site_id = hcsu.cust_acct_site_id
             AND okh.bill_to_site_use_id = hcsu.site_use_id
             AND hcsu.site_use_code = 'BILL_TO') bill_to_customer,
         (SELECT hca.account_number
            FROM apps.hz_cust_accounts hca,
                 apps.hz_cust_acct_sites_all hcs,
                 apps.hz_cust_site_uses_all hcsu
           WHERE hca.cust_account_id = hcs.cust_account_id
             AND hcs.cust_acct_site_id = hcsu.cust_acct_site_id
             AND okh.ship_to_site_use_id = hcsu.site_use_id
             AND hcsu.site_use_code = 'SHIP_TO') ship_to_customer,
         (SELECT DISTINCT jrs.NAME
                     FROM apps.okc_contacts oc,
                          okx_salesreps_v jrs
                    WHERE okh.ID = oc.dnz_chr_id
                      AND oc.object1_id1 = jrs.id1
                      AND oc.cro_code LIKE 'SALESPERSON'
                      AND jrs.org_id = okh.authoring_org_id) "Sales Person"
    FROM apps.okc_k_headers_b okh, apps.okc_k_headers_tl okt
   WHERE 1 = 1
     AND okt.ID = okh.ID
     and okh.sts_code in ('ACTIVE', 'ENTERED', 'QA_HOLD')
     AND okh.authoring_org_id = 204
order by okh.contract_number;

SQL Query to extract oracle Sales order line Work flow status

select wfs.item_key             item_key,
       lin.line_number,   
       WFA.DISPLAY_NAME         PROCESS_NAME,
       WFA1.DISPLAY_NAME        ACTIVITY_NAME,
       WF_CORE.ACTIVITY_RESULT(WFA1.RESULT_TYPE,WFS.ACTIVITY_RESULT_CODE) RESULT_CODE,
       LKP.MEANING                MEANING,
       WFS.NOTIFICATION_ID        NOTIFICATION_ID,
       WFP.PROCESS_NAME           INT_Process_name,
       WFP.ACTIVITY_NAME          INT_Activity_name,
       to_char(WFS.BEGIN_DATE,'DD-MON-RR_HH24:MI:SS') B_Date,
       to_char(WFS.END_DATE,'DD-MON-RR_HH24:MI:SS')   E_Date,
       WFS.ERROR_NAME             Err_name,
       WFS.BEGIN_DATE             BEGIN_DATE2,
       WFS.EXECUTION_TIME         EXECUTION_TIME2
from WF_ITEM_ACTIVITY_STATUSES WFS,
     WF_PROCESS_ACTIVITIES     WFP,
     WF_ACTIVITIES_VL          WFA,
     WF_ACTIVITIES_VL          WFA1,
     wf_lookups                lkp,
     (select oola.line_number,oola.line_id,oola.header_id
     from oe_order_lines_all oola
     where 1=1
     and oola.header_id = &header_id) lin
where 2=2
and   wfs.item_type          = 'OEOL'
  and  WFS.item_key         = to_char(lin.line_id)
  and  WFS.PROCESS_ACTIVITY   = WFP.INSTANCE_ID
  and  WFP.PROCESS_ITEM_TYPE  = WFA.ITEM_TYPE
  and  WFP.PROCESS_NAME       = WFA.NAME
  and  WFP.PROCESS_VERSION    = WFA.VERSION
  and  WFP.ACTIVITY_ITEM_TYPE = WFA1.ITEM_TYPE
  and  WFP.ACTIVITY_NAME      = WFA1.NAME
  and  WFA1.VERSION =
      (select max(VERSION)
       from WF_ACTIVITIES WF2
       where WF2.ITEM_TYPE = WFP.ACTIVITY_ITEM_TYPE
       and   WF2.NAME      = WFP.ACTIVITY_NAME)
  and  LKP.LOOKUP_TYPE = 'WFENG_STATUS'
  and  LKP.LOOKUP_CODE = WFS.ACTIVITY_STATUS
  order by 1, 13, 14;

SQL Query to extract Oracle Sales Order Price Adjustments

select
ADJ.PRICE_ADJUSTMENT_ID            PRC_ADJ_ID,
nvl(ADJ.APPLIED_FLAG,'N')          APPLIED_FLAG,
ADJ.LIST_HEADER_ID                 LST_HD_ID,
ADJ.LIST_LINE_ID                   LST_LN_ID,
ADJ.LIST_LINE_NO                   LIST_LN_NO,  
ADJ.MODIFIER_LEVEL_CODE            MOD_LVL,    
ADJ.LIST_LINE_TYPE_CODE            LIST_TYPE_CODE,
ADJ.CHARGE_TYPE_CODE               CHG_TY_CD,            
ADJ.ARITHMETIC_OPERATOR            ARITH_OP, 
ADJ.OPERAND_PER_PQTY               OP_PER_QTY,       
ADJ.ADJUSTED_AMOUNT_PER_PQTY       ADJ_AMT_PQ,
ADJ.OPERAND                        OPERAND,                     
ADJ.ADJUSTED_AMOUNT                ADJ_AMT,                            
ADJ.CREDIT_OR_CHARGE_FLAG          CD,                         
ADJ.AUTOMATIC_FLAG                 AF,  
ADJ.PRINT_ON_INVOICE_FLAG          PI,  
ADJ.INVOICED_FLAG                  INF,             
ADJ.PERCENT                        PERC,           
ADJ.COST_ID                        COST_ID,              
adj.tax_code                       tax_code              
from oe_price_adjustments   adj,
oe_order_headers_all ooha
where  1=1
and adj.header_id                 = ooha.header_id
and ooha.order_number = &ORDER_NUMBER
        and  ADJ.LINE_ID              IS NULL
order by adj.applied_flag,list_type_code;

SQL Query to extract Oracle Sales Order Workflow Status

Select WFA.DISPLAY_NAME      Process,
       WFA1.DISPLAY_NAME     Activity,       WF_CORE.ACTIVITY_RESULT(WFA1.RESULT_TYPE,WFS.ACTIVITY_RESULT_CODE) Result,       LKP.MEANING           Act_status,
       WFS.NOTIFICATION_ID   Notif,       WFP.PROCESS_NAME      I_process,       WFP.ACTIVITY_NAME     I_activity,
       to_char(WFS.BEGIN_DATE,'DD-MON-RR_HH24:MI:SS') Begin_d,
       to_char(WFS.END_DATE,'DD-MON-RR_HH24:MI:SS')   End_d,
       WFS.ERROR_NAME        error_name
from WF_ITEM_ACTIVITY_STATUSES WFS,
     WF_PROCESS_ACTIVITIES     WFP,
     WF_ACTIVITIES_VL          WFA,
     WF_ACTIVITIES_VL          WFA1,
     WF_LOOKUPS                LKP
where 1=1
and  WFS.ITEM_TYPE          = 'OEOH'
and  WFS.item_key           = to_char(:v_header_id)
and  WFS.PROCESS_ACTIVITY   = WFP.INSTANCE_ID
and  WFP.PROCESS_ITEM_TYPE  = WFA.ITEM_TYPE
and  WFP.PROCESS_NAME       = WFA.NAME
and  WFP.PROCESS_VERSION    = WFA.VERSION
and  WFP.ACTIVITY_ITEM_TYPE = WFA1.ITEM_TYPE
and  WFP.ACTIVITY_NAME      = WFA1.NAME
and  WFA1.VERSION           = (select max(VERSION)
                              from WF_ACTIVITIES WF2
                              where WF2.ITEM_TYPE =            WFP.ACTIVITY_ITEM_TYPE
and   WF2.NAME              = WFP.ACTIVITY_NAME)
and  LKP.LOOKUP_TYPE        = 'WFENG_STATUS'
and  LKP.LOOKUP_CODE        = WFS.ACTIVITY_STATUS
order by WFS.ITEM_KEY,
         WFS.BEGIN_DATE,
         EXECUTION_TIME;

Creating Custom Context Attributes(Advanced Pricing)

Below document  explains how to create
1. Custom Context and Attributes for a business scenario
2. Context Linking and Mapping.
3. Queries to extract Contexts information and Attributes information

Here is the Link to GO!!!





Executing Oracle Sales Order Information script as a Concurrent Program


The creation of the Concurrent Request needs to be performed from System Administrator responsibility, this will be a one time task. Once installed the end user will have the ability to execute the  script without the need of SQL access or the password for the Applications Owner user.

The purpose of this script is to collect information related to a sales order, its shipment lines and workflow status.

Creation of the Concurrent Request :

1. Locate the file ONTomse12.sql on $ONT_TOP/sql
    1.1 Login to the server
    1.2 Change directory to the file location(Where the file down loaded)
    1.3 Copy file ONTomse12.sql to $ONT_TOP/sql directory
    1.4 Unix permissions  644 (rw-r--r--) will be enough.

Note: If the file(ONTomse12.sql) present in $ONT_TOP/sql directory then this step can be ignored. If not, download the file using below link and follow above steps.



2. Create the Concurrent request definition.
    2.1 Navigation: System Administration(resp) ->  Concurrent -> Program -> Executable
    2.2 On the new window enter:
        Executable: HTMomse
    Short Name: HTMomse
        Application: Order Management
        Description: Diagnostics HTMomse
        Execution Method: SQL*Plus
        Execution File Name: ONTomse12
    2.3 Save
    2.4 Close window

    2.5 Navigation :  Concurrent -> Program -> Define
    2.6 Query for Program "Diagnostics: OM Order Information"
    2.7 Use the 'Copy to' button
    2.8 On the new window enter:
        Program: Diagnostics: HTMomse
        Short Name: ONTOMSE
        Application: Order Management
        Check on Include Parameters
    2.9 Click OK

    Back on the Concurrent Program definition form, the current name is now Diagnostics: HTMomse
    Move to the 'Executable' section
    Change the Name to HTMomse (This is the Executable defined above)
    Method should remain SQL*Plus
    Save
    Close window

3. Add the new Concurrent Request to the Order Management
    3.1 Navigation: Security -> Responsibility -> Request
    3.2 Query the Group OM Concurrent Programs
    3.3 Move to Requests section (Click on the first line)
    3.4 Use the Add button on Menu (green Plus sign)
    3.5 On the new line enter:
        Type: Program
        Name: Diagnostics: HTMomse (LOV is available)
        The rest of the field will be defaulted.
    Save

4. Test the Concurrent Request
    4.1 Navigation: Order Management SuperUser(resp) -> Reports, Requests -> Run Requests
    4.2 Select Single Request
    4.3 On the Requests window enter:
        Name: Diagnostics: HTMomse
     4.4 A new window opens for Parameters, enter values
                  Order Number field is Mandatory (LOV is available)
                           --> the field displays the Order Number followed by the Header_Id
          Line Number is optional (LOV is available)
      4.5 Click OK (Parameters window closes)
      4.6 Click on Submit

5. Saving the Script Output
    5.1 Navigation: View -> Requests
    5.2 Click on Find.
    5.3 Select (Click) the request named 'Diagnostics: HTMomse', the parameters field will show the Header_Id.
    5.4 Click on  'View Output'.
        The output file will open on a browser.
     5.5 To Save the file:
            Navigate to:  File / Save as   (Internet Explorer)      or      File / Save Page as    (Forefox)
            Please make sure to set field 'Save as Type' to 'Webpage, HTML Only'
    Click on Save.

Friday, April 6, 2012

SQL Query to extract Oracle Purchase Order Information


SELECT
  poh.po_header_id, 
  poh.type_lookup_code PO_TYPE,
  poh.authorization_status PO_STATUS,
  poh.segment1 PO_NUMBER,
  pov.vendor_name SUPPLIER_NAME,
  povs.vendor_site_code Location,
  hrls.location_code Ship_To,
  hrlb.location_code Bill_to,
  pol.line_num ,
  msib.segment1 Item,
  pol.unit_price,
  pol.quantity,
  pod.amount_billed Amount,
  pod.destination_subinventory,
  ppf.full_name Buyer_Name,
  poh.closed_Code 
FROM
  PO_HEADERS_ALL poh,
  PO_LINES_ALL pol,
  mtl_system_items_b msib,
  PO_LINE_LOCATIONS_ALL poll,
  PO_DISTRIBUTIONS_ALL pod,
  po_vendors pov,
  po_vendor_sites_All povs,
  hr_locations_all hrls,
  hr_locations_all hrlb,
  per_all_people_f ppf,
  po_line_types polt
WHERE
  1                         =1
AND polt.line_type_id    = pol.line_type_id
AND povs.vendor_site_id     = poh.vendor_site_id
AND pov.vendor_id           = poh.vendor_id
AND pol.item_id             = msib.inventory_item_id
AND msib.organization_id    = 204
AND poh.po_header_id        = pol.po_header_id
AND pol.po_line_id          = pod.po_line_id
AND poll.line_location_id   = pod.line_location_id
AND poh.ship_to_location_id = hrls.location_id
AND poh.bill_to_location_id = hrlb.location_id
AND poh.agent_id            = ppf.person_id
AND poh.segment1            = &LP1;

SQL Query to extract Oracle Sales Order Information


select fu.user_name,fu.email_address,ooha.header_id,
ooha.order_number,
to_date(ooha.creation_date,'DD-MON-YYYY HH:MI:SS:'),
hca.account_number Customer_Number,
hca.account_name customer_name,
otta.order_category_code "Order Type",
ooha.demand_class_code, hou.name Operating_Unit,
qph.name PriceList, ooha.flow_status_code Order_Status,
oola.line_id, oola.line_number, oola.ordered_item, oola.ordered_quantity, oola.unit_selling_price,
oola.flow_status_code Line_Status,
mp.organization_code warehouse 
from apps.oe_order_headers_all ooha,
apps.fnd_user fu,
apps.oe_order_lines_all oola,
apps.hr_operating_units hou,
apps.qp_list_headers_all qph,
apps.hz_cust_accounts_all hca,
apps.oe_transaction_types_all otta,
apps.mtl_parameters mp
where 1=1
and ooha.header_id = oola.header_id
and mp.organization_id = oola.ship_from_org_id
and hou.organization_id = ooha.org_id
and ooha.price_list_id = qph.list_header_id
and ooha.sold_to_org_id = hca.cust_account_id
and ooha.order_type_id = otta.transaction_type_id
and ooha.created_by = fu.user_id
and ooha.order_number = &Order_Number
order by 3 desc;

Query to Find Profile Option Values


SELECT po.profile_option_name "NAME", po.user_profile_option_name,
DECODE (TO_CHAR (pov.level_id),
'10001', 'SITE',
'10002', 'APP',
'10003', 'RESP',
'10005', 'SERVER',
'10006', 'ORG',
'10004', 'USER',
'***'
) "LEVEL",
DECODE (TO_CHAR (pov.level_id),
'10001', '',
'10002', app.application_short_name,
'10003', rsp.responsibility_key,
'10005', svr.node_name,
'10006', org.NAME,
'10004', usr.user_name,
'***'
) "CONTEXT",
pov.profile_option_value "VALUE"
FROM apps.fnd_profile_options_vl po,
apps.fnd_profile_option_values pov,
apps.fnd_user usr,
apps.fnd_application app,
apps.fnd_responsibility rsp,
apps.fnd_nodes svr,
apps.hr_operating_units org
WHERE 1 = 1
AND pov.application_id = po.application_id
AND pov.profile_option_id = po.profile_option_id
AND usr.user_id(+) = pov.level_value
AND rsp.application_id(+) = pov.level_value_application_id
AND rsp.responsibility_id(+) = pov.level_value
AND app.application_id(+) = pov.level_value
AND svr.node_id(+) = pov.level_value
AND org.organization_id(+) = pov.level_value
and po.profile_option_name like &Profile_Name
ORDER BY "NAME";

Clearing Apache cache from Oracle Applications

1. Navigate to "Functional Administrator" responsibility.
2. Click on the "Core Services" tab.
3. Click on "Caching Framework" link.
4. Click on "Global Configuration" link in the left vertical menu.
5. In the "Cache Policy" region click on the "Clear All Cache"       button.
6. Click the "Yes" button to confirm the action.
7. Click the "Apply" button to apply the changes.

HRMS: Single record insertion for Address


DECLARE
ip_p_address_id NUMBER;
ip_p_object_version_number NUMBER;
BEGIN
hr_person_address_api.create_person_address
(p_validate => NULL,
p_effective_date => SYSDATE,
p_pradd_ovlapval_override => NULL,
p_validate_county => NULL,
p_person_id => 13541,
p_primary_flag => 'Y',
p_style => 'US',
p_date_from => '23-jan-1980',
p_date_to => SYSDATE,
p_address_type => NULL,
p_comments => NULL,
p_address_line1 => 'East Street',
p_address_line2 => NULL,
p_address_line3 => NULL,
p_town_or_city => 'Houston',
p_region_1 => 'Harris',
p_region_2 => 'TX',
p_region_3 => NULL,
p_postal_code => '77009',
p_country => 'US',
p_telephone_number_1 => '986-655-1799',
p_telephone_number_2 => NULL,
p_telephone_number_3 => NULL,
p_addr_attribute_category => NULL,
p_addr_attribute1 => NULL,
p_addr_attribute2 => NULL,
p_addr_attribute3 => NULL,
p_addr_attribute4 => NULL,
p_addr_attribute5 => NULL,
p_addr_attribute6 => NULL,
p_addr_attribute7 => NULL,
p_addr_attribute8 => NULL,
p_addr_attribute9 => NULL,
p_addr_attribute10 => NULL,
p_addr_attribute11 => NULL,
p_addr_attribute12 => NULL,
p_addr_attribute13 => NULL,
p_addr_attribute14 => NULL,
p_addr_attribute15 => NULL,
p_addr_attribute16 => NULL,
p_addr_attribute17 => NULL,
p_addr_attribute18 => NULL,
p_addr_attribute19 => NULL,
p_addr_attribute20 => NULL,
p_add_information13 => NULL,
p_add_information14 => NULL,
p_add_information15 => NULL,
p_add_information16 => NULL,
p_add_information17 => NULL,
p_add_information18 => NULL,
p_add_information19 => NULL,
p_add_information20 => NULL,
p_party_id => NULL,
p_address_id => ip_p_address_id,
p_object_version_number => ip_p_object_version_number
);
DBMS_OUTPUT.put_line (SQLERRM);
DBMS_OUTPUT.put_line ('Address  Id : ' || ip_p_address_id);
COMMIT;
END; 

HRMS- Single Insert script for Employee Creation


DECLARE
ip_p_person_id NUMBER;
ip_p_assignment_id NUMBER;
ip_p_per_object_version_number NUMBER;
ip_p_asg_object_version_number NUMBER;
ip_p_per_effective_start_date DATE;
ip_p_per_effective_end_date DATE;
ip_p_full_name VARCHAR2 (1000);
ip_p_per_comment_id NUMBER;
ip_p_assignment_sequence NUMBER;
ip_p_assignment_number VARCHAR2 (1000);
ip_p_name_combination_warning BOOLEAN;
ip_p_assign_payroll_warning BOOLEAN;
ip_p_orig_hire_warning BOOLEAN;
ip_employee_number VARCHAR2 (1000);
BEGIN
hr_employee_api.create_employee
(p_hire_date => SYSDATE,
p_business_group_id => 202,
p_last_name => 'Mantripragada',
p_sex => 'M',
p_person_type_id => 13,
p_per_comments => NULL,
p_date_employee_data_verified => NULL,
p_date_of_birth => TO_DATE
('14-June-87',
'DD-MONTH-RR'
),
p_email_address => 'krishna.mantripragada@appsassociates.com',
p_employee_number => ip_employee_number,
p_expense_check_send_to_addres => NULL,
p_first_name => 'Krishna',
p_known_as => 'Vamsi',
p_marital_status => 'S',
p_middle_names => NULL,
p_nationality => 'IND',
p_national_identifier => NULL,
p_previous_last_name => NULL,
p_registered_disabled_flag => NULL,
p_title => 'MR.',
p_vendor_id => NULL,
p_work_telephone => '986-655-1799',
p_attribute_category => NULL,
p_attribute1 => NULL,
p_attribute2 => NULL,
p_attribute3 => NULL,
p_attribute4 => NULL,
p_attribute5 => NULL,
p_attribute6 => NULL,
p_attribute7 => NULL,
p_attribute8 => NULL,
p_attribute9 => NULL,
p_attribute10 => NULL,
p_attribute11 => NULL,
p_attribute12 => NULL,
p_attribute13 => NULL,
p_attribute14 => NULL,
p_attribute15 => NULL,
p_attribute16 => NULL,
p_attribute17 => NULL,
p_attribute18 => NULL,
p_attribute19 => NULL,
p_attribute20 => NULL,
p_attribute21 => NULL,
p_attribute22 => NULL,
p_attribute23 => NULL,
p_attribute24 => NULL,
p_attribute25 => NULL,
p_attribute26 => NULL,
p_attribute27 => NULL,
p_attribute28 => NULL,
p_attribute29 => NULL,
p_attribute30 => NULL,
p_per_information_category => NULL,
p_per_information1 => NULL,
p_per_information2 => NULL,
p_per_information3 => NULL,
p_per_information4 => NULL,
p_per_information5 => NULL,
p_per_information6 => NULL,
p_per_information7 => NULL,
p_per_information8 => NULL,
p_per_information9 => NULL,
p_per_information10 => NULL,
p_per_information11 => NULL,
p_per_information12 => NULL,
p_per_information13 => NULL,
p_per_information14 => NULL,
p_per_information15 => NULL,
p_per_information16 => NULL,
p_per_information17 => NULL,
p_per_information18 => NULL,
p_per_information19 => NULL,
p_per_information20 => NULL,
p_per_information21 => NULL,
p_per_information22 => NULL,
p_per_information23 => NULL,
p_per_information24 => NULL,
p_per_information25 => NULL,
p_per_information26 => NULL,
p_per_information27 => NULL,
p_per_information28 => NULL,
p_per_information29 => NULL,
p_per_information30 => NULL,
p_date_of_death => NULL,
p_background_check_status => 'N',
p_background_date_check => NULL,
p_blood_type => 'B+',
p_correspondence_language => NULL,
p_fast_path_employee => NULL,
p_fte_capacity => NULL,
p_honors => NULL,
p_internal_location => NULL,
p_last_medical_test_by => NULL,
p_last_medical_test_date => NULL,
p_mailstop => NULL,
p_office_number => '986-655-1799',
p_on_military_service => NULL,
p_pre_name_adjunct => NULL,
p_rehire_recommendation => NULL,
p_projected_start_date => NULL,
p_resume_exists => NULL,
p_resume_last_updated => NULL,
p_second_passport_exists => NULL,
p_student_status => NULL,
p_work_schedule => NULL,
p_suffix => NULL,
p_benefit_group_id => NULL,
p_receipt_of_death_cert_date => NULL,
p_coord_ben_med_pln_no => NULL,
p_coord_ben_no_cvg_flag => NULL,
p_coord_ben_med_ext_er => NULL,
p_coord_ben_med_pl_name => NULL,
p_coord_ben_med_insr_crr_name => NULL,
p_coord_ben_med_insr_crr_ident => NULL,
p_coord_ben_med_cvg_strt_dt => NULL,
p_coord_ben_med_cvg_end_dt => NULL,
p_uses_tobacco_flag => NULL,
p_dpdnt_adoption_date => NULL,
p_dpdnt_vlntry_svce_flag => NULL,
p_original_date_of_hire => NULL,
p_adjusted_svc_date => NULL,
p_town_of_birth => NULL,
p_region_of_birth => NULL,
p_country_of_birth => 'IN',
p_global_person_id => NULL,
p_party_id => NULL,
p_person_id => ip_p_person_id,
p_assignment_id => ip_p_assignment_id,
p_per_object_version_number => ip_p_per_object_version_number,
p_asg_object_version_number => ip_p_asg_object_version_number,
p_per_effective_start_date => ip_p_per_effective_start_date,
p_per_effective_end_date => ip_p_per_effective_end_date,
p_full_name => ip_p_full_name,
p_per_comment_id => ip_p_per_comment_id,
p_assignment_sequence => ip_p_assignment_sequence,
p_assignment_number => ip_p_assignment_number,
p_name_combination_warning => ip_p_name_combination_warning,
p_assign_payroll_warning => ip_p_assign_payroll_warning,
p_orig_hire_warning => ip_p_orig_hire_warning
);
DBMS_OUTPUT.put_line (SQLERRM);
COMMIT;
exception when others then
DBMS_OUTPUT.put_line (SQLERRM);
END;