news 2026/6/14 0:11:12

Oracle EBS INV 库存类别组合数据的导入更新删除API

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
Oracle EBS INV 库存类别组合数据的导入更新删除API

1.库存类别组合导入

DECLARE l_structure_id NUMBER; l_api_version NUMBER := 1.0; l_init_msg_list VARCHAR2(100) := fnd_api.g_false; l_commit VARCHAR2(100) := fnd_api.g_false; x_return_status VARCHAR2(20); x_errorcode NUMBER; x_msg_count NUMBER; x_msg_data VARCHAR2(4000); x_category_id NUMBER; l_category_rec inv_item_category_pub.category_rec_type; CURSOR c_data IS SELECT t.* ,t.rowid row_id FROM cux.cux_item_category_imp_temp t WHERE 1 = 1 --AND t.segment1 = '047' -- --AND t.segment2 = '18' AND t.batch_no = 20220601001 AND NOT EXISTS (SELECT 1 FROM mtl_categories_kfv m WHERE m.structure_id = 50428 AND m.concatenated_segments = t.concat_segment) AND nvl(t.status ,'xx') <> 'S'; BEGIN fnd_global.apps_initialize(user_id => 7054 ,resp_id => 50947 ,resp_appl_id => 20003); -- Initialize variables -- to get structure_id, use the following query -- select application_id, id_flex_code, id_flex_num, id_flex_structure_code from FND_ID_FLEX_STRUCTURES_VL -- where application_id=401 and id_flex_code='MCAT' and id_flex_structure_code = '&structure_code' ; -- 'PJ_UPPERCASE'; SELECT id_flex_num INTO l_structure_id FROM fnd_id_flex_structures_vl WHERE application_id = 401 AND id_flex_code = 'MCAT' AND id_flex_structure_code = 'HCP_PART_CATEGORY'; FOR r_data IN c_data LOOP l_category_rec.structure_id := l_structure_id; l_category_rec.segment1 := r_data.segment1; l_category_rec.segment2 := r_data.segment2; l_category_rec.segment3 := r_data.segment3; l_category_rec.description := r_data.concat_segment_desc; -- call API to create category --.put_line('============================================='); --dbms_output.put_line('Calling INV_ITEM_CATEGORY_PUB.Create_Category'); inv_item_category_pub.create_category(p_api_version => l_api_version ,p_init_msg_list => l_init_msg_list ,p_commit => l_commit ,x_return_status => x_return_status ,x_errorcode => x_errorcode ,x_msg_count => x_msg_count ,x_msg_data => x_msg_data ,p_category_rec => l_category_rec ,x_category_id => x_category_id); --dbms_output.put_line('==========================================='); --dbms_output.put_line('Return Status: ' || x_return_status); IF x_return_status <> 'S' THEN ROLLBACK; UPDATE cux.cux_item_category_imp_temp c SET c.status = 'E' ,c.err_msg = x_msg_data WHERE c.rowid = r_data.row_id; ELSE UPDATE cux.cux_item_category_imp_temp c SET c.status = 'S' ,c.err_msg = NULL ,c.category_id = x_category_id WHERE c.rowid = r_data.row_id; END IF; COMMIT; END LOOP; EXCEPTION WHEN OTHERS THEN dbms_output.put_line('Error:' || SQLCODE || '---' || SQLERRM); ROLLBACK; END;

2.库存类别组合描述更新

DECLARE l_structure_id NUMBER; l_api_version NUMBER := 1.0; l_init_msg_list VARCHAR2(100) := fnd_api.g_false; l_commit VARCHAR2(100) := fnd_api.g_false; x_return_status VARCHAR2(20); x_errorcode NUMBER; x_msg_count NUMBER; x_msg_data VARCHAR2(4000); x_category_id NUMBER; l_category_rec inv_item_category_pub.category_rec_type; CURSOR c_data IS SELECT t.* ,t.rowid row_id FROM cux.cux_item_category_upd_temp t WHERE 1 = 1 --AND t.segment1 = '047' -- --AND t.segment2 = '18' --AND t.concat_segment = '133.06.10' AND t.category_id IS NOT NULL AND nvl(t.status ,'xx') <> 'S'; BEGIN fnd_global.apps_initialize(user_id => 7054 ,resp_id => 50947 ,resp_appl_id => 20003); -- Initialize variables -- to get structure_id, use the following query -- select application_id, id_flex_code, id_flex_num, id_flex_structure_code from FND_ID_FLEX_STRUCTURES_VL -- where application_id=401 and id_flex_code='MCAT' and id_flex_structure_code = '&structure_code' ; -- 'PJ_UPPERCASE'; /*SELECT id_flex_num INTO l_structure_id FROM fnd_id_flex_structures_vl WHERE application_id = 401 AND id_flex_code = 'MCAT' AND id_flex_structure_code = 'HCP_PART_CATEGORY';*/ FOR r_data IN c_data LOOP /*l_category_rec.structure_id := l_structure_id; l_category_rec.segment1 := r_data.segment1; l_category_rec.segment2 := r_data.segment2; l_category_rec.segment3 := r_data.segment3; l_category_rec.description := r_data.concat_segment_desc;*/ -- call API to create category --.put_line('============================================='); --dbms_output.put_line('Calling INV_ITEM_CATEGORY_PUB.Create_Category'); /*inv_item_category_pub.create_category(p_api_version => l_api_version ,p_init_msg_list => l_init_msg_list ,p_commit => l_commit ,x_return_status => x_return_status ,x_errorcode => x_errorcode ,x_msg_count => x_msg_count ,x_msg_data => x_msg_data ,p_category_rec => l_category_rec ,x_category_id => x_category_id);*/ inv_item_category_pub.update_category_description(p_api_version => l_api_version ,p_init_msg_list => l_init_msg_list ,p_commit => l_commit ,x_return_status => x_return_status ,x_errorcode => x_errorcode ,x_msg_count => x_msg_count ,x_msg_data => x_msg_data ,p_category_id => r_data.category_id ,p_description => r_data.concat_segment_desc); --dbms_output.put_line('==========================================='); --dbms_output.put_line('Return Status: ' || x_return_status); IF x_return_status <> 'S' THEN ROLLBACK; UPDATE cux.cux_item_category_upd_temp c SET c.status = 'E' ,c.err_msg = x_msg_data WHERE c.rowid = r_data.row_id; ELSE UPDATE cux.cux_item_category_upd_temp c SET c.status = 'S' ,c.err_msg = NULL --,c.category_id = x_category_id WHERE c.rowid = r_data.row_id; END IF; COMMIT; END LOOP; EXCEPTION WHEN OTHERS THEN dbms_output.put_line('Error:' || SQLCODE || '---' || SQLERRM); ROLLBACK; END;

3.库存类别组合删除

DECLARE l_structure_id NUMBER; l_api_version NUMBER := 1.0; l_init_msg_list VARCHAR2(100) := fnd_api.g_false; l_commit VARCHAR2(100) := fnd_api.g_false; x_return_status VARCHAR2(20); x_errorcode NUMBER; x_msg_count NUMBER; x_msg_data VARCHAR2(4000); x_category_id NUMBER; l_category_rec inv_item_category_pub.category_rec_type; CURSOR c_data IS SELECT t.* ,t.rowid row_id FROM cux.cux_item_category_del_temp t WHERE 1 = 1 --AND t.segment1 = '047' -- --AND t.segment2 = '18' --AND t.category_id = 294678 AND t.batch_no = 20220601001 AND t.category_id IS NOT NULL AND nvl(t.status ,'xx') <> 'S'; BEGIN fnd_global.apps_initialize(user_id => 7054 ,resp_id => 50947 ,resp_appl_id => 20003); -- Initialize variables -- to get structure_id, use the following query -- select application_id, id_flex_code, id_flex_num, id_flex_structure_code from FND_ID_FLEX_STRUCTURES_VL -- where application_id=401 and id_flex_code='MCAT' and id_flex_structure_code = '&structure_code' ; -- 'PJ_UPPERCASE'; FOR r_data IN c_data LOOP -- call API to create category --.put_line('============================================='); --dbms_output.put_line('Calling INV_ITEM_CATEGORY_PUB.Create_Category'); inv_item_category_pub.delete_category(p_api_version => l_api_version ,p_init_msg_list => l_init_msg_list ,p_commit => l_commit ,x_return_status => x_return_status ,x_errorcode => x_errorcode ,x_msg_count => x_msg_count ,x_msg_data => x_msg_data ,p_category_id => r_data.category_id); --dbms_output.put_line('==========================================='); --dbms_output.put_line('Return Status: ' || x_return_status); IF x_return_status <> 'S' THEN ROLLBACK; UPDATE cux.cux_item_category_del_temp c SET c.status = 'E' ,c.err_msg = x_msg_data WHERE c.rowid = r_data.row_id; ELSE UPDATE cux.cux_item_category_del_temp c SET c.status = 'S' ,c.err_msg = NULL --,c.category_id = x_category_id WHERE c.rowid = r_data.row_id; END IF; COMMIT; END LOOP; EXCEPTION WHEN OTHERS THEN dbms_output.put_line('Error:' || SQLCODE || '---' || SQLERRM); ROLLBACK; END;
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/10 16:59:38

暗影精灵笔记本性能优化神器:OmenSuperHub完全离线控制方案

还在为官方软件的网络连接问题和隐私担忧而烦恼吗&#xff1f;OmenSuperHub为您提供完全离线的暗影精灵笔记本控制体验&#xff0c;这是一款专注于性能优化和硬件管理的开源控制工具。通过智能的风扇转速调节和性能模式切换&#xff0c;让您的笔记本在保持最佳状态的同时享受纯…

作者头像 李华
网站建设 2026/6/10 5:29:24

EmotiVoice在语音天气预报中的情境化语气调整

EmotiVoice在语音天气预报中的情境化语气调整 在城市气象服务站的清晨播报中&#xff0c;一条“今日多云转晴”的消息如果用低沉严肃的语调播出&#xff0c;听者或许会误以为有突发情况&#xff1b;而当“台风红色预警”以轻快柔和的声音传达时&#xff0c;其警示意义则可能被严…

作者头像 李华
网站建设 2026/6/12 21:19:53

FanControl滞后效应终极调校指南:告别风扇频繁启停的完整方案

FanControl滞后效应终极调校指南&#xff1a;告别风扇频繁启停的完整方案 【免费下载链接】FanControl.Releases This is the release repository for Fan Control, a highly customizable fan controlling software for Windows. 项目地址: https://gitcode.com/GitHub_Tren…

作者头像 李华
网站建设 2026/6/12 19:54:35

EmotiVoice与ASR系统联用案例:构建闭环语音交互平台

EmotiVoice与ASR系统联用案例&#xff1a;构建闭环语音交互平台 在智能设备日益渗透日常生活的今天&#xff0c;用户对“会说话”的机器已不再满足于简单的应答。他们希望听到的不只是信息&#xff0c;而是带有情绪、有温度、甚至像熟人一样的回应。这种期待正在推动语音技术从…

作者头像 李华
网站建设 2026/6/14 4:07:00

EmotiVoice语音合成灾难恢复预案:保障业务连续性

EmotiVoice语音合成灾难恢复预案&#xff1a;保障业务连续性 在虚拟偶像直播正酣、智能客服全天候响应的今天&#xff0c;一句“正在加载中”的延迟或音色突变的语音输出&#xff0c;都可能让用户瞬间出戏。对于依赖高表现力语音交互的系统而言&#xff0c;语音合成服务不仅是功…

作者头像 李华