Pages

OracleEBSpro is purely for knowledge sharing and learning purpose, with the main focus on Oracle E-Business Suite Product and other related Oracle Technologies.

I'm NOT responsible for any damages in whatever form caused by the usage of the content of this blog.

I share my Oracle knowledge through this blog. All my posts in this blog are based on my experience, reading oracle websites, books, forums and other blogs. I invite people to read and suggest ways to improve this blog.


Tuesday, July 16, 2013

API for Updating Category Assignment of an item (NV_ITEM_CATEGORY_PUB.UPDATE_CATEGORY_ASSIGNMENT)

This script was tested in R12.1.3

DECLARE

  v_return_status      VARCHAR2(1) := NULL;
  v_msg_count          NUMBER      := 0;
  v_msg_data           VARCHAR2(2000);
  v_errorcode          VARCHAR2(1000);
  v_category_id        NUMBER; 
  v_old_category_id    NUMBER;
  v_category_set_id    NUMBER; 
  v_inventory_item_id  NUMBER; 
  v_organization_id    NUMBER;
  v_context            VARCHAR2(2);

  FUNCTION set_context( i_user_name    IN  VARCHAR2
                       ,i_resp_name    IN  VARCHAR2
                       ,i_org_id       IN  NUMBER)
  RETURN VARCHAR2
  IS
  BEGIN
  NULL;
  -- In order to reduce the content of the post I moved the implementation part of this function to another post and it is   available here  
  END set_context;
BEGIN
v_context := set_context ('&user', '&responsibility', 2038);
IF v_context = 'F'
   THEN
   DBMS_OUTPUT.put_line ('Error while setting the context');
END IF;

--- context done ------------
v_old_category_id    := 9233;
v_category_id        := 13125; 
v_category_set_id    := 1;
v_inventory_item_id  := 66003;
v_organization_id    := 103;

INV_ITEM_CATEGORY_PUB.UPDATE_CATEGORY_ASSIGNMENT
        (  p_api_version        => 1.0, 
           p_init_msg_list      => FND_API.G_TRUE, 
           p_commit             => FND_API.G_FALSE, 
           x_return_status      => v_return_status, 
           x_errorcode          => v_errorcode, 
           x_msg_count          => v_msg_count, 
           x_msg_data           => v_msg_data, 
           p_old_category_id    => v_old_category_id,
           p_category_id        => v_category_id, 
           p_category_set_id    => v_category_set_id, 
           p_inventory_item_id  => v_inventory_item_id, 
           p_organization_id    => v_organization_id);

IF v_return_status = fnd_api.g_ret_sts_success THEN
    COMMIT;
    DBMS_OUTPUT.put_line ('Updation of category assigment is Sucessfull : '||v_category_id);
ELSE
    DBMS_OUTPUT.put_line ('Updation of category assigment failed:'||v_msg_data);
    ROLLBACK;
    FOR i IN 1 .. v_msg_count
    LOOP
      v_msg_data := oe_msg_pub.get( p_msg_index => i, p_encoded => 'F');
      dbms_output.put_line( i|| ') '|| v_msg_data);
    END LOOP;
END IF;
END;

Friday, July 12, 2013

Deferred COGS Accounting in R12

The deferred COGS of goods account is the new feature introduced in Release 12. The basic fundamental behind the enhancement is that the COGS is now directly matched to the Revenue. The same was not possible till now.

Prior to this enhancement, the value of goods shipped from inventory were expensed to COGS upon ship confirm, despite the fact that revenue may not yet have been earned on that shipment. With this enhancement, the value of goods shipped from inventory will be put in a Deferred COGS account. As percentages of Revenue are recognized, a matching percentage of the value of goods shipped from inventory will be moved from the Deferred COGS account to the COGS account, thus synchronizing
the recognition of revenue and COGS in accordance with the recommendations of generally accepted accounting principles.

The Matching Principle is a fundamental accounting directive that mandates that revenue and its associated cost of goods sold must be recognized in the same accounting period. This enhancement will automate the matching of Cost of Goods Sold (COGS) for a sales order line to the revenue that is billed for that sales order line.

The deferral of COGS applies to sales orders of both non-configurable and configurable items (Pick-To-Order and Assemble-To-Order). It applies to sales orders from the customer facing operating units in the case of drop shipments when the new accounting flow introduced in 11.5.10 is used. And finally, it also applies to RMAs that references a sales order whose COGS was deferred. Such RMAs will be accounted using the original sales order cost in such a way that it will maintain the latest known COGS recognition percentage. If RMAs are tied to a sales order, RMAs will be accounted for such that the distribution of credits between deferred COGS and actual COGS will maintain the existing proportion that Costing is aware of.  If RMAs are not tied to a sales order, there is no deferred COGS.
SETUP and ACCOUNTING :

To set the deferred COGS account.

Inventory -- Setup -- Organization -- Parameters -- Other Accounts
A new account is added which is referred as the Deferred COGS accounts. 
Please note that when upgrading from a pre R12 version the DEFERRED_COGS_ACCOUNT will be populated if it is null with the cost_of_goods_sold_account on the organization parameter. This can then be changed accordingly if a different account is required.

NEW ACCOUNTING :

Release 12 : 
When a Sales order is shipped the following accounting takes place:

Inventory Valuation Account : Credit.
                   Deferred COGS account : Debit

Once the revenue is recognised, you would need to decide the percentage you wish to recognize the Revenue. A COGS recognition transaction will be created to reflect a change in the revenue recognition percentage for a sales order line.

The steps to generate such transactions are as follows:
1. Run the Collect Revenue Recognition Information program. This program will collect the change in revenue recognition percentage based on AR events within the user specified date range.
2. Run the Generate COGS Recognition Events. This program will create the COGS recognition transaction for each sales order line where there is a mismatch between the latest revenue recognition percentage and the current COGS recognition percentage.

Note that users can choose how often they want to create the COGS Recognition Events.

Navigation to run the COGS recognition request :
- Cost > COGS Recognition > Collect Revenue Recognition Information
- Cost > COGS Recognition > Generate COGS Recognition Events
- Cost > View Transactions > Material Transactions


The distribution for the COGS Recognition transaction associated with the Sales Order transaction now would be as follows:

       Deferred COGS : Debit revenue percentage
       COGS               : Credit (Actual revenue percentage )

Thus, essentially the recognized COGS balance is to move the value from Deferred COGS to COGS.

This particular COGS recognition transaction actually correspond to a revenue recognition percentage change.

You can view the transactions as :
Navigation:
- Cost > View Transactions > Material Transactions > Distributions

A new COGS Revenue Matching Report shows the revenue and COGS information of sales order that fall within the user specified date range by sales order line


SIMPLER TERMS ( Table level details ) : 
Once the whole cycle is complete we will have 2 transactions lines in mtl_material_transactions.

1. Sales Order
2. COGS Recognition transaction

Accounting will be in mtl_transaction_accounts and the Subledger accounting tables as follows:

Transaction 1:
Inventory Valuation Account : Credit. (item_cost)
             Deferred COGS account : Debit (item_cost) 
Transaction 2:
Deferred COGS : Credit (Actual revenue percentage)
              COGS : Debit (Actual revenue percentage ) 

What is difference between Cycle counting and Physical Inventory in Oracle Apps?

Physical Inventory or Cycle counting is used to streamline the inventory of the items within warehouse and the inventory shown in the sytem ( that is to tally the actual inventory and the on hand showing in the system).

A physical inventory is done once a year to check and correct the accuracy of your inventory.  Often used by banks to audit their investment into your company or to simply reset your stock levels so that inventory is correct and customer service is not impacted by wrong information.

A cycle counts purpose is to find systemic problems, it is NOT intended to ensure your inventory accuracy or fix your on hand quantities.  Those are mere bi-products of a cycle
count. 

All inventories will have different classification of products called A,B,C,D classification.  These classes are defined by the importance  and movement of a product where an A item is high dollar / high mover, and a D item is something that is identified by the dust it has on the
shelf. 

A cycle count filters through your inventory over a course of a year. A company may choose to count all their A items 4 times a year, B items 3 times a year, C items twice, and D once. 

The theory behind the Cycle Count is to monitor yours systems (processes and procedures).  Are you pulling parts correctly, are they marked correctly, is paperwork being processed, is the receiving dept. counting items on the inbound, are product bar coded correctly, is a bill of
material correct, theft, and a hundred other things that could possibly cause your inventory to go out of balance. 

A cycle count finds those flaws and offers you a chance to
correct them. 

The reason an A item is counted more often than a D is not
because of Value $$, yet because it is subjected to your
processes a lot more.  Assuming you have a very solid
system/process, you constantly test it (via Cycle Counts),
and you apply that same exact process to an A item as you
do a D, there is a very high probablility that your
inventory accuracy on the D item will be as accurate as
your A, even though you only counted it once in a years
span.

Lastly, a good cycle count has a Hit of Miss criteria. 
There are always going to be acceptable levels of
tolerance.  Simply put, do we really care if we are off by
1 or 2 pcs. of a $0.01 part that we stock THOUSANDS of? 
NO!  So we identify those tolerances.  If your counts fall
with in those tolerances, you have a HIT (good thing).  IF
they fall outside of the tolerance you have a MISS (bad
thing). 

Misses are investigated.  Problems researched and solutions
secured.  THEN as a final measure you would schedule the
MISS for a future cycle count, say in a couple of weeks to
ensure the fix worked, the process is functioning and the
system is good.  

Some differences of the CC and physical inventory is as follows

1)cycle counting can be done  on specific items or selective items 
But in physical inventory we have to count all items.

2)cycle counting can be done multiple time in an year , like monthly or quarterly for high value items but physical count is done once an year or at the most twice for all the items.


3)Cycle Count : We can schedule the count
Physical Inventory : We cannot schedule this.

4)Cycle Count : We cannot have a snap shot
Physical Inventory : We can have a snap shot

5)Cycle Count : We can view the qty in the system
Physical Inventory : We can not view the qty in system

6)Cycle Count : We cane select the items using ABC analysis.
Physical Inventory : It is done for all the items.

7)Cycle Count : We need not to freeze inventory transactions.
Physical Inventory : Need to freeze inventory transactions.

8)Cycle Count : Recount is possible
Physical Inventory : Recount is not possible.

9)Cycle Count : We can maintain recount history.
Physical Inventory : No recount, hence no history.

10)Cycle Count : Adjustments can be procesed on approval.
Physical Inventory : Can be done using adjustment concurrent program

Profile Options to be Enabled for personalizations in Forms and OA Framework pages in Oracle Apps

Following are the Profile options that needs to be Enabled for enabling personalization in Oracle Apps forms and OA Frame work pages.

1)Utilities : Diagnostics set to 'NO'
2)Hide Diagnostics   set to 'NO'
3) Personalize Self-Service Defn set to 'Yes'
4)FND: Personalization Region Link Enabled set to 'Minimal' or 'YES'
5)FND :Diagnostic  set to 'YES'

Delete Cache in Oracle Apps R12



Many people are still are not aware on how to delete cache without taking DBA's help.

Here is the Navigation for the same

1)Go to Functional Administrator
2)Click on Core Services Tab
3)Click on Caching Framework Tab
4)Within Caching framework click on Global configuration
5)Under Cache policy click on "Clear ALL Cache" Button
5) Click on Apply

Thursday, July 11, 2013

Oe_interfaced_flag and Inv_interfaced_flag in wsh_delivery_details table


This post is about 2 Important fields in wsh_delivery_details table from the Order Management and Inventory point of view.

These 2 flags/fields are
  1. oe_interfaced_flag
  2. inv_interfaced_flag
these plays very important role during the ship confirm process.
As I have stated in many of my posts on ITS that interface Trip Stop(ITS)has 2 parts
  1. Order Management and 
  2. Inventory. 
OM part will takes care of updating the fields in oe_order_lines_all tables like shipping_quantity , shipped_quantity etc and INV part take care of releasing the reservation once OM part is done.

NOTE - Inventort part of the ITS always exected once OM part exected successfully.

If OM part of ITS has executed , but INV is not yet exected because of some issues then oe_interfaced_flag = Y and inv_interfaced_flag remains = X(Pending) or N . In such case we have 2 options run the ITS again  ( but this time it will executed INV part only and release the reservation and decrement the stock) , or run the "Inventory Interface Concurrent Program"

But many a time I have noticed that delivery is shipped and shipped/shipping qty etc fields got populated , but oe_interfaced_flag = N and INV_interfaced-flag = N and every run of ITS try to ryn the OM Part and erroring out( as action that should be perofrmed by ITS has already completed). In such case one good option is update oe_interfaced_flag = Y and then run ITS gain or run inventory Interface.