20: -- 21-JUL-98 Created
21: -- 06-APR-01 Edited by DBOWLES Added new function find_Flex_Prompt.
22: -- function returns the translated form prompt for the flex segment.
23: -- Added overloaded procedure concatenate_Tables to accept
24: -- types of BIS_VG_TYPES.Flex_Column_Comment_Table_Type.
25: -- 11-DEC-01 Edited by DBOWLES Added dr driver comments.
26: --
27: G_PKG_NAME CONSTANT VARCHAR(30) := 'BIS_VG_UTIL';
28: -- ============================================================================
83: --
84: --
85: PROCEDURE create_Text_Table
86: ( p_String IN VARCHAR2
87: , x_View_Table OUT bis_vg_types.View_Text_Table_Type
88: , x_return_status OUT VARCHAR2
89: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
90: )
91: IS
281: END get_string_len30;
282: --
283: --
284: FUNCTION get_string
285: ( p_view_table IN bis_vg_types.View_Text_Table_Type
286: , p_start_pointer IN bis_vg_types.View_Character_Pointer_Type
287: , p_end_pointer IN bis_vg_types.View_Character_Pointer_Type
288: , x_return_status OUT VARCHAR2
289: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
282: --
283: --
284: FUNCTION get_string
285: ( p_view_table IN bis_vg_types.View_Text_Table_Type
286: , p_start_pointer IN bis_vg_types.View_Character_Pointer_Type
287: , p_end_pointer IN bis_vg_types.View_Character_Pointer_Type
288: , x_return_status OUT VARCHAR2
289: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
290: )
283: --
284: FUNCTION get_string
285: ( p_view_table IN bis_vg_types.View_Text_Table_Type
286: , p_start_pointer IN bis_vg_types.View_Character_Pointer_Type
287: , p_end_pointer IN bis_vg_types.View_Character_Pointer_Type
288: , x_return_status OUT VARCHAR2
289: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
290: )
291: RETURN VARCHAR2
291: RETURN VARCHAR2
292: IS
293: l_ret VARCHAR2(32000);
294: l_str VARCHAR2(32000);
295: end_pointer bis_vg_types.view_character_pointer_type;
296: BEGIN
297:
298: BIS_DEBUG_PUB.Add('> get_string');
299: x_return_status := FND_API.G_RET_STS_SUCCESS;
370:
371: END get_string;
372:
373: FUNCTION get_char
374: ( p_view_table IN bis_vg_types.View_Text_Table_Type
375: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
376: , x_return_status OUT VARCHAR2
377: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
378: )
371: END get_string;
372:
373: FUNCTION get_char
374: ( p_view_table IN bis_vg_types.View_Text_Table_Type
375: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
376: , x_return_status OUT VARCHAR2
377: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
378: )
379: RETURN VARCHAR2
401:
402: END get_char;
403:
404: FUNCTION increment_pointer
405: ( p_view_table IN bis_vg_types.View_Text_Table_Type
406: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
407: , x_return_status OUT VARCHAR2
408: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
409: )
402: END get_char;
403:
404: FUNCTION increment_pointer
405: ( p_view_table IN bis_vg_types.View_Text_Table_Type
406: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
407: , x_return_status OUT VARCHAR2
408: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
409: )
410: RETURN bis_vg_types.view_character_pointer_type
406: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
407: , x_return_status OUT VARCHAR2
408: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
409: )
410: RETURN bis_vg_types.view_character_pointer_type
411: is
412: l_str VARCHAR2(2000);
413: l_pointer bis_vg_types.view_character_pointer_type;
414: begin
409: )
410: RETURN bis_vg_types.view_character_pointer_type
411: is
412: l_str VARCHAR2(2000);
413: l_pointer bis_vg_types.view_character_pointer_type;
414: begin
415: BIS_DEBUG_PUB.Add('> increment_pointer');
416: x_return_status := FND_API.G_RET_STS_SUCCESS;
417: l_str := p_view_table(p_pointer.row_num);
450: END increment_pointer;
451:
452: -- concatenates p_View_Table_A with p_View_Table_B
453: PROCEDURE concatenate_Tables
454: ( p_View_Table_A IN BIS_VG_TYPES.View_Text_Table_Type
455: , p_View_Table_B IN BIS_VG_TYPES.View_Text_Table_Type
456: , x_View_Table OUT BIS_VG_TYPES.View_Text_Table_Type
457: , x_return_status OUT VARCHAR2
458: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
451:
452: -- concatenates p_View_Table_A with p_View_Table_B
453: PROCEDURE concatenate_Tables
454: ( p_View_Table_A IN BIS_VG_TYPES.View_Text_Table_Type
455: , p_View_Table_B IN BIS_VG_TYPES.View_Text_Table_Type
456: , x_View_Table OUT BIS_VG_TYPES.View_Text_Table_Type
457: , x_return_status OUT VARCHAR2
458: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
459: )
452: -- concatenates p_View_Table_A with p_View_Table_B
453: PROCEDURE concatenate_Tables
454: ( p_View_Table_A IN BIS_VG_TYPES.View_Text_Table_Type
455: , p_View_Table_B IN BIS_VG_TYPES.View_Text_Table_Type
456: , x_View_Table OUT BIS_VG_TYPES.View_Text_Table_Type
457: , x_return_status OUT VARCHAR2
458: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
459: )
460: IS
493: END concatenate_Tables;
494: --
495: --
496: PROCEDURE concatenate_Tables
497: ( p_View_Table_A IN BIS_VG_TYPES.Flex_Column_Comment_Table_Type
498: , p_View_Table_B IN BIS_VG_TYPES.Flex_Column_Comment_Table_Type
499: , x_View_Table OUT BIS_VG_TYPES.Flex_Column_Comment_Table_Type
500: , x_return_status OUT VARCHAR2
501: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
494: --
495: --
496: PROCEDURE concatenate_Tables
497: ( p_View_Table_A IN BIS_VG_TYPES.Flex_Column_Comment_Table_Type
498: , p_View_Table_B IN BIS_VG_TYPES.Flex_Column_Comment_Table_Type
499: , x_View_Table OUT BIS_VG_TYPES.Flex_Column_Comment_Table_Type
500: , x_return_status OUT VARCHAR2
501: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
502: )
495: --
496: PROCEDURE concatenate_Tables
497: ( p_View_Table_A IN BIS_VG_TYPES.Flex_Column_Comment_Table_Type
498: , p_View_Table_B IN BIS_VG_TYPES.Flex_Column_Comment_Table_Type
499: , x_View_Table OUT BIS_VG_TYPES.Flex_Column_Comment_Table_Type
500: , x_return_status OUT VARCHAR2
501: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
502: )
503: IS
536: END concatenate_Tables;
537: --
538: --
539: FUNCTION equal_pointers
540: ( p_start_pointer IN BIS_VG_TYPES.view_character_pointer_type
541: , p_end_pointer IN BIS_VG_TYPES.view_character_pointer_type
542: , x_return_status OUT VARCHAR2
543: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
544: )
537: --
538: --
539: FUNCTION equal_pointers
540: ( p_start_pointer IN BIS_VG_TYPES.view_character_pointer_type
541: , p_end_pointer IN BIS_VG_TYPES.view_character_pointer_type
542: , x_return_status OUT VARCHAR2
543: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
544: )
545: RETURN BOOLEAN IS
588: END equal_pointers;
589: --
590: --
591: PROCEDURE copy_part_of_Table
592: ( p_View_Table_A IN BIS_VG_TYPES.View_Text_Table_Type
593: , p_start_pointer IN BIS_VG_TYPES.view_character_pointer_type
594: , p_end_pointer IN BIS_VG_TYPES.view_character_pointer_type
595: , x_View_Table OUT BIS_VG_TYPES.View_Text_Table_Type
596: , x_return_status OUT VARCHAR2
589: --
590: --
591: PROCEDURE copy_part_of_Table
592: ( p_View_Table_A IN BIS_VG_TYPES.View_Text_Table_Type
593: , p_start_pointer IN BIS_VG_TYPES.view_character_pointer_type
594: , p_end_pointer IN BIS_VG_TYPES.view_character_pointer_type
595: , x_View_Table OUT BIS_VG_TYPES.View_Text_Table_Type
596: , x_return_status OUT VARCHAR2
597: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
590: --
591: PROCEDURE copy_part_of_Table
592: ( p_View_Table_A IN BIS_VG_TYPES.View_Text_Table_Type
593: , p_start_pointer IN BIS_VG_TYPES.view_character_pointer_type
594: , p_end_pointer IN BIS_VG_TYPES.view_character_pointer_type
595: , x_View_Table OUT BIS_VG_TYPES.View_Text_Table_Type
596: , x_return_status OUT VARCHAR2
597: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
598: )
591: PROCEDURE copy_part_of_Table
592: ( p_View_Table_A IN BIS_VG_TYPES.View_Text_Table_Type
593: , p_start_pointer IN BIS_VG_TYPES.view_character_pointer_type
594: , p_end_pointer IN BIS_VG_TYPES.view_character_pointer_type
595: , x_View_Table OUT BIS_VG_TYPES.View_Text_Table_Type
596: , x_return_status OUT VARCHAR2
597: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
598: )
599: IS
713: COMMENT : Call this procedure to print the view text.
714: EXCEPTION : None
715: ========================================================================== */
716: PROCEDURE print_View_Text --{
717: ( p_View_Text_Table IN BIS_VG_TYPES.View_Text_Table_Type
718: , x_return_status OUT VARCHAR2
719: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
720: )
721: IS
762: COMMENT : Call this procedure to print the view text.
763: EXCEPTION : None
764: ============================================================================ */
765: PROCEDURE print_View_pointer --{
766: ( p_pointer IN BIS_VG_TYPES.View_character_pointer_type
767: , x_return_status OUT VARCHAR2
768: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
769: )
770: IS
809: EXCEPTION : None
810: ============================================================================ */
811: -- remove th trailing characters in the table which are there in the p_str
812: FUNCTION position_before_characters
813: ( p_View_Text_Table IN BIS_VG_TYPES.view_text_table_type
814: , p_str IN VARCHAR2
815: , x_return_status OUT VARCHAR2
816: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
817: )
814: , p_str IN VARCHAR2
815: , x_return_status OUT VARCHAR2
816: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
817: )
818: RETURN bis_vg_types.view_character_pointer_type
819: IS
820: l_pointer bis_vg_types.view_character_pointer_type;
821: BEGIN
822: BIS_DEBUG_PUB.Add('> position_before_characters');
816: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
817: )
818: RETURN bis_vg_types.view_character_pointer_type
819: IS
820: l_pointer bis_vg_types.view_character_pointer_type;
821: BEGIN
822: BIS_DEBUG_PUB.Add('> position_before_characters');
823: x_return_status := FND_API.G_RET_STS_SUCCESS;
824: l_pointer.row_num := p_view_text_table.COUNT;
865: EXCEPTION : None
866: ============================================================================ */
867: -- remove th trailing characters in the table which are there in the p_str
868: FUNCTION position_before_characters
869: ( p_View_Text_Table IN BIS_VG_TYPES.view_text_table_type
870: , p_str IN VARCHAR2
871: , p_pointer IN bis_vg_types.view_character_pointer_type
872: , x_return_status OUT VARCHAR2
873: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
867: -- remove th trailing characters in the table which are there in the p_str
868: FUNCTION position_before_characters
869: ( p_View_Text_Table IN BIS_VG_TYPES.view_text_table_type
870: , p_str IN VARCHAR2
871: , p_pointer IN bis_vg_types.view_character_pointer_type
872: , x_return_status OUT VARCHAR2
873: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
874: )
875: RETURN bis_vg_types.view_character_pointer_type
871: , p_pointer IN bis_vg_types.view_character_pointer_type
872: , x_return_status OUT VARCHAR2
873: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
874: )
875: RETURN bis_vg_types.view_character_pointer_type
876: IS
877: l_pointer bis_vg_types.view_character_pointer_type;
878: l_char VARCHAR2(1);
879: l_pos NUMBER;
873: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
874: )
875: RETURN bis_vg_types.view_character_pointer_type
876: IS
877: l_pointer bis_vg_types.view_character_pointer_type;
878: l_char VARCHAR2(1);
879: l_pos NUMBER;
880: BEGIN
881: BIS_DEBUG_PUB.Add('> position_before_characters');
950: END position_before_characters;
951:
952: -- decrements pointer by one
953: FUNCTION decrement_pointer
954: ( p_view_table IN bis_vg_types.View_Text_Table_Type
955: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
956: , x_return_status OUT VARCHAR2
957: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
958: )
951:
952: -- decrements pointer by one
953: FUNCTION decrement_pointer
954: ( p_view_table IN bis_vg_types.View_Text_Table_Type
955: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
956: , x_return_status OUT VARCHAR2
957: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
958: )
959: RETURN bis_vg_types.view_character_pointer_type
955: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
956: , x_return_status OUT VARCHAR2
957: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
958: )
959: RETURN bis_vg_types.view_character_pointer_type
960: IS
961: l_str VARCHAR2(2000);
962: l_pointer bis_vg_types.view_character_pointer_type;
963: BEGIN
958: )
959: RETURN bis_vg_types.view_character_pointer_type
960: IS
961: l_str VARCHAR2(2000);
962: l_pointer bis_vg_types.view_character_pointer_type;
963: BEGIN
964: BIS_DEBUG_PUB.Add('> decrement_pointer');
965: x_return_status := FND_API.G_RET_STS_SUCCESS;
966:
1005: END decrement_pointer;
1006:
1007: -- return TRUE if pointer is a null
1008: FUNCTION null_pointer
1009: (p_pointer IN bis_vg_types.view_character_pointer_type
1010: , x_return_status OUT VARCHAR2
1011: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
1012: )
1013: RETURN BOOLEAN
1042: END null_pointer;
1043:
1044: -- returns the row pointed to by the pointer
1045: FUNCTION get_row
1046: ( p_view_table IN bis_vg_types.View_Text_Table_Type
1047: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
1048: , x_return_status OUT VARCHAR2
1049: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
1050: )
1043:
1044: -- returns the row pointed to by the pointer
1045: FUNCTION get_row
1046: ( p_view_table IN bis_vg_types.View_Text_Table_Type
1047: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
1048: , x_return_status OUT VARCHAR2
1049: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
1050: )
1051: RETURN bis_vg_types.view_text_table_rec_type
1047: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
1048: , x_return_status OUT VARCHAR2
1049: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
1050: )
1051: RETURN bis_vg_types.view_text_table_rec_type
1052: IS
1053: BEGIN
1054: IF ( null_pointer ( p_pointer
1055: , x_return_status
1083: END get_row;
1084:
1085: -- increments the pointer to next row
1086: FUNCTION increment_pointer_by_row
1087: ( p_view_table IN bis_vg_types.View_Text_Table_Type
1088: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
1089: , x_return_status OUT VARCHAR2
1090: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
1091: )
1084:
1085: -- increments the pointer to next row
1086: FUNCTION increment_pointer_by_row
1087: ( p_view_table IN bis_vg_types.View_Text_Table_Type
1088: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
1089: , x_return_status OUT VARCHAR2
1090: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
1091: )
1092: RETURN bis_vg_types.view_character_pointer_type
1088: , p_pointer IN bis_vg_types.View_Character_Pointer_Type
1089: , x_return_status OUT VARCHAR2
1090: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
1091: )
1092: RETURN bis_vg_types.view_character_pointer_type
1093: IS
1094: l_pointer bis_vg_types.view_character_pointer_type;
1095: BEGIN
1096: BIS_DEBUG_PUB.Add('> increment_pointer_by_row ');
1090: , x_error_Tbl OUT BIS_VG_UTIL.Error_Tbl_Type
1091: )
1092: RETURN bis_vg_types.view_character_pointer_type
1093: IS
1094: l_pointer bis_vg_types.view_character_pointer_type;
1095: BEGIN
1096: BIS_DEBUG_PUB.Add('> increment_pointer_by_row ');
1097: x_return_status := FND_API.G_RET_STS_SUCCESS;
1098: IF ( null_pointer ( p_pointer
1185: )
1186: IS
1187: BEGIN
1188: IF (fnd_msg_pub.check_msg_level(p_msg_level) = TRUE) THEN
1189: fnd_message.set_name(BIS_VG_TYPES.message_application, p_msg_name);
1190: fnd_msg_pub.ADD;
1191: END IF;
1192:
1193: EXCEPTION
1221: IS
1222:
1223: BEGIN
1224: IF (fnd_msg_pub.check_msg_level(p_msg_level) = TRUE) THEN
1225: fnd_message.set_name(BIS_VG_TYPES.message_application, p_msg_name);
1226: fnd_message.set_token(p_token1, p_value1);
1227: fnd_msg_pub.ADD;
1228: END IF;
1229:
1259: )
1260: IS
1261: BEGIN
1262: IF (fnd_msg_pub.check_msg_level(p_msg_level) = TRUE) THEN
1263: fnd_message.set_name(BIS_VG_TYPES.message_application, p_msg_name);
1264: fnd_message.set_token(p_token1, p_value1);
1265: fnd_message.set_token(p_token2, p_value2);
1266: fnd_msg_pub.ADD;
1267: END IF;
1300: )
1301: IS
1302: BEGIN
1303: IF (fnd_msg_pub.check_msg_level(p_msg_level) = TRUE) THEN
1304: fnd_message.set_name(BIS_VG_TYPES.message_application, p_msg_name);
1305: fnd_message.set_token(p_token1, p_value1);
1306: fnd_message.set_token(p_token2, p_value2);
1307: fnd_message.set_token(p_token3, p_value3);
1308: fnd_msg_pub.ADD;
1343: l_error_rec BIS_VG_UTIL.Error_Rec_Type;
1344: --
1345: BEGIN
1346: IF (fnd_msg_pub.check_msg_level(p_error_msg_level) = TRUE) THEN
1347: fnd_message.set_name(BIS_VG_TYPES.message_application, p_error_msg_name);
1348:
1349: l_error_rec.Error_Msg_ID := NULL;
1350: l_error_rec.Error_Msg_Name := p_error_msg_name;
1351: l_error_rec.Error_proc_Name := p_error_proc_name;
1373: --
1374: BEGIN
1375:
1376: IF (fnd_msg_pub.check_msg_level(p_error_msg_level) = TRUE) THEN
1377: fnd_message.set_name(BIS_VG_TYPES.message_application, p_error_msg_name);
1378: fnd_message.set_token(p_token1, p_value1);
1379:
1380: l_error_rec.Error_Msg_ID := NULL;
1381: l_error_rec.Error_Msg_Name := p_error_msg_name;
1407: --
1408: BEGIN
1409:
1410: IF (fnd_msg_pub.check_msg_level(p_error_msg_level) = TRUE) THEN
1411: fnd_message.set_name(BIS_VG_TYPES.message_application, p_error_msg_name);
1412: fnd_message.set_token(p_token1, p_value1);
1413: fnd_message.set_token(p_token2, p_value2);
1414:
1415: l_error_rec.Error_Msg_ID := NULL;
1443: --
1444: BEGIN
1445:
1446: IF (fnd_msg_pub.check_msg_level(p_error_msg_level) = TRUE) THEN
1447: fnd_message.set_name(BIS_VG_TYPES.message_application, p_error_msg_name);
1448: fnd_message.set_token(p_token1, p_value1);
1449: fnd_message.set_token(p_token2, p_value2);
1450: fnd_message.set_token(p_token3, p_value3);
1451:
1645: --dbms_output.put_line('fell through to outer if statement');
1646: RETURN l_prompt;
1647: EXCEPTION
1648: WHEN ex_lang_not_installed THEN
1649: fnd_message.set_name(BIS_VG_TYPES.message_application, 'BIS_VG_LANG_NOT_INSTALLED');
1650: fnd_message.set_token('LANG',UPPER(p_language));
1651: raise_application_error(-20001, fnd_message.get);
1652: WHEN OTHERS THEN
1653: raise_application_error(-20002, SQLERRM ||' p_db_link = '||p_db_link