17: x_id_flex_strt_code VARCHAR2(30);--Variable to get the structure code.
18:
19: CURSOR insert_update(flex_num NUMBER) IS
20: SELECT id_flex_num
21: FROM FND_ID_FLEX_STRUCTURES
22: WHERE application_id = 101
23: AND id_flex_code = 'GLLE'
24: AND id_flex_num = flex_num;
25:
46: --If there is already an existing structure with the same ID, delete it.
47: OPEN insert_update(X_id_flex_num);
48: FETCH insert_update INTO x_num;
49: IF(insert_update%FOUND)THEN
50: DELETE FROM FND_ID_FLEX_STRUCTURES
51: WHERE application_id = 101
52: AND id_flex_code = 'GLLE'
53: AND id_flex_num = X_id_flex_num;
54:
51: WHERE application_id = 101
52: AND id_flex_code = 'GLLE'
53: AND id_flex_num = X_id_flex_num;
54:
55: DELETE FROM FND_ID_FLEX_STRUCTURES_TL
56: WHERE application_id = 101
57: AND id_flex_code = 'GLLE'
58: AND id_flex_num = X_id_flex_num;
59:
85: END IF;
86: CLOSE insert_update;
87:
88: --Insert the new chart of accounts based on the Ledger Flexfield.
89: INSERT INTO FND_ID_FLEX_STRUCTURES
90: (application_id,
91: id_flex_code,
92: id_flex_num,
93: last_update_date,
125: shorthand_length,
126: structure_view_name,
127: id_flex_structure_code--,
128: -- security_group_id
129: FROM FND_ID_FLEX_STRUCTURES
130: WHERE application_id = 101
131: AND id_flex_code = 'GL#'
132: AND id_flex_num = X_id_flex_num;
133:
132: AND id_flex_num = X_id_flex_num;
133:
134: --Insert the chart of accounts in multiple languages supported by the
135: --application.
136: INSERT INTO FND_ID_FLEX_STRUCTURES_TL
137: (application_id,
138: id_flex_code,
139: id_flex_num,
140: language,
162: description,
163: shorthand_prompt,
164: source_lang
165: -- security_group_id
166: FROM FND_ID_FLEX_STRUCTURES_TL
167: WHERE application_id = 101
168: AND id_flex_code = 'GL#'
169: AND id_flex_num = X_id_flex_num;
170:
498: CLOSE segments_exist;
499:
500: SELECT id_flex_structure_code
501: INTO x_id_flex_strt_code
502: FROM FND_ID_FLEX_STRUCTURES
503: WHERE application_id = 101
504: AND id_flex_code = 'GLLE'
505: AND id_flex_num = X_id_flex_num;
506: