首页 > 其他分享 >EBS:导入弹性域关键字的值(FND_FLEX_LOADER_APIS.up_value_set_value)

EBS:导入弹性域关键字的值(FND_FLEX_LOADER_APIS.up_value_set_value)

时间:2022-10-23 15:33:05浏览次数:79  
标签:150 flex set FLEX -- value varchar2

 

EBS R12.1 导入 弹性域 关键字的值

第一步:创建一个临时表 

 CUX.CUX_FND_FLEX_VALUE_TEMP ,其表结构同 FND_FLEX_LOADER_APIS.up_value_set_value() 过程的参数一致。 
导入临时表内容。

第二步: 执行导入FND_FLEX_LOADER_APIS.up_value_set_value过程程序
-- N: GL>>SETUP(设置)>>财务系统>>关键字>>值
-- Created on 2022/10/21 by 44060 
declare 
  -- Local variables here
  i integer;
   v_upload_phase                varchar2(150);
   v_upload_mode                 varchar2(150);
   v_custom_mode                 varchar2(150);
   v_flex_value_set_name         varchar2(150);
   v_parent_flex_value_low       varchar2(150);
   v_flex_value                  varchar2(150);
   v_owner                       varchar2(150);
   v_last_update_date            varchar2(150);
   v_enabled_flag                varchar2(150);
   v_summary_flag                varchar2(150);
   v_start_date_active           varchar2(150);
   v_end_date_active             varchar2(150);
   v_parent_flex_value_high      varchar2(150);
   v_rolluv_flex_value_set_name  varchar2(150);
   v_rolluv_hierarchy_code       varchar2(150);
   v_hierarchy_level             varchar2(150);
   v_compiled_value_attributes   varchar2(150);
   v_value_category              varchar2(150);
   v_attribute1                  varchar2(150);
   v_attribute2                  varchar2(150);
   v_attribute3                  varchar2(150);
   v_attribute4                  varchar2(150);
   v_attribute5                  varchar2(150);
   v_attribute6                  varchar2(150);
   v_attribute7                  varchar2(150);
   v_attribute8                  varchar2(150);
   v_attribute9                  varchar2(150);
   v_attribute10                 varchar2(150);
   v_attribute11                 varchar2(150);
   v_attribute12                 varchar2(150);
   v_attribute13                 varchar2(150);
   v_attribute14                 varchar2(150);
   v_attribute15                 varchar2(150);
   v_attribute16                 varchar2(150);
   v_attribute17                 varchar2(150);
   v_attribute18                 varchar2(150);
   v_attribute19                 varchar2(150);
   v_attribute20                 varchar2(150);
   v_attribute21                 varchar2(150);
   v_attribute22                 varchar2(150);
   v_attribute23                 varchar2(150);
   v_attribute24                 varchar2(150);
   v_attribute25                 varchar2(150);
   v_attribute26                 varchar2(150);
   v_attribute27                 varchar2(150);
   v_attribute28                 varchar2(150);
   v_attribute29                 varchar2(150);
   v_attribute30                 varchar2(150);
   v_attribute31                 varchar2(150);
   v_attribute32                 varchar2(150);
   v_attribute33                 varchar2(150);
   v_attribute34                 varchar2(150);
   v_attribute35                 varchar2(150);
   v_attribute36                 varchar2(150);
   v_attribute37                 varchar2(150);
   v_attribute38                 varchar2(150);
   v_attribute39                 varchar2(150);
   v_attribute40                 varchar2(150);
   v_attribute41                 varchar2(150);
   v_attribute42                 varchar2(150);
   v_attribute43                 varchar2(150);
   v_attribute44                 varchar2(150);
   v_attribute45                 varchar2(150);
   v_attribute46                 varchar2(150);
   v_attribute47                 varchar2(150);
   v_attribute48                 varchar2(150);
   v_attribute49                 varchar2(150);
   v_attribute50                 varchar2(150);
   v_flex_value_meaning          varchar2(150);
   v_description                 varchar2(150);
  cursor c1 is 
      select TMP.* from CUX.CUX_FND_FLEX_VALUE_TEMP  TMP
   WHERE 1=1
    AND  EXISTS ( SELECT 1 FROM FND_FLEX_VALUES_VL FFV
     WHERE FFV.FLEX_VALUE_MEANING = TMP.FLEX_VALUE_MEANING
      AND FFV.FLEX_VALUE_SET_ID = TMP.FLEX_VALUE_SET_ID
      AND NVL(FFV.PARENT_FLEX_VALUE_LOW,'#') = NVL(TMP.PARENT_FLEX_VALUE_LOW,'#')
      )
    --  AND TMP.FLEX_VALUE ='611108'
     AND TMP.FLEX_VALUE_SET_NAME NOT IN ('CUX_OTHER_PARTY')
      ;
begin
  -- Test statements here
  FOR R1 IN C1 LOOP
   v_upload_phase := 'BEGIN';  -- 步骤
   v_upload_mode :='';
   v_custom_mode :='FORCE'; -- 强制
   v_flex_value_set_name := R1.flex_value_set_name; --'CUX_SUBACC'; 关键字值集的名称=子科目
  -- v_rolluv_flex_value_set_name := R1.rolluv_flex_value_set_name;
   v_parent_flex_value_low := R1.parent_flex_value_low; -- 父值
   v_flex_value := R1.flex_value;
   v_owner :='IT01';  -- 用户
   
   v_hierarchy_level := R1.hierarchy_level;
   v_last_update_date := TO_CHAR(SYSDATE,'YYYY/MM/DD'); -- 格式: YYYY/MM/DD HH24:MI:SS 
   v_enabled_flag := R1.ENABLED_FLAG ; --  'Y';
   v_summary_flag := R1.SUMMARY_FLAG;  -- 'N'
   v_compiled_value_attributes := R1.compiled_value_attributes; -- 'Y'||CHR(10)||'Y';  -- 限定词:是 是
   v_value_category := R1.value_category;
   v_flex_value_meaning := R1.flex_value_meaning ; -- 一般与 v_flex_value 相同值
   v_description := R1.DESCRIPTION; -- 描述 
   
   APPS.FND_FLEX_LOADER_APIS.up_value_set_value(
   p_upload_phase                =>   v_upload_phase                ,
   p_upload_mode                 =>   v_upload_mode                 ,
   p_custom_mode                 =>   v_custom_mode                 ,
   p_flex_value_set_name         =>   v_flex_value_set_name         ,
   p_parent_flex_value_low       =>   v_parent_flex_value_low       ,
   p_flex_value                  =>   v_flex_value                  ,
   p_owner                       =>   v_owner                       ,
   p_last_update_date            =>   v_last_update_date            ,
   p_enabled_flag                =>   v_enabled_flag                ,
   p_summary_flag                =>   v_summary_flag                ,
   p_start_date_active           =>   v_start_date_active           ,
   p_end_date_active             =>   v_end_date_active             ,
   p_parent_flex_value_high      =>   v_parent_flex_value_high      ,
   p_rollup_flex_value_set_name  =>   v_rolluv_flex_value_set_name  ,
   p_rollup_hierarchy_code       =>   v_rolluv_hierarchy_code       ,
   p_hierarchy_level             =>   v_hierarchy_level             ,
   p_compiled_value_attributes   =>   v_compiled_value_attributes   ,
   p_value_category              =>   v_value_category              ,
   p_attribute1                  =>   v_attribute1                  ,
   p_attribute2                  =>   v_attribute2                  ,
   p_attribute3                  =>   v_attribute3                  ,
   p_attribute4                  =>   v_attribute4                  ,
   p_attribute5                  =>   v_attribute5                  ,
   p_attribute6                  =>   v_attribute6                  ,
   p_attribute7                  =>   v_attribute7                  ,
   p_attribute8                  =>   v_attribute8                  ,
   p_attribute9                  =>   v_attribute9                  ,
   p_attribute10                 =>   v_attribute10                 ,
   p_attribute11                 =>   v_attribute11                 ,
   p_attribute12                 =>   v_attribute12                 ,
   p_attribute13                 =>   v_attribute13                 ,
   p_attribute14                 =>   v_attribute14                 ,
   p_attribute15                 =>   v_attribute15                 ,
   p_attribute16                 =>   v_attribute16                 ,
   p_attribute17                 =>   v_attribute17                 ,
   p_attribute18                 =>   v_attribute18                 ,
   p_attribute19                 =>   v_attribute19                 ,
   p_attribute20                 =>   v_attribute20                 ,
   p_attribute21                 =>   v_attribute21                 ,
   p_attribute22                 =>   v_attribute22                 ,
   p_attribute23                 =>   v_attribute23                 ,
   p_attribute24                 =>   v_attribute24                 ,
   p_attribute25                 =>   v_attribute25                 ,
   p_attribute26                 =>   v_attribute26                 ,
   p_attribute27                 =>   v_attribute27                 ,
   p_attribute28                 =>   v_attribute28                 ,
   p_attribute29                 =>   v_attribute29                 ,
   p_attribute30                 =>   v_attribute30                 ,
   p_attribute31                 =>   v_attribute31                 ,
   p_attribute32                 =>   v_attribute32                 ,
   p_attribute33                 =>   v_attribute33                 ,
   p_attribute34                 =>   v_attribute34                 ,
   p_attribute35                 =>   v_attribute35                 ,
   p_attribute36                 =>   v_attribute36                 ,
   p_attribute37                 =>   v_attribute37                 ,
   p_attribute38                 =>   v_attribute38                 ,
   p_attribute39                 =>   v_attribute39                 ,
   p_attribute40                 =>   v_attribute40                 ,
   p_attribute41                 =>   v_attribute41                 ,
   p_attribute42                 =>   v_attribute42                 ,
   p_attribute43                 =>   v_attribute43                 ,
   p_attribute44                 =>   v_attribute44                 ,
   p_attribute45                 =>   v_attribute45                 ,
   p_attribute46                 =>   v_attribute46                 ,
   p_attribute47                 =>   v_attribute47                 ,
   p_attribute48                 =>   v_attribute48                 ,
   p_attribute49                 =>   v_attribute49                 ,
   p_attribute50                 =>   v_attribute50                 ,
   p_flex_value_meaning          =>   v_flex_value_meaning          ,
   p_description                 =>   v_description                 
  );
   --DBMS_OUTPUT.put_line('FLEX_VALUE = ' || R1.FLEX_VALUE);
    DBMS_OUTPUT.put_line('PARENT_FLEX_VALUE= '|| v_parent_flex_value_low ||'; FLEX_VALUE = ' || V_FLEX_VALUE);
  END LOOP;
  
end;

  

另一个 导入 无限定词的值集的值

 

-- Created on 2022/10/21 by 4060 
declare 
  -- Local variables here
  i integer;
   v_flex_value_set_name         VARCHAR2(250);
   v_parent_flex_value          VARCHAR2(250);
   v_flex_value                 VARCHAR2(250);
   v_description                VARCHAR2(250);
   v_enabled_flag               VARCHAR2(2):='Y';
   v_start_date_active          DATE;
   v_end_date_active            DATE;
   v_hierarchy_level            VARCHAR2(250);
   v_storage_value              VARCHAR2(250);
begin
  -- 导入 从属值集值
  --  说明性--> 值 
   v_flex_value_set_name   :='CUX_SUBACC';
   v_parent_flex_value     :='239101';
   v_flex_value            :='001';
   v_description           :='水电费';
   v_enabled_flag          :='Y';
   v_start_date_active     :=NULL;
   v_end_date_active       :=NULL;
   v_hierarchy_level       :='';
   v_storage_value         :='';
   
  fnd_flex_val_api.create_dependent_vset_value
  (p_flex_value_set_name   => v_flex_value_set_name,--    IN VARCHAR2,
   p_parent_flex_value     => v_parent_flex_value,--    IN VARCHAR2,
   p_flex_value            => v_flex_value,--    IN VARCHAR2,
   p_description           => v_description,--    IN VARCHAR2 DEFAULT NULL,
   p_enabled_flag          => v_enabled_flag,--    IN VARCHAR2 DEFAULT 'Y',
   p_start_date_active     => v_start_date_active,--   IN DATE DEFAULT NULL,
   p_end_date_active       => v_end_date_active ,--    IN DATE DEFAULT NULL,
   p_hierarchy_level       => v_hierarchy_level,--     IN VARCHAR2 DEFAULT NULL,
   x_storage_value         => v_storage_value --    OUT NOCOPY VARCHAR2
   );
end;

  

标签:150,flex,set,FLEX,--,value,varchar2
From: https://www.cnblogs.com/samrv/p/16818664.html

相关文章