Friday, 6 April 2012

MATCH_OPTION COLUMN / METHOD MISSING IN Purchasing Documents Open Interface

Bug 1930586: MATCH_OPTION COLUMN/METHOD MISSING IN PDOI
=========================================================================== 
                            PROBLEM DESCRIPTION
===========================================================================
  ** DESCRIPTION OF PROBLEM, INCLUDING ALL ERRORS:
     There is no column that accepts the value for match_option (invoice
   matching 'P'or'R') in PO_LINES_INTERFACE. (The enhanced PDOI now supports
   standard PO import.) If there is a method to populate the matching
   option value via the PDOI, it should be documented in the PDOI update
   release note. "matching option" is stored in the following table in EBS.   
PO_LINE_LOCATIONS_ALL.MATCH_OPTION

===========================================================================
                            ADDITIONAL DETAILS
===========================================================================
  ** TAR NUMBER (ALSO ENSURE BUG NUMBER FIELD IS UPDATED IN TAR):
  ** LIST ADDITIONAL DOCUMENTATION AVAILABLE (LOG FILE, REPORT, TRACE, ETC.):
N/A    
  ** HOW WILL DEVELOPMENT RECEIVE THE ADDITIONAL DOCUMENTATION?:
Via Email or ess30 upon request.
  ** DESCRIBE ANY WORKAROUND(S) AVAILABLE TO THE CUSTOMER:
Open POXPOEPO and update the option for all imported POs, which is rediculous.

  ** LIST NAME & VERSION OF ALL MODULES INVOLVED (FORM,REPORT,PACKAGE,ETC.):
EBS 11.5.3
Please ask if you need specific file versions.
  ** IS THE PROBLEM OCCURRING IN TEST OR PRODUCTION?
Production.
  ** DOES THE CUSTOMER HAVE ANY CUSTOMIZATIONS OR 3RD PARTY PRODUCTS?
No.

===========================================================================
                                 HISTORY
===========================================================================
  ** WAS THE CUSTOMER ABLE TO COMPLETE THE SAME PROCESS PREVIOUSLY?:
No.
  ** LIST PATCHES APPLIED RECENTLY WHICH COULD AFFECT THIS PROBLEM:
N/A

Defaulting of match_option is as follows
1. From Supplier Site
2. From Supplier
3. From Financials System Parameters
The HLD for STD PO do not mention anything about this column.
Will be an ER to create the column in CASE and to add the necessary
validations.
PREMCOR REFINING GROUP is requesting this ER be changed to a priority 3 bug so 
a fix can be included in a future PO Family Pack.   They have 100's of PO's
that they import from a 3rd party system (Maximo) using the PDOI.  These
multi-line POs are primarily Service Type POs and whether the line can either
be Invoice Match Option to Receipt or Invoice Match Option to Purchase Order
needs to be controlled at the Line level when inserting into the PO Interface
tables.





Here is the solution for the invoice matching, someone needs to update the
bug to include this solution:

Invoice matching, populate the following columns in PO_LINES_INTERFACE table:
'2WAY'  inspection_required_flag = 'N'
         receipt_required_flag    = 'N'

'3WAY'  inspection_required_flag = 'N'
         receipt_required_flag    = 'Y'

'4WAY'  inspection_required_flag = 'Y'
         receipt_required_flag    = 'Y'


--


Tuesday, 3 January 2012

Calling Stored procedure through Forms Personalization

Calling Stored procedure through Forms Personalization

Calling stored procedure through Forms Personalization in Oracle apps for the user entered values.

Following are the steps to be followed :


Conditions :

Trigger Event : WHEN-VALIDATE-RECORD

Trigger Object : As appropriate

Condition : As appropriate

Actions :

Seq : 10

Type : Builtin

Description : Calling Stored procedure

Language : All

Builtin Type : Execute a Procedure

Argument :

='DECLARE
l_retcode NUMBER
l_errbuf   VARCHAR2(2000);
BEGIN
xx_custom_package.main_procedure(l_retcode,l_errbuf,'||${item.BLOCK_NAME.ITEM_NAME.value}||','||
${item.BLOCK_NAME.ITEM_NAME.value}||');
END'


--


Wednesday, 28 December 2011

How to delete a DFF Context

How to delete a DFF Context


Sometime I'm quite annoyed by the typo mistake when creating a DFF context. The DFF segment screen doesn't allow deletion of context. Fortunately, Oracle has internal API to do such thing. Following is a sample.

--*******************************************
--* Delete a descriptive flexfield
--*******************************************
SET ECHO OFF
SET FEEDBACK OFF
SET SERVEROUTPUT ON SIZE 1000000
DECLARE
  l_application_id                NUMBER := 0;
  l_descriptive_flexfield_name    VARCHAR2(100) :=  'FND_COMMON_LOOKUPS' ;
  l_descriptive_flex_context_cod  VARCHAR2(100) :=  'XFND_CLWW_PURGE_FOLDER';
BEGIN
  --FND_DESCRIPTIVE_FLEXS_PKG --this package is for DFF
  --FND_DESCR_FLEX_CONTEXTS_PKG --this package is for DFF Context
  --FND_DESCR_FLEX_COL_USAGE_PKG --this package is for DFF Column useage
  --When creating a new DFF Context, it will check the DFF Column usage if the context is already used.
  --so when deleting a DFF Context, both the context and column usage should be deleted.
  FOR c IN (SELECT application_column_name
              FROM fnd_descr_flex_column_usages
             WHERE application_id = l_application_id
               AND descriptive_flexfield_name = l_descriptive_flexfield_name
               AND descriptive_flex_context_code = l_descriptive_flex_context_cod)
  LOOP
 
    fnd_descr_flex_col_usage_pkg.delete_row(
         x_application_id                => l_application_id
        ,x_descriptive_flexfield_name    => l_descriptive_flexfield_name
        ,x_descriptive_flex_context_cod  => l_descriptive_flex_context_cod
        ,x_application_column_name       => c.application_column_name
        );
  END LOOP;

  fnd_descr_flex_contexts_pkg.delete_row(
         x_application_id                => l_application_id,
        ,x_descriptive_flexfield_name    => l_descriptive_flexfield_name
        ,x_descriptive_flex_context_cod  => l_descriptive_flex_context_cod
         );
 
  --commit;
end;



--


Form Personalization - How to Change Field Name

Form Personalization - How to Change Field Name

Form Personalization feature allows us to alter the behavior of Forms-based screens, including changing properties, displaying messages etc.
For a single form-function
(a form running in a particular context based on parameters passed to it defined at function level) we can specify one or more Rules. Each Rule consists of an Event, an optional Condition, the Scope for which it applies, and one or more Actions to perform.

Here we will discuss about how can we change the field display name.

Basic Requirement
Our basic requirement is to change name the 'Latest Start Date' field to 'ABCD' in people Screen. Remember this name change should only be applicable for persons who are using 'UK HRMS Manager'.

Solution Approach
Form Personalization feature is declarative and any personalization to form may interfere with base code of a  form.
before we start personalization please ensure that the following security profiles are properly set
  1) FND_HIDE_DIAGNOSTICS (Hide Diagnostics menu entry)
  2) DIAGNOSTICS (Utilities:Diagnostics)


a) Now open the people & Assignment form from the navigator menu. Click on the 'Latest Start Date field'. Now go to  Help >> Diagnostics >>  Properties >>  Item.
    It will display the 'Object Properties' window. Note Down the  Object2 value (HIRE_DATE) which is nothing but the name of the item.





b) Now to personalize the screen, go to  Help >> Diagnostics >> Custom Code >> Personalize
 Set the following values

Condition Tab
Seq:- Next highest available number.
Description:-
Test Personalization
Level:-
Function
Trigger Event:- WHEN-NEW-FORM-INSTANCE
Trigger Object**:-
Condition:-
Processing Mode:- Both
Scope:- Site


** Depending on the Trigger Event, this field may be Disabled, or Enabled and Required in which case it will validate against a List of Values. For example, if Trigger Event WHEN-NEW-ITEM-INSTANCE is selected, then we must enter a specific block.field for that trigger to be processed.






Action Tab
Seq:- 10
Type:- Property
Description:-
Language***:- All
Object Type:- Item
Target Object:- PERSON.HIRE_DATE (Search with string that we copied from step a)
Property Name:- PROMPT_TEXT
Value:- ABCD


 ***  Select 'All' to have the action processed for any language, or select a specific language.Generally text-related personalizations are applied for a specific
       language
.


c) Validate the design and click on Apply Now.



Note:- 1) Since we have selected processing mode as 'Both', hence the field name 'ABCD' will appear under both the condition 'New form is open' and
             'Enter-Query Mode'.

                If we select the processing mode as 'Only in Enter-Query Mode', then we will see the original name of the field while opening the form.Where as  if we
            query the form it will execute the trigger event and change the name of the field.





      2) Each Rule consists of one or more Scope rows, and one or more Actions. If a Rule has no Scope rows or Action rows, it is not processed. Note that
         upon saving a Rule, if no Scope rows have been entered the form will automatically create a row at the Site level. If any scope matches the current
         runtime context then the Rule will be processed.



--


Sunday, 23 October 2011

USING UTL_FILE PACKAGE (OUT BOUND)

CREATE OR REPLACE procedure
APPS.xx_po_out(x_errbuf out varchar2
,p_retcode out varchar2
,p_file_path in varchar2
,p_file_name in varchar2
)
is
g_org_id number := fnd_profile.value('ORG_ID');
g_conc_request_id number := fnd_profile.value('CONC_REQUEST_ID');
cursor cur_podet
is
select vendor_name
,pov.segment1 vendor_number
,povs.VENDOR_SITE_CODE
,povs.ADDRESS_LINE1||' '||povs.ADDRESS_LINE2 address
,povs.country
,poh.SEGMENT1 po_number
from po_vendors pov,
po_headers_all poh,
po_vendor_sites_all povs
where pov.vendor_id = poh.vendor_id
and poh.vendor_site_id = povs.vendor_site_id
and poh.org_id = g_org_id;

v_file utl_file.file_type;
v_file_name varchar2(100) ;


begin
    fnd_file.put_line(fnd_file.log,'Concurrent Request Id => '||p_file_name||'_'||g_conc_request_id||'.txt');
    v_file_name  := p_file_name||'_'||g_conc_request_id||'.txt';
    v_file := utl_file.fopen(p_file_path,v_file_name ,'W');
    for rec_podet in cur_podet
    loop
        begin
        utl_file.PUT_LINE(v_file,
         rec_podet.vendor_name
        ||','||rec_podet.vendor_number
        ||','||rec_podet.VENDOR_SITE_CODE
        ||','||rec_podet.address
        ||','||rec_podet.country
        ||','||rec_podet.po_number
        );
    exception
        when utl_file.invalid_path then
            fnd_file.put_line(fnd_file.log,'Invalid Path');
        when utl_file.invalid_mode  then
            fnd_file.put_line(fnd_file.log,'Invalid Mode');
        when utl_file.invalid_filehandle then
            fnd_file.put_line(fnd_file.log,'Invalid file handle');
        when utl_file.invalid_operation  then
            fnd_file.put_line(fnd_file.log,'Invalid Operation');
        when utl_file.write_error        then
            fnd_file.put_line(fnd_file.log,'Write error');
        when others then
            fnd_file.put_line(fnd_file.log,'exception in loop => '||SQLERRM);
        end;   
    end loop;
    utl_file.FCLOSE(v_file);
exception
    when others then
        fnd_file.put_line(fnd_file.log,'exception in procedure => '||SQLERRM);   
end ;

USING UTL_FILE PACKAGE(LOAD THE DATA IN TO THE TABLE)

CREATE OR REPLACE package body APPS.xx_po_pu_det_pkg
is
/*
Procedure to read data from flat file
*/
    procedure pur_dat_prc(x_errbuf OUT VARCHAR2
                        ,X_RETCODE OUT VARCHAR2
                        ,P_FILE_PATH IN VARCHAR2
                        ,P_FIL_NAME IN VARCHAR2
                        )
is

v_file_type         utl_file.file_type;
v_data              varchar2(1000);

v_vendor_number         po_vendors.segment1%type;
v_vendor_name           po_vendors.vendor_name%type;
v_vendor_site_code      po_vendor_sites_all.vendor_site_code%type;
v_po_number             po_headers_all.segment1%type;

begin
    v_file_type := utl_file.fopen(P_FILE_PATH,P_FIL_NAME,'R');
    loop
        begin
 --       fnd_file.put_line(fnd_file.output,'Start Loop');
        utl_file.get_line(v_file_type,v_data);
        fnd_file.put_line(fnd_file.output,'Data => '||v_data);
    select substr(v_data,1,instr(v_data,',',1)-1)
    into v_vendor_number
    from dual;
   
    select substr(v_data,instr(v_data,',',1,1)+1,instr(v_data,',',1,2)-(instr(v_data,',',1,1)+1))
    into v_vendor_name
    from dual;

    select substr(v_data,instr(v_data,',',1,2)+1,instr(v_data,',',1,3)-(instr(v_data,',',1,2)+1))
    into v_vendor_site_code 
    from dual;

    select substr(v_data,instr(v_data,',',1,3)+1,length(v_data)-(instr(v_data,',',1,3)))
    into v_po_number
    from dual;

    insert into XX_PO_PUR_DET_STG
    values(
    v_vendor_number
    ,v_vendor_name
    ,v_vendor_site_code
    ,v_po_number
    );
   
    exception
        when utl_file.invalid_path then
            fnd_file.put_line(fnd_file.output,'Invalid file path');       
        when utl_file.invalid_mode then
            fnd_file.put_line(fnd_file.output,'Invalid Mode');
        when utl_file.invalid_filehandle then
            fnd_file.put_line(fnd_file.output,'Invalid file handle');
        when utl_file.invalid_operation then
            fnd_file.put_line(fnd_file.output,'Invalid file operation');
        when utl_file.read_error then
            fnd_file.put_line(fnd_file.output,'Read error');
        when no_data_found then
            exit;
        when others then
           fnd_file.put_line(fnd_file.output,'Others exception => '||SQLERRM);    
        end;
    end loop;
--    fnd_file.put_line(fnd_file.output,'after end loop');
    utl_file.fclose(v_file_type);
--    fnd_file.put_line(fnd_file.output,'after close');
exception
    when others then
        fnd_file.put_line(fnd_file.log,'Exception in procedure pur_dat_prc => '||SQLERRM);
end pur_dat_prc;           
end xx_po_pu_det_pkg;
/

APPS TABLES(PO,APS,GL,OM,INV,AR)

 Purchase Order : (PO)
----------------
1.po_requisition_headers_all -- requisition header info
2.po_requisition_lines_all   -- Requisition Lines info
3.po_req_distributions_all   -- Requisition Distribution info
4.po_headers_all             -- PO Header Info
5.po_lines_all               -- PO Line Info
6.po_line_locations_all      -- PO Line Shipment info
7.po_distributions_all       -- PO Distribution info
8.rcv_shipment_headers       -- Receiving header info
9.rcv_shipment_lines         -- Receiving Lines info
10.rcv_transactions          -- Receiving transationd info
11.po_vendors                -- Supplier Header info
12.po_vendor_sites_all       -- Supplier Site info
13.po_vendor_site_contacts   -- Supplier Site Contact info
14.hr_locations              -- Supplier Site Address

Order Management (OM) :
------------------------
1.oe_order_headers_all    -- Order Header info
2.oe_order_lines_all      -- Order line info
3.oe_transaction_types_tl -- Order type info
4.oe_order_holds          -- Order Hold info
4.oe_holds_all              -- Order Hold info
5.oe_hold_sources           -- Order Hold source info
6.oe_hold_releases        -- Hold Release info
7.wsh_delivery_details    -- Delivery Detial Info
8.wsh_new_deliveries      -- Delivery Header info
9.wsh_delivery_Assignments -- Delivery Assignments info
10.wsh_trip_stops          -- Delivery trips info
11.hz_cust_accounts        -- Customer info
12.hz_parties              -- Party info
13.hz_cust_site_uses_all   -- Customer site use info
14.hz_cust_acct_sites_all  -- Customer Site Acct info
15.hz_party_sites          -- Party site info
16.hz_locations            -- Customer Site Adderess
17.wsh_lookups             -- Shipping lookup info


Accounts Payable (AP):
---------------------
1.ap_invoices_all               -- Invoice Header info
2.ap_invoice_distributions_all  -- Invoice Line info
3.ap_checks_all                 -- Check info
4.ap_invoice_payments_all       -- Invoice Payment info
5.ap_payment_schedules_all      -- Payment Schedule info
6.ap_holds_all                  -- Invoice Holds info
7.ap_lookup_codes               -- Payable lookup info
8.po_vendors                -- Supplier Header info
9.po_vendor_sites_all       -- Supplier Site info
10.po_vendor_site_contacts   -- Supplier Site Contact info
11.hr_locations              -- Supplier Site Address
12.ap_banks                  -- Bank Info
13.ap_bank_branches          -- Bank Branch info
14.ap_ae_headers_all         -- Accounitng header info
15.ap_ae_lines_all           -- Accounting Lines info
16.ap_ae_accounting_evets    -- Accounting events info
17.ap_terms                  -- Payment Terms

Accounts Receivables (AR) :
--------------------------
1.ra_customer_trx_all     -- Receivable transaction info
2.ra_customer_trx_lines_all -- Transaction lines info
3.ra_cust_trx_line_gl_dist_all -- Transaction distribution info
4.ar_receivable_applications_all -- Receiving application info
5.ar_cash_Receipts_all           -- Cash Receipt info
6.ar_terms                       -- Receivable Terms
7.hz_cust_accounts        -- Customer info
8.hz_parties              -- Party info
9.hz_cust_site_uses_all   -- Customer site use info
10.hz_cust_acct_sites_all  -- Customer Site Acct info
11.hz_party_sites          -- Party site info
12.hz_locations            -- Customer Site Adderess

Invenvtory (INV) Module :
------------------------
1.mtl_System_items_b    -- Master item info
2.mtl_onhand_quanitties -- Item onhand qty info
3.mtl_reservations      -- Item Reservation info
4.mtl_material_transactions -- Item Transaction info
5.mtl_item_locations         -- Item location info
6,mtl_Categeries             -- Item Category info
7.mtl_item_categories        -- Invemtry Categry
8.mtl_secondary_inventories  -- Subinventories info
9.org_organization_definitions -- Organizaition info
10.mtl_transaction_Accounts    -- Item Transaction info
11.mtl_txn_source_types        -- Item Transaction sources
12.mtl_parameters              -- Inventory Parameters

General Ledger(GL) :
---------------------

1.gl_je_headers    -- Journal Header info
2.gl_je_lines      -- Journal Line info
3.gl_je_batches    -- Journal Batch info
4.gl_Sets_of_books -- set of books info
5.gl_chart_of_accoutns -- chart of accounts info
6.gl_code_combinations -- Code combination info
7.gl_je_sources        -- Journal Source info
8.gl_je_categories     -- Journal Cateogiy info
9.fnd_currencies       -- Currency info
10.gl_balances         -- Journal Balances