使用脚本生成批次,并把这个批次关联到的Item和Org
1.使用API,INV_LOT_API_PUB.AUTO_GEN_LOT生成Next Lot Number
2.关联这个批次到一个Item和Org上

DECLAREv_object_id NUMBER;v_return_status             VARCHAR2(1)      := NULL;v_msg_count                 NUMBER           := 0;v_msg_data                  VARCHAR2 (2000);v_lot_number                VARCHAR2 (50);v_expire_date               DATE             := SYSDATE+180;v_organization_id           NUMBER           :=124;v_inventory_item_id         NUMBER           :=27839;FUNCTION set_context( i_user_name    IN  VARCHAR2,i_resp_name    IN  VARCHAR2,i_org_id       IN  NUMBER)RETURN VARCHAR2IS/* Inorder to reduce the content of the post I moved the implementation part of this function to another post and it is available here */END set_context;BEGIN
-- Setting the context ----
v_context := set_context('&V_USER_NAME','&V_RESPONSIBILITY',82);
IF v_context = 'F'
THENDBMS_OUTPUT.PUT_LINE('Error while setting the context');
END IF;dbms_output.put_line ('Calling API to Create Lot Number');
v_lot_number := inv_lot_api_pub.auto_gen_lot (p_org_id            => v_organization_id,p_inventory_item_id => v_inventory_item_id,p_parent_lot_number => NULL,p_subinventory_code => NULL,p_locator_id        => NULL,p_api_version       => 1.0,p_init_msg_list     => fnd_api.g_true,p_commit            => fnd_api.g_false,p_validation_level  => fnd_api.g_valid_level_full,x_return_status     => v_return_status,x_msg_count         => v_msg_count,x_msg_data          => v_msg_data);
IF v_return_status = fnd_api.g_ret_sts_success THENCOMMIT;DBMS_OUTPUT.put_line ('The Auto generation of Lot Number is Sucessful: '||v_lot_number);
ELSEDBMS_OUTPUT.put_line ('The Auto generation of Lot Number Failed');ROLLBACK;FOR i IN 1 .. v_msg_countLOOPv_msg_data := fnd_msg_pub.get( p_msg_index => i, p_encoded => 'F');dbms_output.put_line( i|| ') '|| v_msg_data);END LOOP;
END IF;IF v_lot_number IS NOT NULL THENdbms_output.put_line ('Calling API to Create/Insert a Lot Numbers');inv_lot_api_pub.insertlot(p_api_version       => 1,p_init_msg_list     => fnd_api.g_false,p_commit            => fnd_api.g_false,p_validation_level  => fnd_api.g_valid_level_full,p_inventory_item_id => v_inventory_item_id,p_organization_id   => v_organization_id,p_lot_number        => v_lot_number,p_expiration_date   => v_expire_date,x_object_id         => v_object_id,x_return_status     => v_return_status,x_msg_count         => v_msg_count,x_msg_data          => v_msg_data);IF v_return_status = fnd_api.g_ret_sts_success THENCOMMIT;DBMS_OUTPUT.put_line ('The Creation of Lot Number is Sucessful: '||v_object_id);
ELSEDBMS_OUTPUT.put_line ('The Creation of Lot Number Failed');ROLLBACK;FOR i IN 1 .. v_msg_countLOOPv_msg_data := fnd_msg_pub.get( p_msg_index => i, p_encoded => 'F');dbms_output.put_line( i|| ') '|| v_msg_data);END LOOP;
END IF;
END IF;
END;

source:http://www.shareoracleapps.com/2010/10/generation-of-lot-number-for-inventory.html

Generation of a LOT number for an Inventory item via API in R12相关推荐

  1. 【CodeForces - 569B】Inventory (标记,乱搞)

    题干: Companies always have a lot of equipment, furniture and other things. All of them should be trac ...

  2. 【CodeForces - 569B】Inventory (水题)

    题干: Companies always have a lot of equipment, furniture and other things. All of them should be trac ...

  3. Interactive Python:Mini-project # 1 - Guess the number game

    加上这一次的作业,这门莱斯大学的python课程的所有project都已经完成了. 这次作业中,收获最大的是关于编程风格的问题. 在运算符前后和逗号后面都要添加空格,除非紧邻着括号.类名要使用Came ...

  4. MaxCompute 中的Code Generation技术简介

    摘要: 前言 在<数据库系统中的Code Generation技术介绍>中,我们简单介绍了一下Code Generation技术及其在大规模OLAP系统,特别是大规模分布式OLAP系统中的 ...

  5. 使用Number Insight和Java创建呼叫者ID

    Introduction In this tutorial, you will create an application that can be used as a web-based caller ...

  6. 【Unity3D插件】Inventory Pro插件分享《游戏背包系统》

    推荐阅读 CSDN主页 GitHub开源地址 Unity3D插件分享 简书地址 我的个人博客 QQ群:1040082875 一.前言 发现就喜欢研究这些插件,为什么呢,因为方便快捷啊.基本不用研究源代 ...

  7. vue之购物车案例升级版、v-model之lazy、number、trim的使用、fetch和axios、计算属性、Mixins、虚拟dom与diff算法 key的作用及组件化开发

    文章目录 1.购物车案例升级版(含价格统计.全选/反选.商品增加减少) 2.v-model之lazy.number.trim的使用 3.fetch和axios 3.1.通过jquery+ajax实现v ...

  8. [SAP Dictionary]

    Words    Chinese (foreign) exchange gain 汇兑收益 (foreign) exchange loss 汇兑损失 (investment) support allo ...

  9. 一篇文章看懂TPCx-BB(大数据基准测试工具)源码

    TPCx-BB是大数据基准测试工具,它通过模拟零售商的30个应用场景,执行30个查询来衡量基于Hadoop的大数据系统的包括硬件和软件的性能.其中一些场景还用到了机器学习算法(聚类.线性回归等).为了 ...

最新文章

  1. fork()和写时复制
  2. 手写自己的MyBatis框架-SqlSession
  3. hdu 2686 Matrix 最大费用最大流
  4. LeetCode45 Jump Game II
  5. signature=27ba8feff228d8babc1d1762f8da4445,Embedding digital signatures into digital payloads
  6. android listview自动加载更多,如何实现 Android ListView『上拉加载更多』?
  7. 使用GDAL获取HDF等数据集中的图像
  8. 240.搜索二维矩阵II(力扣leetcode) 博主可答疑该问题
  9. Open Inventor:Windows下编译安装Coin3D
  10. **恶意代码系列** MS-DOS系统安装
  11. Web Intelligence and Big Data--Final Exam
  12. Word2013设置多级标题自动编号
  13. 文件名太长无法删除怎么办?
  14. 组合导航中常见的英文单词、短语翻译
  15. Linux内核深入理解定时器和时间管理(6):x86_64 相关的时钟源(kvm-clock,tsc,acpi_pm,hpet)
  16. 什么是网络推广以及如何做好网络推广
  17. PK61键盘使用说明
  18. docker php 环境实操
  19. C#设置默认打印机界面
  20. SOA成功案例—中远集运全球EDI平台建设

热门文章

  1. pikachu暴力破解合集(含分析、验证与修复建议)
  2. HuaWei ❉ TCP详解
  3. pmd java规则_4. PMD 使用,编译和自定义规则
  4. python 报价_python爬取京东价格
  5. 【转】不归零码(NRZ),不归零码(NRZ)是什么意思
  6. 征服者蒙面侠c380更新升级_LOL9.3&9.4版本改动浅析:征服者搅动风云 暴击回调上线...
  7. Push推送的评估方法
  8. MySql查询条件in配合field()函数排序
  9. 狂傲的王勃,如流星般划过大唐璀璨的夜空
  10. Qt上位机软件串口通讯