1: PACKAGE BODY CSTPLMWI AS
2: /* $Header: CSTLMWIB.pls 120.1 2011/07/26 06:55:02 lchevala ship $ */
3:
4:
5:
341:
342: EXCEPTION
343: WHEN invalid_qty_table_exception THEN
344: o_err_num := 1001;
345: o_err_msg := 'CSTPLMWI.wip_layer_create():' ||
346: to_char(l_stmt_num) || ':' ||
347: 'i_layer_qty_table IS NULL';
348: RETURN 0;
349:
348: RETURN 0;
349:
350: WHEN invalid_inv_layer_exception THEN
351: o_err_num := 1002;
352: o_err_msg := 'CSTPLMWI.wip_layer_create():' ||
353: to_char(l_stmt_num) || ':' ||
354: 'Inventory returned invalid layer ' ||
355: to_char( i_layer_qty_table(i).layer_id );
356: RETURN 0;
356: RETURN 0;
357:
358: WHEN no_inv_cost_details_exception THEN
359: o_err_num := 1003;
360: o_err_msg := 'CSTPLMWI.wip_layer_create():' ||
361: to_char(l_stmt_num) || ':' ||
362: 'Inventory missing layer cost details ' ||
363: i_layer_qty_table(i).layer_id;
364: RETURN 0;
364: RETURN 0;
365:
366: WHEN OTHERS THEN
367: o_err_num := SQLCODE;
368: o_err_msg := 'CSTPLMWI.wip_layer_create():' ||
369: to_char(l_stmt_num) || ':' ||
370: to_char( i_layer_qty_table(i).layer_id ) || ':' ||
371: substr(SQLERRM,1,150);
372: RETURN 0;
460: o_err_num OUT NOCOPY NUMBER,
461: o_err_msg OUT NOCOPY VARCHAR2
462: ) RETURN cst_wip_layers%ROWTYPE
463: IS
464: l_layer_cursor CSTPLMWI.REF_CURSOR_TYPE;
465: l_layer cst_wip_layers%ROWTYPE;
466: l_sql_stmt VARCHAR2(8000);
467: l_stmt_num NUMBER(15);
468: BEGIN
467: l_stmt_num NUMBER(15);
468: BEGIN
469:
470: l_stmt_num := 10;
471: l_sql_stmt := CSTPLMWI.wip_layer_consume_sql
472: (
473: to_char( NULL ),
474: CSTPLMWI.LIFO,
475: CSTPLMWI.NORMAL
470: l_stmt_num := 10;
471: l_sql_stmt := CSTPLMWI.wip_layer_consume_sql
472: (
473: to_char( NULL ),
474: CSTPLMWI.LIFO,
475: CSTPLMWI.NORMAL
476: );
477:
478: l_stmt_num := 20;
471: l_sql_stmt := CSTPLMWI.wip_layer_consume_sql
472: (
473: to_char( NULL ),
474: CSTPLMWI.LIFO,
475: CSTPLMWI.NORMAL
476: );
477:
478: l_stmt_num := 20;
479: open l_layer_cursor for l_sql_stmt
491:
492: EXCEPTION
493: WHEN OTHERS THEN
494: o_err_num := SQLCODE;
495: o_err_msg := 'CSTPLMWI.get_last_layer():' ||
496: to_char(l_stmt_num) || ':' ||
497: substr(SQLERRM,1,150);
498:
499: END get_last_layer;
526: IS
527: l_stmt_num NUMBER;
528:
529: l_inv_layer_id NUMBER;
530: l_layer_qty_table CSTPLMWI.LayerQtyRecTable;
531: l_wip_layer_id NUMBER;
532:
533: l_err_code VARCHAR2(2000);
534:
712: RETURN;
713: END IF;
714: end if; /* l_exp_item_flag <> 1 */
715:
716: l_layer_qty_table := CSTPLMWI.LayerQtyRecTable();
717: l_layer_qty_table.EXTEND;
718: if (l_exp_item_flag <> 1) then
719: l_layer_qty_table( l_layer_qty_table.LAST ).layer_id := l_inv_layer_id;
720: else
723: l_layer_qty_table( l_layer_qty_table.LAST ).layer_qty := 0;
724:
725:
726: l_stmt_num := 60;
727: l_wip_layer_id := CSTPLMWI.wip_layer_create
728: (
729: i_wip_entity_id,
730: i_op_seq_num,
731: i_inv_item_id,
751:
752: EXCEPTION
753: WHEN invalid_inv_layer_exception THEN
754: o_err_num := 1005;
755: o_err_msg := 'CSTPLMWI.init_wip_layers():' ||
756: to_char(l_stmt_num) || ':' ||
757: 'FIFO Inventory returned invalid current inv layer';
758: RETURN;
759:
758: RETURN;
759:
760: WHEN OTHERS THEN
761: o_err_num := SQLCODE;
762: o_err_msg := 'CSTPLMWI.init_wip_layers():' ||
763: to_char(l_stmt_num) || ':' ||
764: substr(SQLERRM,1,150);
765:
766: END init_wip_layers;
808:
809: EXCEPTION
810: WHEN OTHERS THEN
811: o_err_num := SQLCODE;
812: o_err_msg := 'CSTPLMWI.reset_temp_values():' ||
813: to_char(l_stmt_num) || ':' ||
814: substr(SQLERRM,1,150);
815:
816: END reset_temp_columns;
818:
819:
820:
821:
822: END CSTPLMWI;