PostRank

2009/07/29

如何展開BOM表

如何使用Oracle 官方的 API 展開 BOM 表

Oracle Metalink Note:332133.1

The BOM exploder userexit is run (bompexpl.exploder_userexit) and seems to complete successfully.

The exploder is supposed to explode a bill into the BOM_EXPLOSION_TEMP table. However, the BOM_EXPLOSION_TEMP table is empty.


Code used to call the exploder:

--

-- BOM Exploder Userexit Example

-- Calls the bompexpl.exploder_userexit to explode a single item in a single org

-- Change v_item and v_org to suitable values

--



set serveroutput on



declare

v_item varchar2(240) := 'AS54888'; -- item to explode

v_org varchar2(3) := 'M1'; -- org in which item is exploded



v_cnt NUMBER := 0;



v_err_msg varchar2(240);

v_err_code NUMBER := 0;

v_verify_flag NUMBER := 0; -- DEFAULT 0

v_online_flag NUMBER := 2; -- DEFAULT 0

v_item_id NUMBER := 0; -- set to inventory_item_id of item to explode

v_org_id NUMBER := 0; -- set to organization_id of item to explode

v_alternate VARCHAR2(240) := NULL; -- DEFAULT null

v_list_id NUMBER := 0; -- for reports (default 0)

v_order_by NUMBER := 1; -- DEFAULT 1

v_grp_id NUMBER := 0; --

v_session_id NUMBER := 0; -- DEFAULT 0

v_req_id NUMBER := 0; -- DEFAULT 0

v_prgm_appl_id NUMBER := -1; -- DEFAULT -1

v_prgm_id NUMBER := -1; -- DEFAULT -1

v_levels_to_explode NUMBER := 1; -- DEFAULT 1

v_bom_or_eng NUMBER := 1; -- DEFAULT 1

v_impl_flag NUMBER := 1; -- DEFAULT 1

v_plan_factor_flag NUMBER := 2; -- DEFAULT 2

v_incl_lt_flag NUMBER := 2; -- DEFAULT 2

v_explode_option NUMBER := 2; -- DEFAULT 2

v_module NUMBER := 2; -- DEFAULT 2

v_cst_type_id NUMBER := 0; -- DEFAULT 0

v_std_comp_flag NUMBER := 0; -- DEFAULT 0

v_rev_date VARCHAR2(240); --

v_comp_code VARCHAR2(240) := NULL; --

v_expl_qty NUMBER := 1; -- DEFAULT 1



begin



-- item revision will be based on this explode date.

-- In this example, we use current date/time

v_rev_date := to_char(SYSDATE);



-- Find org_id

select mp.organization_id into v_org_id

from MTL_PARAMETERS mp

where mp.organization_code = v_org;



-- Find item_id

select inventory_item_id into v_item_id

from MTL_ITEM_FLEXFIELDS

where organization_id = v_org_id and item_number = v_item;



-- v_grp_id is a unique identifier for this run of the exploder

select bom_explosion_temp_s.nextval into v_grp_id from dual;



-- determine maximum levels to explode from bom_explosions

select maximum_bom_level into v_levels_to_explode

from bom_parameters where organization_id = v_org_id;



apps.bompexpl.exploder_userexit (

v_verify_flag,

v_org_id,

v_order_by,

v_grp_id,

v_session_id,

v_levels_to_explode,

v_bom_or_eng,

v_impl_flag,

v_plan_factor_flag,

v_explode_option,

v_module,

v_cst_type_id,

v_std_comp_flag,

v_expl_qty,

v_item_id,

v_alternate,

v_comp_code,

v_rev_date,

v_err_msg,

v_err_code);



if ( v_err_code <> 0 ) then

rollback;

dbms_output.put_line('ERROR: '

v_err_msg);

else

select count(*) into v_cnt from bom_explosion_temp where group_id=v_grp_id;

dbms_output.put_line('Count='

v_cnt);

commit;

dbms_output.put_line('.');

dbms_output.put_line('Group Id='

v_grp_id);

dbms_output.put_line('Org ='

v_org);

dbms_output.put_line('Item ='

v_item);

dbms_output.put_line('Ord Id ='

v_org_id);

dbms_output.put_line('Item Id='

v_item_id);

dbms_output.put_line('Levels ='

v_levels_to_explode);



end if;

end;

/



Cause

The BOM_EXPLOSION_TEMP table is a global temporary table. Data written to the table is automatically

removed after the SQL*PLUS session terminates. In addition, the data written in one SQL*PLUS session is

not available to any other SQL*PLUS session.





Solution

In the same SQL*PLUS session in which the exploder userexit is run, copy the data from the BOM_EXPLOSION_TEMP

table to another user created temporary table since the data in the BOM_EXPLOSION_TEMP table is only available to

the session in which you run the exploder and is deleted afterward. For example:



Start SQL*PLUS

Create a new table to hold the BOM_EXPLOSION_TEMP data



SQL> create table BOM_EXPLOSION_TEMP_SAVE as select * from BOM_EXPLOSION_TEMP;

Run the exploder in this same session



SQL> @<>

Copy the explosion data created by the exploder userexit into the new table you created



SQL> insert into BOM_EXPLOSION_TEMP_SAVE select * from BOM_EXPLOSION_TEMP;



SQL> commit;

Exit SQL*PLUS



When you exit, all data created for this session is automatically deleted from BOM_EXPLOSION_TEMP

because it is a global temporary table.

Your explosion data should now reside in the BOM_EXPLOSION_TEMP_SAVE table.

2009/07/27

[轉載]SAP 的打油詩

摘自:http://yaohua0214.itpub.net/post/6124/132875

sap是庞大的,模块是多多的,功能是强大的,搞懂是没门的。
sd是灵巧的,五脏是俱全的,满足是不能的,报表是经常的。
pp是复杂的,相同是很少的,mrp是要的,精确是不能的。
mm是重要的,数据是多多的,做好是稀有的,目前是紧缺的。
fi是核心的,记账是主要的,工作是轻松的,地位是高高的。
co是控制的,与fi是配合的,凭证是很多的,成本是不准的。
abap是必须的,开发是经常的,地位是没有的,作用是点缀的。
basis是装机的,debug是常有的,精通是困难的,abap是兼职的。
HR是搞人的,会作是很少的,研究是需要的,潜力是无穷的。
workflow是神奇的,功能是炫目的,做通是很少的,因而是不做的。
qm是质量的,上的是不多的,思路是奇特的,冲突是必然的。
pm是见过的,功能是明显的,做做是蛮好的,培训是需要的。
apo是传说的,上的是没有的,目标是理想的,成功是偶然的。
crm是起步的,客户是听说的,用好是没有的,完善是需要的。
bw是早有的,产品是多样的,需求是渐多的,招人是必要的。
市场是巨大的,erp是需要的,签单是可能的,打折是一定的。
kick off是要有的,首期是会付的,蓝图是要做的,确认是艰苦的。
实施是痛苦的,修改是经常的,说服是需要的,项目是继续的。
数据是庞大的,整理是艰苦的,手输是不能的,batch是要编的。
客户是刁蛮的,要求是无理的,说话是牛逼的,干活是不行的。
key user是难做的,加班是经常的,工资是不多的,衰老是优先的。
上线是被逼的,不逼是不行的,时间是紧张的,恐惧是不必的。

2009/07/21

VirtualBox使用说明之Shared Folders

 1、创建Share

A) 选择虚拟机窗口菜单项"Devices -> Shared Folders"。
B) 在弹出的窗口"Shared Folders"中,选中列表中的"Transient Folders"。
C) 这时窗口右侧三个按钮中最上方的带有"+"的按钮会变为可用状态,点击这个按钮。
D) 在弹出的窗口"Add Share"中,在输入框"Folder Path"中输入host要共享的目录,在输入框"Folder Name"中输入在guest中要使用的share folder名字,点击按钮"OK"关闭当前窗口。
E) 这时窗口"Shared Folders"列表中"Transient Folders"项目下会出现以刚刚添加的共享目录名字的子项目。


2、使用Share

例:已建立名字为"tool"的share folder

A) guest OS为 linux

# mkdir /mnt/share
# mount -t vboxsf tool /mnt/share

B) guest OS为 windows

net use z: \vboxsvr\tool
(注:vboxsvr前面是2个\,不知道为什么就是不能正常显示,YM啊)
 

2009/07/17

让我们一起去使用G.HO.ST虚拟电脑

你也可以注册 http://g.ho.st/?referral=arsenefang