DBA Data[Home] [Help]

APPS.OPI_DBI_INV_VALUE_INIT_PKG dependencies on STANDARD

Line 381: -- For standard costing orgs, get the cost as of the

377:
378:
379: -- Get costs as of the inception date.
380: --
381: -- For standard costing orgs, get the cost as of the
382: -- last cost update prior to the global start date.
383: --
384: -- For layer costing orgs, get the first transaction from MMT after the
385: -- global start date for each org, item, cost group and pick the

Line 392: -- cost group id from mtl_parameters for standard costing orgs. For

388: -- The cost method for all orgs is a non-null column of the
389: -- mtl_parameters table.
390: --
391: -- Since we want cost group information, use the non-null default
392: -- cost group id from mtl_parameters for standard costing orgs. For
393: -- layer costing orgs, get the cost group from MMT and if that is
394: -- null, then replace it with default cost group.
395:
396: l_stmt_num :=10;

Line 400: l_debug_msg := 'for standard costing organization';

396: l_stmt_num :=10;
397: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
398: l_debug_msg := 'Inserting data into OPI_DBI_INV_BEG_STG from inception date less than gsd';
399: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
400: l_debug_msg := 'for standard costing organization';
401: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
402: END IF;
403:
404:

Line 408: -- ideally max is not required as standard cost

404:
405: UPDATE OPI_DBI_INV_BEG_STG fact
406: SET (onhand_value_b ,intransit_value_b) =
407: (SELECT /*+ ordered use_hash(csc2, csc) parallel(csc2) parallel(csc)*/
408: -- ideally max is not required as standard cost
409: -- revision date is timestamp.
410: max(csc.standard_cost) *onhand_qty onhand_value_b,
411: max(csc.standard_cost) *intransit_qty intransit_value_b
412: FROM (

Line 410: max(csc.standard_cost) *onhand_qty onhand_value_b,

406: SET (onhand_value_b ,intransit_value_b) =
407: (SELECT /*+ ordered use_hash(csc2, csc) parallel(csc2) parallel(csc)*/
408: -- ideally max is not required as standard cost
409: -- revision date is timestamp.
410: max(csc.standard_cost) *onhand_qty onhand_value_b,
411: max(csc.standard_cost) *intransit_qty intransit_value_b
412: FROM (
413: SELECT /*+ use_hash(p csc) parallel(csc)
414: parallel(mtl_parameters) */

Line 411: max(csc.standard_cost) *intransit_qty intransit_value_b

407: (SELECT /*+ ordered use_hash(csc2, csc) parallel(csc2) parallel(csc)*/
408: -- ideally max is not required as standard cost
409: -- revision date is timestamp.
410: max(csc.standard_cost) *onhand_qty onhand_value_b,
411: max(csc.standard_cost) *intransit_qty intransit_value_b
412: FROM (
413: SELECT /*+ use_hash(p csc) parallel(csc)
414: parallel(mtl_parameters) */
415: csc.organization_id,

Line 419: max(standard_cost_revision_date) standard_cost_revision_date,

415: csc.organization_id,
416: csc.inventory_item_id,
417: -- this is a a timestamp hence max would
418: -- give unique record.
419: max(standard_cost_revision_date) standard_cost_revision_date,
420: p.primary_cost_method cost_method,
421: NULL cost_group_id -- RS: Bug fix 5219487 p.default_cost_group_id cost_group_id
422: FROM mtl_parameters p,
423: cst_standard_costs csc

Line 423: cst_standard_costs csc

419: max(standard_cost_revision_date) standard_cost_revision_date,
420: p.primary_cost_method cost_method,
421: NULL cost_group_id -- RS: Bug fix 5219487 p.default_cost_group_id cost_group_id
422: FROM mtl_parameters p,
423: cst_standard_costs csc
424: -- not using <= below because txns are
425: -- collected from GSD onward. hence if there is
426: -- any cost update as of GSD additional 24 txns
427: -- will come in separately.

Line 428: WHERE standard_cost_revision_date < g_global_start_date

424: -- not using <= below because txns are
425: -- collected from GSD onward. hence if there is
426: -- any cost update as of GSD additional 24 txns
427: -- will come in separately.
428: WHERE standard_cost_revision_date < g_global_start_date
429: AND p.primary_cost_method = 1
430: AND p.organization_id = csc.organization_id
431: GROUP BY csc.organization_id,
432: csc.inventory_item_id,

Line 436: cst_standard_costs csc

432: csc.inventory_item_id,
433: p.primary_cost_method,
434: p.default_cost_group_id
435: ) csc2,
436: cst_standard_costs csc
437: WHERE csc.organization_id = csc2.organization_id
438: AND csc.inventory_item_id = csc2.inventory_item_id
439: AND csc.standard_cost_revision_date = csc2.standard_cost_revision_date
440: and fact.organization_id = csc2.organization_id

Line 439: AND csc.standard_cost_revision_date = csc2.standard_cost_revision_date

435: ) csc2,
436: cst_standard_costs csc
437: WHERE csc.organization_id = csc2.organization_id
438: AND csc.inventory_item_id = csc2.inventory_item_id
439: AND csc.standard_cost_revision_date = csc2.standard_cost_revision_date
440: and fact.organization_id = csc2.organization_id
441: and fact.inventory_item_id =csc2.inventory_item_id
442: -- and fact.cost_group_id =csc2.cost_group_id -- RS: Bug fix 5219487
443: -- and fact.cost_method =csc.cost_method

Line 457: l_debug_msg := 'for standard costing organization';

453: l_stmt_num := 20;
454: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
455: l_debug_msg := 'Updated staging table OPI_DBI_INV_BEG_STG from inception date greater than gsd';
456: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
457: l_debug_msg := 'for standard costing organization';
458: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
459: END IF;
460:
461:

Line 506: (select 1 from cst_standard_costs csc

502: AND new_cost is not null
503: AND ((stg.onhand_value_b is null and nvl(stg.onhand_qty,0) <> 0 )
504: OR (stg.intransit_value_b is null and nvl(stg.intransit_qty,0) <> 0 ))
505: and exists
506: (select 1 from cst_standard_costs csc
507: where stg.inventory_item_id = csc.inventory_item_id
508: AND stg.organization_id = csc.organization_id
509: and standard_cost_revision_date >= g_global_start_date)
510: GROUP BY mmt.organization_id,

Line 509: and standard_cost_revision_date >= g_global_start_date)

505: and exists
506: (select 1 from cst_standard_costs csc
507: where stg.inventory_item_id = csc.inventory_item_id
508: AND stg.organization_id = csc.organization_id
509: and standard_cost_revision_date >= g_global_start_date)
510: GROUP BY mmt.organization_id,
511: mmt.inventory_item_id -- ,
512: -- nvl (mmt.cost_group_id, p.default_cost_group_id), --RS: Bug fix 5219487
513: -- p.primary_cost_method

Line 531: l_debug_msg := 'updated data into OPI_DBI_INV_BEG_STG for standard costing organization';

527: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
528:
529: l_stmt_num := 30;
530: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
531: l_debug_msg := 'updated data into OPI_DBI_INV_BEG_STG for standard costing organization';
532: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
533: l_debug_msg := 'form cst_item_costs for which cost is not found till now';
534: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
535: END IF;

Line 538: -- step 3 for standard costing org items.

534: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
535: END IF;
536:
537:
538: -- step 3 for standard costing org items.
539: -- as mentioned in step2 for the items where there are no
540: -- cost updates prior and post GSD the item cost is available
541: -- in CIC. Hence for such items update the cost.
542:

Line 560: l_debug_msg := 'updating data into OPI_DBI_INV_BEG_STG for Non standard costing organization';

556: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
557:
558: l_stmt_num := 40;
559: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
560: l_debug_msg := 'updating data into OPI_DBI_INV_BEG_STG for Non standard costing organization';
561: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
562: END IF;
563:
564:

Line 615: l_debug_msg := 'updating data into OPI_DBI_INV_BEG_STG for Non standard costing organization';

611: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
612:
613: l_stmt_num := 50;
614: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
615: l_debug_msg := 'updating data into OPI_DBI_INV_BEG_STG for Non standard costing organization';
616: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
617: END IF;
618:
619:

Line 656: -- standard costs for an item. Added items with no standard cost

652: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
653: END IF;
654:
655: -- 11.5.10 change to match costing team's method for obtaining
656: -- standard costs for an item. Added items with no standard cost
657: -- before global start date. For these items, we are adding the
658: -- earliest cost after or on the global start date
659:
660: EXCEPTION

Line 1005: -- transaction. For standard costing orgs, use the default

1001: -- Select all intransit data from MMT into a temp table.
1002: --
1003: --
1004: -- Additionally, pick up a cost group associated with each
1005: -- transaction. For standard costing orgs, use the default
1006: -- cost group associated with the organization in MTL_PARAMETERS.
1007: -- As of 11i, the default_cost_group_id is guaranteed to be
1008: -- non-null, so no nvl is needed on the selection of that column.
1009: