顯示具有 Oracle OM 標籤的文章。 顯示所有文章
顯示具有 Oracle OM 標籤的文章。 顯示所有文章

2007年11月21日 星期三

Note for WSH_DELIVERY_DETAILS.RELEASED_STATUS

WSH_DELIVERY_DETAILS.RELEASED_STATUS的意義:

B Backordered Line failed to be allocated in Inventory

C Shipped Line has been shipped

D Cancelled Line is Cancelled

I Interfaced Line has been shipped and interfaced to Order Management and Inventory

N Not Ready to Release Line is not ready to be released

R Ready to Release Line is ready to be released

S Released to Warehouse Line has been released to Inventory for processing

X Not Applicable Line is not applicable for Pick Release

Y Staged/Pick Confirmed Line has been picked and staged by Inventory

2007年7月6日 星期五

Tax Code changed after booking order -- Trouble Shooting

http://forums.oracle.com/forums/thread.jspa?messageID=1938213�

業務人員操作時碰到問題
當Customer A的Bill to預設TAX CODE為TAX0
打單時會預帶出TAX0
而某些時候因需求改為TAX5
存檔時都很正常
但Book後卻自動變為TAX0
當沒注意時
就會造成訂單的錯誤

這個問題透過Ketter Ohnes與Daniel Borgstrom的協助
發現Note 359606.1有建議的解決方式
(看來不是bug..而是需要額外設定的東西...詳細請看Note 359606.1)

修改$ONT_TOP/patch/115/sql/OEXEDEPB.pls的程式似乎沒有用
但直接修改 oe_dependencies_extn 這個package
則可以解決這個問題

CREATE OR REPLACE
PACKAGE BODY oe_dependencies_extn AS
/* $Header: OEXEDEPB.pls 115.5 2003/12/03 22:42:58 nlakshma ship $ */

-- Global constant holding the package name

G_PKG_NAME CONSTANT VARCHAR2(30):='OE_Dependencies_Extn';


PROCEDURE Load_Entity_Attributes
( p_entity_code IN VARCHAR2
, x_extn_dep_tbl OUT NOCOPY Dep_Tbl_Type)

IS
l_index NUMBER;
--
l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
--
BEGIN

null;
--==========================================================================
/*
* Please refer to : http://forums.oracle.com/forums/thread.jspa?messageID=1938213
* Ask and Trace by Zhxiang.. @20070706
*/
l_index := 1;

x_extn_dep_tbl(l_index).source_attribute := OE_LINE_UTIL.G_TAX_DATE;
x_extn_dep_tbl(l_index).dependent_attribute := OE_LINE_UTIL.G_TAX;
x_extn_dep_tbl(l_index).enabled_flag := 'N';
l_index := l_index + 1;
--==========================================================================

/*
-- In order to start using the package:
-- 1)Increase the version number in the header line to a high value
-- => Header: OEXEDEPB.pls 115.1000. This would prevent patches
-- from over-writing this package in the future.
-- 2)Included are some examples on how to enable/disable dependencies
-- Please use these guidelines to edit dependencies as per your
-- defaulting rules. Please note that:
-- i) List of attributes is restricted to those in the earlier
-- comments in this file.
-- ii) Source attribute and dependent attribute should belong
-- to the same entity!
-- This API does not support dependencies across entities i.e.
-- changing an attribute on order header will not result in
-- a change to attributes on order line.
-- 3)Uncomment this code and compile.

oe_debug_pub.add('Enter OE_Dependencies_Extn.LOAD_ENTITY_ATTRIBUTES', 1);

-- Initializing index value for pl/sql table. Ensure that the index
-- value is incremented after setting each dependency record.
l_index := 1;

-- Dependencies for Order Header Entity
IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN

null;

-- Sample Code for Disabling dependency of Invoice To on Ship To
-- x_extn_dep_tbl(l_index).source_attribute := OE_HEADER_UTIL.G_SHIP_TO_ORG;
-- x_extn_dep_tbl(l_index).dependent_attribute := OE_HEADER_UTIL.G_INVOICE_TO_ORG;
-- x_extn_dep_tbl(l_index).enabled_flag := 'N';
-- l_index := l_index + 1;

-- Dependencies for Order Line Entity
ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN

null;

-- Sample Code for Disabling dependency of Invoice To on Ship To
-- x_extn_dep_tbl(l_index).source_attribute := OE_LINE_UTIL.G_SHIP_TO_ORG;
-- x_extn_dep_tbl(l_index).dependent_attribute := OE_LINE_UTIL.G_INVOICE_TO_ORG;
-- x_extn_dep_tbl(l_index).enabled_flag := 'N';
-- l_index := l_index + 1;

-- Sample Code for adding dependency of Source Type on Item
-- x_extn_dep_tbl(l_index).source_attribute := OE_LINE_UTIL.G_INVENTORY_ITEM;
-- x_extn_dep_tbl(l_index).dependent_attribute := OE_LINE_UTIL.G_SOURCE_TYPE;
-- x_extn_dep_tbl(l_index).enabled_flag := 'Y';
-- l_index := l_index + 1;

END IF;

oe_debug_pub.add('Exit OE_Dependencies_Extn.LOAD_ENTITY_ATTRIBUTES', 1);
*/

EXCEPTION
WHEN OTHERS THEN
IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
THEN
OE_MSG_PUB.Add_Exc_Msg
( G_PKG_NAME
, 'Load_Entity_Attributes'
);
END IF;
RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
END Load_Entity_Attributes;

END OE_Dependencies_Extn;
/

2007年6月11日 星期一

Awaiting Invoice Interface-On Hold -- Trouble Shooting

version 11.5.10.2

當Bill to的訂單被Hold
透過流程做完Release後
Line的Status有時會停在Awaiting Invoice Interface-On Hold

而並沒有資料拋到AR interface..

根據Metalink Doc: Note:398867.1
指出可以跑
Workflow Background Process
而Timeout要設為Yes..
這樣這支程式會將eligibe的部份再抓入重新進入流程
(就我的經驗...偶而會成功...偶而還是卡在這個狀態中)

不過..也可以找到這個line(在OM上)
直接按滑鼠右鍵
執行Progress Order的指令
就會往下一個流程推了...

無論如何
碰到這樣的狀況
兩個方法都試一下應該就可以了...

2007年5月7日 星期一

Trouble Shooting - Interface Trip Stop Completes With Error: Invalid Location

當User出貨後
做完Ship Confirm
往往認為這樣就操作結束了..
但部份的交易可能沒有那麼順利
會卡在Trip stop的interface中
例如ccid抓不到..或以下的狀況

Interface Trip Stop Completes With Error: Invalid Location

[LOG]
P_MESSAGE_TYPE ==> E
P_MODULE_NAME ==> wsh.plsql.WSH_SHIP_CONFIRM_ACTIONS.INTERFACE_DETAIL_TO_INV msg_buffer ==> Invalid location
E:Invalid location
Exiting WSH_UTIL_CORE.ADD_MESSAGE (05/07/2007 10:47:18 AM, 0 seconds) c_convert_locId%NOTFOUND ==> 599
Error at line ==> 14901

[SOLUTION]
Oracle MetaLink Note:312949.1

Step1: Run Concurrent Program "Import Shipping Locations"
(OM > Shipping > Interfaces > Run)
with parameters
* Map Regions: Yes
* Location Type: Both
* Other: Default
Step2: Retest this issue(Interface Trip-Stop).

2007年2月6日 星期二

OM - Credit Check Issue(11.5.10.2 )

於R11i上enable Order Credit Check有以下幾點要特別注意:
1. 設定
(1). Credit [OM] Setup :

在Credit部分主要有兩塊要做設定的
A. Credit Check Rule
Setup > Credit > Define Credit Check Rule
包括Credit Check的Level與Exposure的範圍





B. Credit Usage Rule
這是容易被忽略的部份
Setup > Credit > Define Usage Rules
定義Credit會發生的範圍設定..


Setup > Credit > Assign Usage Rules
指定Credit Rule應用的範圍..




2. Patch #448851
這個問題我在Oracle Forums討論了一段時間
http://forums.oracle.com/forums/thread.jspa?messageID=1640193
According to Note 334029.1------------------------------------------------------------
If the Credit Profile at the Site level is not defined,
the Credit Checkprocessing does not go to the Account (Customer) level Credit Profile.
Apply Patch #4488851,
Cons11510.2cu.9:Credt Chck Not Wrking When Crdt Limit Set At Customer Hdr Level.
Fixed in OEXUCRCB.pls, version 115.82.11510.7.
---------------------------------------------------------------------------------------
未上patch前,當Credit Limit設置在Customer Level時
Book時會因Site level未設定Credit Limit而忽略所有的Credit限制
需上此patch以正確判斷Credit

3. Enable Credit Exposure Calculate


Concurrent Program :
Initialize Credit Summaries Table
Run this program periodically....

4. Customer Credit:

當啟動Multi-currency Credit Check (AR: Credit Limit profile設為MILTI)
則只能設一個幣別的Credit Limit...
當使用Single-currency Credit Check (AR: Credit Limit profile設為SINGLE)
則每一個幣別的Credit Limit要分別設定...

Interface -[OM] OE Order interface

如下為一程式轉TP P/O到KS S/O做調料使用,
本程式用的是S/O的interface
(此外也可以用OE API來做S/O的操控..)
主要分為兩部份
一是將P/O資料抓入Cursor後依序轉入S/O interface
一是submit request去跑Import Order的程式
而由於import order的程式有一個參數(Org id)並無法Assign
因為本程式產生KS單,就要在KS環境下執行

需特別注意的是Profile
OM: Import Multiple Shipments請設為Yes
否則在Line與Shipment的REF上就一定要設為唯一的..

/*
Program No. : TWMSTP01.sql
(Twinhead MST P-01 .sql)
=======================================================================================
1.1 Get Data from approved PO
1.2 Insert into OE interface
2.1 Run Order Import Request
3.1 Return the Result Order Number or the Error Code
=======================================================================================
Date Author Status Reason
2006/12/01 Zhxiang Created For PMC materials Allocation
Create TKH-PO Manually
And Transfer CKS-OE via this program
(TKH PO) ---> (CKS OE) use only
Standard(CKS)
... this program need to be set in CKS resp.
=======================================================================================
*/

SET serveroutput on size 200000

VARIABLE P_PO_NUMBER varchar2(30)
VARIABLE P_SALES_CHANNEL_CODE varchar2(30)
VARIABLE g_debug varchar2(30)
VARIABLE P_SO_NUMBER varchar2(30)

EXEC :P_PO_NUMBER := '&&1'
EXEC :P_SALES_CHANNEL_CODE := '&&2'
EXEC :P_SO_NUMBER := '&&3'

/***************************************************
** Insert into CKS-OE interface from PO **
****************************************************/
SET SERVEROUTPUT ON;
Declare
v_ORDER_SOURCE_ID NUMBER;
v_ORDER_TYPE_ID NUMBER;
v_PRICE_LIST_ID NUMBER;
v_po_ou_id NUMBER := 102; --TKH OU
v_po_org_id NUMBER := 104; --TKH ORG
v_so_ou_id NUMBER := 106; --CKS OU
v_so_org_id NUMBER := 107; --CKS ORG
v_SOLD_TO_ORG_ID NUMBER := 1042; --Twinhead
v_SHIP_TO_ORG_ID NUMBER;
v_INVOICE_TO_ORG_ID NUMBER := 1048; --Twinhead Taipei
v_PAYMENT_TERM_ID NUMBER;

v_soh_ref varchar2(100);
v_sol_ref varchar2(100);
v_sos_ref varchar2(100);
v_cust_po varchar2(100);



v_req number;
v_phase VARCHAR2(200);
v_status VARCHAR2(200);
v_dev_phase VARCHAR2(200);
v_dev_status VARCHAR2(200);
v_message VARCHAR2(200);
v_success Boolean;

CURSOR FM_PO_headers_all is
SELECT pha.po_header_id po_header_id,
pha.attribute1 po_type, --po order type
pha.segment1 po_no, --po number.
pha.currency_code, --currency
pha.rate_type --corporate
FROM po_headers_all pha
WHERE pha.org_id = v_po_ou_id
AND pha.CREATION_DATE>TO_DATE('01-jul-05')
AND NVL(pha.APPROVED_FLAG,'N')='Y'
AND pha.segment1 = :P_PO_NUMBER
AND ATTRIBUTE13 is NULL -- <> 'CKS-OE IMPORTED'
and NVL(pha.cancel_flag,'N')='N'
order by pha.po_header_id;

CURSOR FM_PO_lines_all(v_po_header_id in number) IS
select
pla.item_id item_id,
pla.unit_meas_lookup_code uom_code,
pla.po_line_id po_line_id,
pla.line_num line_num,
pla.unit_price unit_price,
count(plla.LINE_LOCATION_ID) ship_count
from po_line_locations_all plla,
po_lines_all pla,
po_headers_all pha
where pha.po_header_id = v_po_header_id
and pha.po_header_id = pla.po_header_id
and pla.quantity > 0
and NVL(pla.cancel_flag,'N') = 'N'
and plla.PO_LINE_ID=pla.po_line_id
and NVL(plla.cancel_flag,'N')='N'
and plla.QUANTITY > 0
group by pla.item_id,pla.unit_meas_lookup_code,pla.po_line_id,pla.line_num,pla.unit_price;

CURSOR FM_PO_shipments_all(v_po_line_id in number) IS
select SHIPMENT_NUM,quantity qty,need_by_date
from po_line_locations_all
where po_line_id = v_po_line_id
and NVL(cancel_flag,'N')='N'
and QUANTITY > 0
ORDER BY LINE_LOCATION_ID;
Begin
dbms_output.put_line('Start to Get Base Info.');

select TRANSACTION_TYPE_ID
into v_ORDER_TYPE_ID
from OE_TRANSACTION_TYPES_TL
where NAME='Standard(CKS)';

select ORDER_SOURCE_ID
into v_ORDER_SOURCE_ID
from OE_ORDER_SOURCES
where name ='MIS';

select LIST_HEADER_ID
into v_PRICE_LIST_ID
from QP_LIST_HEADERS_TL
where name='Twinhead Corporate';

if upper(:P_SALES_CHANNEL_CODE) = upper('Export-CSC') then
v_SHIP_TO_ORG_ID:=1056; -- ship to K.H. 1046
else
v_SHIP_TO_ORG_ID:=1050; -- ship to T.P.
end if;

select TERM_ID
into v_PAYMENT_TERM_ID
from RA_TERMS_TL
where NAME='O/A 60';
------ ------ ------ ------ ------ ------ ------ ------ ------
dbms_output.put_line('Start to Get PO info.');
------ ------ ------ ------ ------ ------ ------ ------ ------
For r1 in FM_PO_headers_all loop

DBMS_OUTPUT.PUT_LINE('PO will be transfer: 'chr(10)r1.po_no' 'r1.currency_code' 'r1.rate_type);

v_soh_ref :='MST'to_char(sysdate,'YYYYMMDDHH24MISS');
v_cust_po :=r1.po_typer1.po_no;

--insert into oe_headers_iface_all
insert into oe_headers_iface_all
(ORIG_SYS_DOCUMENT_REF,
ORDER_SOURCE_ID,
ORDER_TYPE_ID,
PRICE_LIST_ID,
SALESREP_ID,
PAYMENT_TERM_ID,
CUSTOMER_PO_NUMBER,
SOLD_FROM_ORG_ID,
SHIP_FROM_ORG_ID,
SOLD_TO_ORG_ID,
SHIP_TO_ORG_ID,
INVOICE_TO_ORG_ID,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
OPERATION_CODE,
TRANSACTIONAL_CURR_CODE,
ORG_ID,
ORDER_NUMBER
)
values
(v_soh_ref, --ORIG_SYS_DOCUMENT_REF,
v_ORDER_SOURCE_ID, --ORDER_SOURCE_ID,
v_ORDER_TYPE_ID, --ORDER_TYPE_ID,
v_PRICE_LIST_ID, --PRICE_LIST_ID,
-3,--SALESREP_ID,
v_PAYMENT_TERM_ID, --PAYMENT_TERM_ID,
v_cust_po, --CUSTOMER_PO_NUMBER,
v_so_ou_id, --SOLD_FROM_ORG_ID,
v_so_org_id, --SHIP_FROM_ORG_ID,
v_SOLD_TO_ORG_ID, --SOLD_TO_ORG_ID,
v_SHIP_TO_ORG_ID, --SHIP_TO_ORG_ID,
v_INVOICE_TO_ORG_ID, --INVOICE_TO_ORG_ID,
0, --CREATED_BY,
sysdate, --CREATEION_DATE,
0, --LAST_UPDATED_BY,
sysdate, --LAST_UPDATE_DATE,
'INSERT', --OPERATION_CODE
r1.currency_code,
v_so_ou_id,
:P_SO_NUMBER
);
----
For r2 in FM_PO_lines_all(r1.po_header_id) loop
v_sol_ref:=v_soh_ref'-'to_char(r2.line_num);
--
For r3 in FM_PO_shipments_all(r2.po_line_id) loop
v_sos_ref:=v_sol_ref'-'to_char(r3.SHIPMENT_NUM);
DBMS_OUTPUT.PUT_LINE('Line Detail: 'to_char(r2.line_num)' 'to_char(r2.item_id)
' 'to_char(r2.unit_price)chr(10)
' --- 'to_char(r3.qty)' 'to_char(r3.need_by_date,'DD-MON-YYYY'));
--insert into oe_lines_iface_all
insert into oe_lines_iface_all
(ORIG_SYS_DOCUMENT_REF,
ORIG_SYS_LINE_REF,
ORIG_SYS_SHIPMENT_REF,
ORDER_SOURCE_ID,
INVENTORY_ITEM_ID,
REQUEST_DATE,
DELIVERY_LEAD_TIME,
DELIVERY_ID,
ORDERED_QUANTITY,
ORDER_QUANTITY_UOM,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
PRICE_LIST_ID,
UNIT_LIST_PRICE,
UNIT_SELLING_PRICE,
CALCULATE_PRICE_FLAG,
OPERATION_CODE,
ORG_ID
)
values
(v_soh_ref, --ORIG_SYS_DOCUMENT_REF,
v_sol_ref, --ORIG_SYS_LINE_REF,
v_sos_ref, --ORIG_SYS_SHIPMENT_REF,
v_ORDER_SOURCE_ID, --ORDER_SOURCE_ID,
r2.item_id, --INVENTORY_ITEM_ID,
r3.need_by_date, --REQUEST_DATE,
0, --DELIVERY_LEAD_TIME,
NULL, --DELIVERY_ID,
r3.qty, --ORDERED_QUANTITY,
r2.uom_code, --ORDER_QUANTITY_UOM,
0, --CREATED_BY,
SYSDATE, --CREATION_DATE,
0, --LAST_UPDATED_BY,
SYSDATE, --LAST_UPDATE_DATE
v_PRICE_LIST_ID,
r2.unit_price,
r2.unit_price,
'N',
'INSERT',
v_so_ou_id
);
end loop; --R3
--
end loop; --R2
----
end loop; --R1
------

/**********************************************
** Run Order Import and Show Result **
***********************************************/

dbms_output.put_line('Start to Run Oracle Report.');
----------------------------------------------------
v_req:=FND_REQUEST.SUBMIT_REQUEST(
'ONT',
'OEOIMP',
'',
to_char(SYSDATE,'DD-MON-YYYY HH24:MI'),
FALSE,
1001,v_soh_ref,'','N',1,4,'','','','Y',
'Y',chr(0),'','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','',
'','','','','','','','','','');-- 100 ARGUMENTS FROM THE BEGINNING

if v_req<=0 then dbms_output.put_line('!!!ERROR!!! SUBMIT REQUEST ERROR.'); :g_debug:='error'; end if; COMMIT; dbms_output.put_line(' the req id is 'to_char(v_req)); v_success:=fnd_concurrent.WAIT_FOR_REQUEST(v_req,10,0,v_phase,v_status,v_dev_phase,v_dev_status,v_message); if v_dev_status='NORMAL' and v_dev_phase = 'COMPLETE' then dbms_output.put_line('!!!Success!!!' ); else dbms_output.put_line('!!!ERROR!!! The status is 'v_dev_status' 'v_dev_phase); :g_debug:='error'; end if; --final update @20070205 For r1 in FM_PO_headers_all loop update po_headers_all set ATTRIBUTE13='CKS-OE IMPORTED' where po_header_id=r1.po_header_id; commit; end loop; ---------------------------------------------------- dbms_output.put_line('...............OK.'); Exception When others then DBMS_OUTPUT.PUT_LINE('ERROR: ':g_debug); End; /

2007年1月24日 星期三

OM Setup Detail Notes

在CRP階段又發現部分OM的設定有缺漏
會造成一些奇怪的現象
使操作不太順

記錄如下
當下次補設定Prod環境時要記得補上

1. Ship Confirm時會跳出重量未輸入的Warning

修改路徑 : OM Super User > Shipping > Setup > Shipping Parameters
* Percent Fill Basis : 改為None
* Export Compliance Screening : 改為Not Required

2.Ship Confirm後狀態卡在要跑Trip-stop Interface

修改路徑 : OM Super User > Shipping > Setup > Global Parameters (General分頁)

* Miscellaneous : 勾選所有的Check box=>存檔=>再勾掉所有的Check box=>存檔
此狀況之所以發生應該是Oracle的Bug
因為原本就沒有勾選
但是要重新存檔..確認真的沒有勾選..系統才能正確運作


3.Disable不必要的Exceptions

Oracle提供的Exception有些不符所需
如不照出貨日期出貨等

修改路徑 : OM Super User > Shipping > Setup > Define Exceptions
disable以下幾個
* WSH_CHANGE_SCHED_DATE
* WSH_INVALID_TPDATES