Wednesday, 23 December 2015

PLA balance not matching with India PLA register report

PLA balance not matching with India PLA register report
The following India localization balances not matching with India PLA Register

India Localization > Registers > View Register Balance Form > PLA Balance

India Localization > Registers >PLA View Transactions Form > PLA Balance

India Localization > Registers > RG Consolidation Screen Form > PLA balance

Solution 1.

Step 1. Due to the lower version of the JAINPLA file.
1. Download and review the readme and pre-requisites for Patch.'19132611' 

2. Ensure that you have taken a backup of your system before applying 
the recommended patch. 

3. Apply the patch in a TEST environment. 

4. Confirm the following file versions: 
JAINPLA.rdf 120.6.12010000.7 
You can use the commands like the following: 
strings -a $XX_TOP/filename |grep '$Header' 

5. Retest the issue by creating fresh transaction. 

6. Migrate the solution as appropriate to other environments. 

Step 2. Issue in Invalid and Incorrect data
The cause of the issue is invalid / incorrect data in below tables 
JAI_CMN_RG_23AC_II_TRXS , 
JAI_CMN_RG_PLA_TRXS , 
JAI_CMN_RG_OTHERS , 
JAI_CMN_RG_OTH_BALANCES , 
JAI_CMN_RG_PERIOD_BALS . 
RG View PLA Balances And India - PLA Register Report Are Not Matching. ( Doc ID 1534016.1 ) 

Solution 2

Data fix Script Bug : 16196925

REM +======================================================================+
REM | Copyright (c) 2011 Oracle Corporation Redwood Shores, California, USA|
REM |                       All rights reserved.                           |
REM +======================================================================+
REM NAME
REM b16196925.sql
REM DESCRIPTION
REM
REM NOTES
REM
REM +======================================================================+
REM dbdrv: phase=compile

SET VERIFY OFF
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR  EXIT FAILURE ROLLBACK;

Declare

CURSOR GET_MISMATCH_RECORDS
IS
select TRX.SLNO ,hdr.pla_ID
from JAI_CMN_RG_PLA_TRXS trx ,
     JAI_CMN_RG_PLA_HDRS hdr
where trx.organization_id=hdr.organization_id
and trx.location_id=hdr.location_id
and trx.slno<>hdr.pla_rg_sr_no
and trx.tr6_challan_no=hdr.tr6_number
and hdr.ack_recvd_flag='Y'
and hdr.pla_amount is not null
and trx.organization_id=&p_organization_id
and trx.location_id=&p_location_id;

Cursor get_miss_entries
is
select trx.register_id,trx.creation_date, hdr.pla_id
from JAI_CMN_RG_PLA_TRXS trx ,
     JAI_CMN_RG_PLA_HDRS hdr
where trx.organization_id=hdr.organization_id
and trx.location_id=hdr.location_id
and trx.tr6_challan_no=hdr.tr6_number
and hdr.ack_recvd_flag='Y'
and hdr.pla_amount is not null
and trx.organization_id=&p_organization_id
and trx.location_id=&p_location_id
and not exists (select 1
                  from JAI_CMN_RG_OTHERS 
                                                                          where source_type=2
                                                                            and source_register_id=trx.register_id)             ;


Cursor get_cess_amts(cp_pla_id in number)
is
select sum(nvl(edu_cess_excise_amount, 0)),
       sum(nvl(sh_cess_excise_amount, 0))
  from JAI_CMN_RG_PLA_DTLS
 where pla_id = cp_pla_id   ;

ln_cess_amt number;
ln_sh_cess_amt number;

Begin

FOR MISMATCH_REC IN GET_MISMATCH_RECORDS
LOOP

 UPDATE JAI_CMN_RG_PLA_HDRS
   SET pla_rg_sr_no = MISMATCH_REC.SLNO,
       LAST_UPDATED_BY = -16196925
  WHERE PLA_ID = MISMATCH_REC.PLA_ID;

COMMIT;

END loop;


for miss_rec in get_miss_entries
Loop

 ln_cess_amt := null;
 ln_sh_cess_amt := null;

   open  get_cess_amts(miss_rec.pla_id);
   fetch get_cess_amts into ln_cess_amt,ln_sh_cess_amt;
   close get_cess_amts;

if NVL(ln_cess_amt,0) <> 0
then 
 
 Insert into JAI_CMN_RG_OTHERS
    (
    rg_other_id              ,          
    source_type              ,           
    source_register          ,            
    source_register_id       ,
    tax_type                 , 
    credit                   ,
    debit                    ,
    created_by               ,
    creation_date            ,
    last_updated_by          ,
    last_update_date         ,
    last_update_login      
    )
    Values
    (
    JAI_CMN_RG_OTHERS_s.nextval     ,
    2                           ,
    'PLA'                       ,
    miss_rec.register_id        ,
    'EXCISE_EDUCATION_CESS'     ,
    ln_cess_amt                 ,
    NULL                        ,
    fnd_global.user_id          ,
    miss_rec.creation_date      ,
    '-16196925'                 ,
    sysdate                     ,
    fnd_global.login_id
    );

end if;


if NVL(ln_sh_cess_amt,0) <> 0
then

      
 Insert into JAI_CMN_RG_OTHERS
    (
    rg_other_id              ,          
    source_type              ,           
    source_register          ,            
    source_register_id       ,
    tax_type                 , 
    credit                   ,
    debit                    ,
    created_by               ,
    creation_date            ,
    last_updated_by          ,
    last_update_date         ,
    last_update_login      
    )
    Values
    (
    JAI_CMN_RG_OTHERS_s.nextval      ,
    2                            ,
    'PLA'                        ,
    miss_rec.register_id         ,
    'EXCISE_SH_EDU_CESS'         ,
    ln_sh_cess_amt               ,
    NULL                         ,
    fnd_global.user_id           ,
    miss_rec.creation_date       ,
    '-16196925'                  ,
    sysdate                      ,
    fnd_global.login_id
    );

end if;

end loop;

COMMIT;
 
END;
/

COMMIT;
EXIT;

Thursday, 19 November 2015

Oracle Patch for Swachh Bharat Cess

Oracle E-Business Suite Release 12: Swachh Bharat Cess effective from November 15, 2015 (Doc ID 2077765.1)

https://support.oracle.com/epmos/adf/images/t.gif

APPLIES TO:
Oracle Financials for Asia/Pacific
Oracle Financials for India
Information in this document applies to any platform.
MAIN CONTENT
Purpose:
The objective of this note is to advise customers about the availability of a patch to support configuration of Swachh Bharat Cess.
Central Board of Excise and Customs through Notification No. 21 and 22 dated November 6, 2015 announced that Swachh Bharat Cess @0.5% will be introduced with effect from November 15, 2015. The new Cess would be applicable for all services that are subject to levy of Service tax. The taxable basis for computation of Swachh Bharat Cess will be on the value of Taxable Services that is currently applicable for computation of Service tax.
Central Board of Excise and Customs had not made any announcement on the admissibility of input tax credit on Swachh Bharat Cess. In the absence of any specified notifications amending the Cenvat credit Rules, it is interpreted that Swachh Bharat Cess is not a recoverable tax and no Cenvat Credit is permitted.
All open orders for Taxable Services need to be modified to incorporate the impact of Swachh Bharat Cess.

Applicable to:
Oracle E-Business Suite Release 12.2.3 and 12.1.3

Solution:
The patch will enable our customers to configure Swachh Bharat Cess. The patch will pre-seed a new look up code for Swachh Bharat Cess under the Asia-Pacific look up against the look up type JAI_TAX_TYPE.
Customers are required to configure Swachh Bharat Cess by defining required tax codes, mapping them to the newly added tax type (Swachh Bharat Cess) and then reconfigure the regime attributes for Service Tax regime.

Implementation:
The guidelines below will help customers in configuring Swachh Bharat Cess.
• Define New Tax Codes and define the tax attributes for Swachh Bharat Cess, picking Swachh Bharat Cess as the tax type. Based on your business requirements, ensure that the tax rates and attributes are correctly defined
• Configure Swachh Bharat Cess in the relevant regime registration details, assign account values for different tax accounts under Swachh Bharat Cess and map it to the relevant organizations.Ensure that that your configuration for Swachh Bharat Cess is consistent to your Service Tax configuration
• Create required new tax categories with permutation and combination of tax codes which are required for computing taxes applicable under the Service Tax regime. Ensure that combinations of applicable Service Tax and Swachh Bharat Cess are appropriately configured ensuring that Service tax and Swachh Bharat Cess will be computed on the same taxable basis.
• Apply new tax categories, which will have Service Tax and Swachh Bharat Cess computed, to the tax defaulting rules
All open orders for taxable services as on 15th November 2015 that are subject to service tax need to be amended to incorporate the applicability of Swachh Bharat Cess. Organizations will have to re-configure their tax defaulting logic for taxable services incorporating Swachh Bharat Cess and ensure that Swachh Bharat Cess is applied for taxable transactions that are subject to levy of service tax.
The following guidelines may be used to configure the tax rate changes. Organizations will have to re-configure their tax defaulting logic incorporating Swachh Bharat Cess.
• India Mass Tax Recalculation: Organizations need to define a new tax category with the grouping of tax codes with applicable tax rates for Service Tax and Swachh Bharat cess, and then submit the India Mass Tax Recalculation program by selecting the old tax category and the new tax category which will update open documents. This also provides an option of overriding manually added taxes.
Customers are advised to apply the patch in their test instance and carry out the required test cycles before moving to Production.

Download Details:
Following patches are released and are available for download from My Oracle Support.
22177605:R12.JAI.B -12.1.3
22177605:R12.JAI.C -12.2.3

Monday, 7 September 2015

CSTPAVCP.calc_average_cost ORA-1426 Numeric Overflow - Error in Actual Cost worker



CSTPAVCP.calc_average_cost ORA-1426 Numeric Overflow - Error in Actual Cost worker
After "Completion Transaction of the Discrete job. "Actual Cost worker" Completed with error

Error log file attached. mtl_material_transactions table have the error line as"CSTPAVCP.calc_average_cost (30): ORA-01426: numeric overflow"

Applies to:

Oracle Cost Management - Version 12.1.1 and later
Symptoms
On R12.x in Production:
Within an organization that is using average costing method, one transaction is stuck with an error  in mtl_material_transactions (MMT)
with the ERROR below. This same error MSG is showing
in the  log of the Actual Cost Worker (CMCACW), such as :
ERROR
COSTED_FLAG=E
ERROR_CODE=No Error
ERROR_EXPLANATION= CSTPAVCP.calc_average_cost (30): ORA-01426: numeric overflow
+
Logfile of CMCACW  shows:
CSTPAVCP.calc_average_cost (30): ORA-01426: numeric overflow
Failing Transaction ID is xxxxx

STEPS
The issue can be reproduced at will with the following steps:
1. /INV/Transactions / Material Transactions
for org=VPM
TAB Reason_Reference :
Costed=Error
error_code=No Error
error_explanation=CSTPAVCP.calc_average_cost (30): ORA-1426: numeric overflow

Cause

The cause of the issue is invalid data in tables
CST_LAYER_COST_DETAILS and CST_QUANTITY_LAYERS
The "costs fields" are rounded to more than 30 characters

Bug 5855020 was logged for this specific customer to receive a datafix from Oracle
Development:

The following SQL identified the invalid data:
a) First  identify the transaction in ERROR in mtl_material_transactions, with :
COSTED_FLAG=E
ERROR_CODE=No Error
ERROR_EXPLANATION=
CSTPAVCP.calc_average_cost (30): ORA-01426: numeric overflow

b) Second, for this transaction in error,  find out the value of layer_id :
 SELECT layer_id, inventory_item_id, organization_id,
 cost_group_id
 FROM cst_quantity_layers
 WHERE organization_id = &org_id
 AND inventory_item_id = &item_id
 AND cost_group_id = &cost_group_id
 .
 For a Non WMS, Non project Enabled Org, the Cost Group id would be the
 default cost group id of the Organization. The Item_id and Org_id values
 correspond to the transaction that errs with the reported issue.

Solution

To implement the solution, please execute the following steps:

DATA FIX
-----------
1. Ensure to take a backup of the system before applying the recommended solution.
   Such as : make backup of following tables :
      - CST_QUANTITY_LAYERS and
      - CST_LAYER_COST_DETAILS and
      - MTL_MATERIAL_TRANSACTIONS for the errored transaction
               create table mtl_material_txn_bkup
               as select * from mtl_material_transactions
              Where costed_flag='E';

2. Run the following scripts in a TEST environment first:

 a- Cancel the Cost Manager (cf Note 373207.1)

 b- Run the update scripts for the layer_id identified above :

 UPDATE CST_LAYER_COST_DETAILS
 SET item_cost = ROUND(item_cost, 40)
 WHERE layer_id = &layer_id;
 commit;

 UPDATE CST_QUANTITY_LAYERS
 SET item_cost = ROUND(item_cost, 40),
 PL_MATERIAL = ROUND(PL_MATERIAL, 40),
 TL_MATERIAL = ROUND(TL_MATERIAL, 40),
 MATERIAL_COST = ROUND(MATERIAL_COST, 40),
 PL_ITEM_COST = ROUND(PL_ITEM_COST, 40),
 TL_ITEM_COST = ROUND(TL_ITEM_COST, 40),
 UNBURDENED_COST = ROUND(UNBURDENED_COST, 40)
 WHERE layer_id = &layer_id;

 COMMIT;

c- Resubmit the errored transactions

    update mtl_material_transactions MMT
    set MMT.costed_flag = 'N',
    MMT.error_code = NULL,
    MMT.error_explanation = NULL,
    MMT.transaction_group_id = NULL,
    MMT.transaction_set_id = NULL
    where MMT.organization_id = ‘&organization_id’
    and MMT.costed_flag in ('N','E')
    and NOT  EXISTS ( SELECT 1
         FROM MTL_TRANSACTION_ACCOUNTS MTA
        WHERE MMT.TRANSACTION_ID = MTA.TRANSACTION_ID);

    commit;

d- Re-Start the cost manager

e- wait for the worker to complete, and check the result.

f- check that the transaction is now costed with success.

3. If you are satisfied that the issue is resolved, migrate the solution as appropriate to other environments.

4. Root Cause
  
    a. Download and review the readme and pre-requisites forPatch.18791666:R12.BOM.C (or higher)
    b. Ensure that you have taken a backup of your system before applying the recommended patch.
    c. Apply the patch in a test environment.
    d. Confirm the following file versions:
        CSTAVCPB.pls 120.36.12010000.23 (or higher)
        cmlmcw.lpc 120.3.12010000.10 (or higher
 
        You can use the commands like the following:
        Strings -a $BOM_TOP/patch/115/sql/CSTAVCPB.pls | grep '$Header'

    e. Retest the issue.
    f. Migrate the solution as appropriate to other environments.