API for Value Set in Oracle apps(Independent and Dependent)


API for Value Set in Oracle apps

 

Below is the API to upload the values in the value set as shown in below screenshot

Prerequiste

A Value set must be already exist in the system as commented in API. The Below is Independent

 Independent Values

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_value_set_desc varchar2 (500);
begin
l_value_set_name := ‘XX_ITEM_CATEGORY_VALUE_T’; –This Value set should already exist in the system as Independent
l_enabled_flag := ‘Y’;
l_summary_flag := ‘N’;
l_who_type.created_by := 6532;
l_who_type.creation_date := sysdate;
l_who_type.last_updated_by := 6532;
l_who_type.last_update_date := sysdate;
l_who_type.last_update_login := 6532; –l_value_set_name
l_value_set_value :=60123; –l_value_set_value
l_value_set_desc := ‘Under Testing check’;
fnd_flex_loader_apis. –API to upload the value set
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 => null,
p_value_category => ‘VALUE_SET_NAME’,
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_value_set_value,
p_description => l_value_set_desc);
commit;
exception
when others
then
dbms_output.put_line (‘Error is ‘ || substr (sqlerrm, 1, 1000));
end;

 

The below screenshot once the API is Executed.

API - After Exe Independent

 

For Dependent values

 

 

 

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_value_set_desc   varchar2 (500);

begin

l_value_set_name := ‘XXDPC_ITEM_CATEGORY_VALUE_T1’;

l_enabled_flag := ‘Y’;

l_summary_flag := ‘N’;

l_who_type.created_by := 6532;

l_who_type.creation_date := sysdate;

l_who_type.last_updated_by := 6532;

l_who_type.last_update_date := sysdate;

l_who_type.last_update_login := 6532;       –l_value_set_name

l_value_set_value :=1263;                       –l_value_set_value

l_value_set_desc := ‘Under Testing check’;

fnd_flex_loader_apis.                   –API to upload the value set

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       => 60255,                                                             –Independent Value

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   => ‘XXDPC_ITEM_CATEGORY_VALUE_T’,                 –Independent Value set

p_rollup_hierarchy_code       => null,

p_hierarchy_level             => null,

p_compiled_value_attributes   => null,

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_value_set_value,

p_description                 => l_value_set_desc);

commit;

exception

when others

then

dbms_output.put_line (‘Error is ‘ || substr (sqlerrm, 1, 1000));

end;

API - After Exe Dependent

 

About pacesettergraam

A good and realistic person

Posted on September 3, 2015, in Oracle, oracle apps and tagged , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: