DECLARE
l_enabled_flag VARCHAR2 (2);
l_summary_flag VARCHAR2 (2);
l_who_type fnd_flex_loader_apis.who_type;
l_user_id NUMBER := fnd_global.user_id;
l_login_id NUMBER := fnd_global.login_id;
l_value_set_name fnd_flex_value_sets.flex_value_set_name%TYPE;
l_value_set_value fnd_flex_values.flex_value%TYPE;
l_flex_value_meaning VARCHAR2 (250);
l_description VARCHAR2 (250);
l_child_low VARCHAR2 (240);
l_child_high VARCHAR2 (240);
l_posting_allowed VARCHAR2 (1);
l_budget_allowed VARCHAR2 (1);
BEGIN
l_value_set_name := 'XXXXXXX';
l_value_set_value := '111';
l_flex_value_meaning := '111';
l_description := 'Test1';
l_child_low := '123';
l_child_high := '124';
l_enabled_flag := 'Y';
l_summary_flag := 'Y'; -- enables parent
l_budget_allowed := 'Y'; --QUALIFIER 1
l_posting_allowed := 'Y'; --QUALIFIER 2
l_who_type.created_by := l_user_id;
l_who_type.creation_date := SYSDATE;
l_who_type.last_updated_by := l_user_id;
l_who_type.last_update_date := SYSDATE;
l_who_type.last_update_login := l_login_id;
fnd_flex_loader_apis.
up_value_set_value (
p_upload_phase => 'BEGIN',
p_upload_mode => NULL,
p_custom_mode => 'FORCE',
p_flex_value_set_name => l_value_set_name,
p_parent_flex_value_low => NULL,
p_flex_value => l_value_set_value,
p_owner => NULL,
p_last_update_date => TO_CHAR (SYSDATE, 'YYYY/MM/DD HH24:MI:SS'),
p_enabled_flag => l_enabled_flag,
p_summary_flag => l_summary_flag,
p_start_date_active => TO_CHAR (SYSDATE, 'YYYY/MM/DD HH24:MI:SS'),
p_end_date_active => NULL,
p_parent_flex_value_high => NULL,
p_rollup_flex_value_set_name => NULL,
p_rollup_hierarchy_code => NULL,
p_hierarchy_level => NULL,
p_compiled_value_attributes => 'NN',
p_value_category => NULL,
p_attribute1 => NULL,
p_attribute2 => NULL,
p_attribute3 => NULL,
p_attribute4 => NULL,
p_attribute5 => NULL,
p_attribute6 => NULL,
p_attribute7 => NULL,
p_attribute8 => NULL,
p_attribute9 => NULL,
p_attribute10 => NULL,
p_attribute11 => NULL,
p_attribute12 => NULL,
p_attribute13 => NULL,
p_attribute14 => NULL,
p_attribute15 => NULL,
p_attribute16 => NULL,
p_attribute17 => NULL,
p_attribute18 => NULL,
p_attribute19 => NULL,
p_attribute20 => NULL,
p_attribute21 => NULL,
p_attribute22 => NULL,
p_attribute23 => NULL,
p_attribute24 => NULL,
p_attribute25 => NULL,
p_attribute26 => NULL,
p_attribute27 => NULL,
p_attribute28 => NULL,
p_attribute29 => NULL,
p_attribute30 => NULL,
p_attribute31 => NULL,
p_attribute32 => NULL,
p_attribute33 => NULL,
p_attribute34 => NULL,
p_attribute35 => NULL,
p_attribute36 => NULL,
p_attribute37 => NULL,
p_attribute38 => NULL,
p_attribute39 => NULL,
p_attribute40 => NULL,
p_attribute41 => NULL,
p_attribute42 => NULL,
p_attribute43 => NULL,
p_attribute44 => NULL,
p_attribute45 => NULL,
p_attribute46 => NULL,
p_attribute47 => NULL,
p_attribute48 => NULL,
p_attribute49 => NULL,
p_attribute50 => NULL,
p_flex_value_meaning => l_flex_value_meaning,
p_description => l_description);
fnd_flex_loader_apis.
up_val_qual_value (
p_upload_phase => 'BEGIN',
p_upload_mode => NULL,
p_custom_mode => 'FORCE',
p_flex_value_set_name => l_value_set_name,
p_parent_flex_value_low => NULL, --
p_flex_value => l_value_set_value,
p_id_flex_application_short_na => 'SQLGL',
p_id_flex_code => 'GL#',
p_segment_attribute_type => 'GL_GLOBAL',
p_value_attribute_type => 'DETAIL_BUDGETING_ALLOWED',
p_owner => NULL,
p_last_update_date => TO_CHAR (SYSDATE,
'YYYY/MM/DD HH24:MI:SS'),
p_assignment_order => NULL,
p_assignment_date => NULL,
p_compiled_value_attribute_val => l_budget_allowed);
fnd_flex_loader_apis.
up_val_qual_value (
p_upload_phase => 'BEGIN',
p_upload_mode => NULL,
p_custom_mode => 'FORCE',
p_flex_value_set_name => l_value_set_name,
p_parent_flex_value_low => NULL,
p_flex_value => l_value_set_value,
p_id_flex_application_short_na => 'SQLGL',
p_id_flex_code => 'GL#',
p_segment_attribute_type => 'GL_GLOBAL',
p_value_attribute_type => 'DETAIL_POSTING_ALLOWED',
p_owner => NULL,
p_last_update_date => TO_CHAR (SYSDATE,
'YYYY/MM/DD HH24:MI:SS'),
p_assignment_order => NULL,
p_assignment_date => NULL,
p_compiled_value_attribute_val => l_posting_allowed);
IF l_summary_flag = 'Y'
THEN
fnd_flex_loader_apis.
up_val_norm_hierarchy (
p_upload_phase => 'BEGIN',
p_upload_mode => NULL,
p_custom_mode => 'FORCE',
p_flex_value_set_name => l_value_set_name,
p_parent_flex_value => l_value_set_value,
p_range_attribute => 'C',
p_child_flex_value_low => l_child_low,
p_child_flex_value_high => l_child_high,
p_owner => NULL,
p_last_update_date => TO_CHAR (SYSDATE,
'YYYY/MM/DD HH24:MI:SS'),
p_start_date_active => TO_CHAR (SYSDATE,
'YYYY/MM/DD HH24:MI:SS'),
p_end_date_active => NULL);
END IF;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Error is ' || SUBSTR (SQLERRM, 1, 1000));
END;
Subscribe to:
Post Comments (Atom)
Hi Uday,
ReplyDeleteIs it necessary to compile a value set after loading data into value set using the fnd_flex_loader_apis.up_val_qual_value API?
Hi,
ReplyDeleteI use this API , it is working fine but Qualifiers are not picking values properly. When i try to upload Natural Account unable to map all Qualifiers.