393: , p_lot_serial_number IN VARCHAR2
394: , p_attributes IN lot_sel_attributes_tbl_type) IS
395:
396: c_api_name CONSTANT VARCHAR2(30) := 'get_default';
397: v_flexfield fnd_dflex.dflex_r;
398: v_flexinfo fnd_dflex.dflex_dr;
399: v_contexts fnd_dflex.contexts_dr;
400: v_segments fnd_dflex.segments_dr;
401:
394: , p_attributes IN lot_sel_attributes_tbl_type) IS
395:
396: c_api_name CONSTANT VARCHAR2(30) := 'get_default';
397: v_flexfield fnd_dflex.dflex_r;
398: v_flexinfo fnd_dflex.dflex_dr;
399: v_contexts fnd_dflex.contexts_dr;
400: v_segments fnd_dflex.segments_dr;
401:
402: v_attributes_category VARCHAR2(50) :=NULL;
395:
396: c_api_name CONSTANT VARCHAR2(30) := 'get_default';
397: v_flexfield fnd_dflex.dflex_r;
398: v_flexinfo fnd_dflex.dflex_dr;
399: v_contexts fnd_dflex.contexts_dr;
400: v_segments fnd_dflex.segments_dr;
401:
402: v_attributes_category VARCHAR2(50) :=NULL;
403: v_global_code VARCHAR2(50);
396: c_api_name CONSTANT VARCHAR2(30) := 'get_default';
397: v_flexfield fnd_dflex.dflex_r;
398: v_flexinfo fnd_dflex.dflex_dr;
399: v_contexts fnd_dflex.contexts_dr;
400: v_segments fnd_dflex.segments_dr;
401:
402: v_attributes_category VARCHAR2(50) :=NULL;
403: v_global_code VARCHAR2(50);
404: i BINARY_INTEGER;
425: -- Get flexfield
426: IF (l_debug = 1) THEN
427: inv_log_util.trace('Get Flexfield ' || p_attributes_name, 'LOTSERATTR');
428: END IF;
429: fnd_dflex.get_flexfield('INV', p_attributes_name, v_flexfield, v_flexinfo);
430:
431: -- Get Contexts
432: fnd_dflex.get_contexts(v_flexfield, v_contexts);
433: IF (l_debug = 1) THEN
428: END IF;
429: fnd_dflex.get_flexfield('INV', p_attributes_name, v_flexfield, v_flexinfo);
430:
431: -- Get Contexts
432: fnd_dflex.get_contexts(v_flexfield, v_contexts);
433: IF (l_debug = 1) THEN
434: inv_log_util.trace('Get context ' , 'LOTSERATTR');
435: END IF;
436: /*bug 2474713 retrieve the context_column_name and the context_prompt */
460: -- Get segmentse
461: IF (l_debug = 1) THEN
462: inv_log_util.trace('get segment', 'LOTSERATTR');
463: END IF;
464: fnd_dflex.get_segments(fnd_dflex.make_context(
465: v_flexfield, v_contexts.context_code(i)), v_segments, TRUE);
466:
467: <
468: FOR j IN 1..v_segments.nsegments LOOP
528: x_attributes_default(v_rec_index).PROMPT := l_context_prompt;
529: END IF; /*bug2474713*/
530:
531: -- Get segments
532: fnd_dflex.get_segments(fnd_dflex.make_context(v_flexfield,
533: v_contexts.context_code(i)),
534: v_segments, TRUE);
535: <
536: FOR j IN 1..v_segments.nsegments LOOP
683: /* Returns the delimiter for the given dff
684: If flexfield is not found, then returns -1' */
685: FUNCTION get_delimiter(p_flex_name IN VARCHAR2,
686: p_application_short_name IN VARCHAR2) RETURN VARCHAR2 IS
687: v_flexfield fnd_dflex.dflex_r;
688: v_flexinfo fnd_dflex.dflex_dr;
689:
690: BEGIN
691:
684: If flexfield is not found, then returns -1' */
685: FUNCTION get_delimiter(p_flex_name IN VARCHAR2,
686: p_application_short_name IN VARCHAR2) RETURN VARCHAR2 IS
687: v_flexfield fnd_dflex.dflex_r;
688: v_flexinfo fnd_dflex.dflex_dr;
689:
690: BEGIN
691:
692: -- Get flexfield
689:
690: BEGIN
691:
692: -- Get flexfield
693: fnd_dflex.get_flexfield(p_application_short_name, p_flex_name, v_flexfield, v_flexinfo);
694: return(v_flexinfo.segment_delimeter);
695: EXCEPTION
696: WHEN OTHERS THEN
697: RETURN('-1');
707: p_organization_id IN NUMBER,
708: p_inventory_item_id IN NUMBER) RETURN NUMBER IS
709:
710: v_dflex_context_flag VARCHAR2(10);
711: v_flexfield fnd_dflex.dflex_r;
712: v_flexinfo fnd_dflex.dflex_dr;
713: v_contexts fnd_dflex.contexts_dr;
714: v_segments fnd_dflex.segments_dr;
715: v_attributes_category VARCHAR2(50) :=NULL;
708: p_inventory_item_id IN NUMBER) RETURN NUMBER IS
709:
710: v_dflex_context_flag VARCHAR2(10);
711: v_flexfield fnd_dflex.dflex_r;
712: v_flexinfo fnd_dflex.dflex_dr;
713: v_contexts fnd_dflex.contexts_dr;
714: v_segments fnd_dflex.segments_dr;
715: v_attributes_category VARCHAR2(50) :=NULL;
716: i BINARY_INTEGER;
709:
710: v_dflex_context_flag VARCHAR2(10);
711: v_flexfield fnd_dflex.dflex_r;
712: v_flexinfo fnd_dflex.dflex_dr;
713: v_contexts fnd_dflex.contexts_dr;
714: v_segments fnd_dflex.segments_dr;
715: v_attributes_category VARCHAR2(50) :=NULL;
716: i BINARY_INTEGER;
717: j BINARY_INTEGER;
710: v_dflex_context_flag VARCHAR2(10);
711: v_flexfield fnd_dflex.dflex_r;
712: v_flexinfo fnd_dflex.dflex_dr;
713: v_contexts fnd_dflex.contexts_dr;
714: v_segments fnd_dflex.segments_dr;
715: v_attributes_category VARCHAR2(50) :=NULL;
716: i BINARY_INTEGER;
717: j BINARY_INTEGER;
718:
794: p_organization_id IN NUMBER,
795: p_inventory_item_id IN NUMBER) RETURN NUMBER IS
796:
797: c_api_name CONSTANT VARCHAR2(30) := 'is_enabled';
798: v_flexfield fnd_dflex.dflex_r;
799: v_flexinfo fnd_dflex.dflex_dr;
800: v_contexts fnd_dflex.contexts_dr;
801: v_segments fnd_dflex.segments_dr;
802:
795: p_inventory_item_id IN NUMBER) RETURN NUMBER IS
796:
797: c_api_name CONSTANT VARCHAR2(30) := 'is_enabled';
798: v_flexfield fnd_dflex.dflex_r;
799: v_flexinfo fnd_dflex.dflex_dr;
800: v_contexts fnd_dflex.contexts_dr;
801: v_segments fnd_dflex.segments_dr;
802:
803: v_attributes_category VARCHAR2(50) :=NULL;
796:
797: c_api_name CONSTANT VARCHAR2(30) := 'is_enabled';
798: v_flexfield fnd_dflex.dflex_r;
799: v_flexinfo fnd_dflex.dflex_dr;
800: v_contexts fnd_dflex.contexts_dr;
801: v_segments fnd_dflex.segments_dr;
802:
803: v_attributes_category VARCHAR2(50) :=NULL;
804: i BINARY_INTEGER;
797: c_api_name CONSTANT VARCHAR2(30) := 'is_enabled';
798: v_flexfield fnd_dflex.dflex_r;
799: v_flexinfo fnd_dflex.dflex_dr;
800: v_contexts fnd_dflex.contexts_dr;
801: v_segments fnd_dflex.segments_dr;
802:
803: v_attributes_category VARCHAR2(50) :=NULL;
804: i BINARY_INTEGER;
805: j BINARY_INTEGER;
810:
811: v_is_enabled :=0;
812:
813: -- Get flexfield
814: fnd_dflex.get_flexfield('INV', p_flex_name, v_flexfield, v_flexinfo);
815:
816: -- Get Contexts
817: fnd_dflex.get_contexts(v_flexfield, v_contexts);
818:
813: -- Get flexfield
814: fnd_dflex.get_flexfield('INV', p_flex_name, v_flexfield, v_flexinfo);
815:
816: -- Get Contexts
817: fnd_dflex.get_contexts(v_flexfield, v_contexts);
818:
819: -- Get attributes category
820: get_context_code(
821: context_value => v_attributes_category
831: v_contexts.is_global(i))
832: ) THEN
833:
834: -- Get segments
835: fnd_dflex.get_segments(fnd_dflex.make_context(v_flexfield,
836: v_contexts.context_code(i)),
837: v_segments, TRUE);
838:
839: <
868: p_organization_id IN NUMBER,
869: p_inventory_item_id IN NUMBER) RETURN NUMBER IS
870:
871: c_api_name CONSTANT VARCHAR2(30) := 'is_enabled_segment';
872: v_flexfield fnd_dflex.dflex_r;
873: v_flexinfo fnd_dflex.dflex_dr;
874: v_contexts fnd_dflex.contexts_dr;
875: v_segments fnd_dflex.segments_dr;
876:
869: p_inventory_item_id IN NUMBER) RETURN NUMBER IS
870:
871: c_api_name CONSTANT VARCHAR2(30) := 'is_enabled_segment';
872: v_flexfield fnd_dflex.dflex_r;
873: v_flexinfo fnd_dflex.dflex_dr;
874: v_contexts fnd_dflex.contexts_dr;
875: v_segments fnd_dflex.segments_dr;
876:
877: v_attributes_category VARCHAR2(50) :=NULL;
870:
871: c_api_name CONSTANT VARCHAR2(30) := 'is_enabled_segment';
872: v_flexfield fnd_dflex.dflex_r;
873: v_flexinfo fnd_dflex.dflex_dr;
874: v_contexts fnd_dflex.contexts_dr;
875: v_segments fnd_dflex.segments_dr;
876:
877: v_attributes_category VARCHAR2(50) :=NULL;
878: i BINARY_INTEGER;
871: c_api_name CONSTANT VARCHAR2(30) := 'is_enabled_segment';
872: v_flexfield fnd_dflex.dflex_r;
873: v_flexinfo fnd_dflex.dflex_dr;
874: v_contexts fnd_dflex.contexts_dr;
875: v_segments fnd_dflex.segments_dr;
876:
877: v_attributes_category VARCHAR2(50) :=NULL;
878: i BINARY_INTEGER;
879: j BINARY_INTEGER;
884:
885: v_is_enabled :=0;
886:
887: -- Get flexfield
888: fnd_dflex.get_flexfield('INV', p_flex_name, v_flexfield, v_flexinfo);
889:
890: -- Get Contexts
891: fnd_dflex.get_contexts(v_flexfield, v_contexts);
892:
887: -- Get flexfield
888: fnd_dflex.get_flexfield('INV', p_flex_name, v_flexfield, v_flexinfo);
889:
890: -- Get Contexts
891: fnd_dflex.get_contexts(v_flexfield, v_contexts);
892:
893: -- Get attributes category
894: INV_LOT_SEL_ATTR.get_context_code(
895: context_value => v_attributes_category
905: v_contexts.is_global(i))
906: ) THEN
907:
908: -- Get segments
909: fnd_dflex.get_segments(fnd_dflex.make_context(v_flexfield,
910: v_contexts.context_code(i)),
911: v_segments, TRUE);
912:
913: <
982: /* BUG 5334967 */
983: l_precision NUMBER := 0;
984: l_index NUMBER := 0;
985:
986: l_flexfield fnd_dflex.dflex_r;
987: l_flexinfo fnd_dflex.dflex_dr;
988: l_contexts_info fnd_dflex.contexts_dr;
989: l_contexts fnd_dflex.context_r;
990: l_segments fnd_dflex.segments_dr;
983: l_precision NUMBER := 0;
984: l_index NUMBER := 0;
985:
986: l_flexfield fnd_dflex.dflex_r;
987: l_flexinfo fnd_dflex.dflex_dr;
988: l_contexts_info fnd_dflex.contexts_dr;
989: l_contexts fnd_dflex.context_r;
990: l_segments fnd_dflex.segments_dr;
991: l_attributes_category VARCHAR2(50) :=NULL;
984: l_index NUMBER := 0;
985:
986: l_flexfield fnd_dflex.dflex_r;
987: l_flexinfo fnd_dflex.dflex_dr;
988: l_contexts_info fnd_dflex.contexts_dr;
989: l_contexts fnd_dflex.context_r;
990: l_segments fnd_dflex.segments_dr;
991: l_attributes_category VARCHAR2(50) :=NULL;
992: l_global_code VARCHAR2(50);
985:
986: l_flexfield fnd_dflex.dflex_r;
987: l_flexinfo fnd_dflex.dflex_dr;
988: l_contexts_info fnd_dflex.contexts_dr;
989: l_contexts fnd_dflex.context_r;
990: l_segments fnd_dflex.segments_dr;
991: l_attributes_category VARCHAR2(50) :=NULL;
992: l_global_code VARCHAR2(50);
993: l_rec_index BINARY_INTEGER := 0;
986: l_flexfield fnd_dflex.dflex_r;
987: l_flexinfo fnd_dflex.dflex_dr;
988: l_contexts_info fnd_dflex.contexts_dr;
989: l_contexts fnd_dflex.context_r;
990: l_segments fnd_dflex.segments_dr;
991: l_attributes_category VARCHAR2(50) :=NULL;
992: l_global_code VARCHAR2(50);
993: l_rec_index BINARY_INTEGER := 0;
994:
1027: inv_trx_util_pub.trace('p_organization_id '||p_organization_id,'INV_LOT_SEL_ATTR',9);
1028: inv_trx_util_pub.trace('p_lot_serial_number '||p_lot_serial_number,'INV_LOT_SEL_ATTR',9);
1029: inv_trx_util_pub.trace('p_issue_receipt '||p_issue_receipt,'INV_LOT_SEL_ATTR',9);
1030: END IF;
1031: fnd_dflex.get_flexfield('INV', p_attributes_name, l_flexfield, l_flexinfo);
1032: -- Get Contexts
1033: fnd_dflex.get_contexts(l_flexfield, l_contexts_info);
1034: --Retrieve the context column name also --bug#2474713
1035: l_context_column_name := l_flexinfo.context_column_name;
1029: inv_trx_util_pub.trace('p_issue_receipt '||p_issue_receipt,'INV_LOT_SEL_ATTR',9);
1030: END IF;
1031: fnd_dflex.get_flexfield('INV', p_attributes_name, l_flexfield, l_flexinfo);
1032: -- Get Contexts
1033: fnd_dflex.get_contexts(l_flexfield, l_contexts_info);
1034: --Retrieve the context column name also --bug#2474713
1035: l_context_column_name := l_flexinfo.context_column_name;
1036: --Adding for bug 6636904
1037: l_context_prompt := l_flexinfo.form_context_prompt;
1107: x_lot_serial_attributes(l_rec_index).PROMPT := l_context_prompt;
1108: END IF; /*bug #2474713 */
1109:
1110: --Get segments
1111: l_contexts := fnd_dflex.make_context(l_flexfield, l_contexts_info.context_code(i));
1112: fnd_dflex.get_segments(l_contexts, l_segments, TRUE);
1113: ---dbms_output.put_line('number of segment is ' || l_segments.nsegments);
1114: IF (l_debug=1) THEN
1115: debug('No of Segments ' ||l_segments.nsegments ,l_module_name,l_debug_level);
1108: END IF; /*bug #2474713 */
1109:
1110: --Get segments
1111: l_contexts := fnd_dflex.make_context(l_flexfield, l_contexts_info.context_code(i));
1112: fnd_dflex.get_segments(l_contexts, l_segments, TRUE);
1113: ---dbms_output.put_line('number of segment is ' || l_segments.nsegments);
1114: IF (l_debug=1) THEN
1115: debug('No of Segments ' ||l_segments.nsegments ,l_module_name,l_debug_level);
1116: END IF;
1424: AND lot_number = p_lot_number;
1425:
1426: l_inv_attr inv_attr%ROWTYPE;
1427: l_context VARCHAR2(1000);
1428: l_context_r fnd_dflex.context_r;
1429: l_contexts_dr fnd_dflex.contexts_dr;
1430: l_dflex_r fnd_dflex.dflex_r;
1431: l_segments_dr fnd_dflex.segments_dr;
1432: l_global_context BINARY_INTEGER;
1425:
1426: l_inv_attr inv_attr%ROWTYPE;
1427: l_context VARCHAR2(1000);
1428: l_context_r fnd_dflex.context_r;
1429: l_contexts_dr fnd_dflex.contexts_dr;
1430: l_dflex_r fnd_dflex.dflex_r;
1431: l_segments_dr fnd_dflex.segments_dr;
1432: l_global_context BINARY_INTEGER;
1433: l_nsegments BINARY_INTEGER;
1426: l_inv_attr inv_attr%ROWTYPE;
1427: l_context VARCHAR2(1000);
1428: l_context_r fnd_dflex.context_r;
1429: l_contexts_dr fnd_dflex.contexts_dr;
1430: l_dflex_r fnd_dflex.dflex_r;
1431: l_segments_dr fnd_dflex.segments_dr;
1432: l_global_context BINARY_INTEGER;
1433: l_nsegments BINARY_INTEGER;
1434:
1427: l_context VARCHAR2(1000);
1428: l_context_r fnd_dflex.context_r;
1429: l_contexts_dr fnd_dflex.contexts_dr;
1430: l_dflex_r fnd_dflex.dflex_r;
1431: l_segments_dr fnd_dflex.segments_dr;
1432: l_global_context BINARY_INTEGER;
1433: l_nsegments BINARY_INTEGER;
1434:
1435: BEGIN
1457:
1458: x_return_status := 'S';
1459: l_dflex_r.application_id := 401;
1460: l_dflex_r.flexfield_name := 'MTL_LOT_NUMBERS';
1461: fnd_dflex.get_contexts(flexfield => l_dflex_r, contexts => l_contexts_dr);
1462: l_global_context := l_contexts_dr.global_context;
1463: l_context := l_contexts_dr.context_code(l_global_context);
1464:
1465: /* Prepare the context_r type for getting the segments associated with the global context */
1465: /* Prepare the context_r type for getting the segments associated with the global context */
1466: l_context_r.flexfield := l_dflex_r;
1467: l_context_r.context_code := l_context;
1468:
1469: fnd_dflex.get_segments(CONTEXT => l_context_r, segments => l_segments_dr, enabled_only => TRUE);
1470:
1471: /* read through the segments */
1472:
1473: l_nsegments := l_segments_dr.nsegments;
1494:
1495: l_context_r.flexfield := l_dflex_r;
1496: l_context_r.context_code := l_context;
1497:
1498: fnd_dflex.get_segments(CONTEXT => l_context_r, segments => l_segments_dr, enabled_only => TRUE);
1499: l_nsegments := l_segments_dr.nsegments;
1500: FOR i IN 1..l_nsegments LOOP
1501:
1502: x_inv_lot_attributes(substr(l_segments_dr.application_column_name(i),instr(l_segments_dr.application_column_name(i),'ATTRIBUTE')+9)).column_name :=l_segments_dr.application_column_name(i);
1599:
1600: l_inv_attr inv_attr%ROWTYPE;
1601: l_inv_ship_attr inv_ship_attr%ROWTYPE;
1602: l_context VARCHAR2(1000);
1603: l_context_r fnd_dflex.context_r;
1604: l_contexts_dr fnd_dflex.contexts_dr;
1605: l_dflex_r fnd_dflex.dflex_r;
1606: l_segments_dr fnd_dflex.segments_dr;
1607: l_global_context BINARY_INTEGER;
1600: l_inv_attr inv_attr%ROWTYPE;
1601: l_inv_ship_attr inv_ship_attr%ROWTYPE;
1602: l_context VARCHAR2(1000);
1603: l_context_r fnd_dflex.context_r;
1604: l_contexts_dr fnd_dflex.contexts_dr;
1605: l_dflex_r fnd_dflex.dflex_r;
1606: l_segments_dr fnd_dflex.segments_dr;
1607: l_global_context BINARY_INTEGER;
1608: l_nsegments BINARY_INTEGER;
1601: l_inv_ship_attr inv_ship_attr%ROWTYPE;
1602: l_context VARCHAR2(1000);
1603: l_context_r fnd_dflex.context_r;
1604: l_contexts_dr fnd_dflex.contexts_dr;
1605: l_dflex_r fnd_dflex.dflex_r;
1606: l_segments_dr fnd_dflex.segments_dr;
1607: l_global_context BINARY_INTEGER;
1608: l_nsegments BINARY_INTEGER;
1609:
1602: l_context VARCHAR2(1000);
1603: l_context_r fnd_dflex.context_r;
1604: l_contexts_dr fnd_dflex.contexts_dr;
1605: l_dflex_r fnd_dflex.dflex_r;
1606: l_segments_dr fnd_dflex.segments_dr;
1607: l_global_context BINARY_INTEGER;
1608: l_nsegments BINARY_INTEGER;
1609:
1610: BEGIN
1790:
1791: x_return_status := 'S';
1792: l_dflex_r.application_id := 401;
1793: l_dflex_r.flexfield_name := 'MTL_SERIAL_NUMBERS';
1794: fnd_dflex.get_contexts(flexfield => l_dflex_r, contexts => l_contexts_dr);
1795: l_global_context := l_contexts_dr.global_context;
1796: l_context := l_contexts_dr.context_code(l_global_context);
1797:
1798: /* Prepare the context_r type for getting the segments associated with the global context */
1798: /* Prepare the context_r type for getting the segments associated with the global context */
1799: l_context_r.flexfield := l_dflex_r;
1800: l_context_r.context_code := l_context;
1801:
1802: fnd_dflex.get_segments(CONTEXT => l_context_r, segments => l_segments_dr, enabled_only => TRUE);
1803: debug('after calling fnd_dflex.get_segments', 'GET_INV_SERIAL_ATTR', 9);
1804:
1805: /* read through the segments */
1806:
1799: l_context_r.flexfield := l_dflex_r;
1800: l_context_r.context_code := l_context;
1801:
1802: fnd_dflex.get_segments(CONTEXT => l_context_r, segments => l_segments_dr, enabled_only => TRUE);
1803: debug('after calling fnd_dflex.get_segments', 'GET_INV_SERIAL_ATTR', 9);
1804:
1805: /* read through the segments */
1806:
1807: l_nsegments := l_segments_dr.nsegments;
1846:
1847: l_context_r.flexfield := l_dflex_r;
1848: l_context_r.context_code := l_context;
1849:
1850: fnd_dflex.get_segments(CONTEXT => l_context_r, segments => l_segments_dr, enabled_only => TRUE);
1851: l_nsegments := l_segments_dr.nsegments;
1852: FOR i IN 1..l_nsegments LOOP
1853: debug('application column name is ' || l_segments_dr.application_column_name(i), 'GET_INV_SERIAL_ATTR', 9);
1854: x_inv_serial_attributes(substr(l_segments_dr.application_column_name(i),