Sample Code :
CREATE PROCEDURE XXX_UPDATE_PO_PRICE(I_PO_NO VARCHAR2,
I_PO_LINE NUMBER,
I_SHIPMENT NUMBER,
I_NEW_PRICE NUMBER,
I_REVISION NUMBER DEFAULT NULL,
I_RELEASE NUMBER DEFAULT NULL)
IS
T_RESUTL NUMBER;
T_API_ERRORS PO_API_ERRORS_REC_TYPE;
BEGIN
--INITIALIZE
FND_GLOBAL.APPS_INITIALIZE(USER_ID => I_USERID,
RESP_ID => 50649, --Modify it.
RESP_APPL_ID => 201); --Modify it.
--
T_RESULT := PO_CHANGE_API1_S.UPDATE_PO(X_PO_NUMBER => I_PO_NO,
X_RELEASE_NUMBER => I_RELEASE,
X_REVISION_NUMBER => I_REVISION,
X_LINE_NUMBER => I_PO_LINE,
X_SHIPMENT_NUMBER => I_SHIPMENT,
NEW_QUANTITY => NULL,
NEW_PRICE => I_NEW_PRICE,
NEW_PROMISED_DATE => NULL,
LAUNCH_APPROVALS_FLAG => 'Y',
UPDATE_SOURCE => 'UPDATE BY API', --Modify it.
VERSION => '1.0',
X_API_ERRORS => T_API_ERRORS,
p_secondary_quantity => NULL,
p_preferred_grade => NULL);
--
COMMIT;
END;
1. 這是個初學農友的農友日誌~ 2. Oracle ERP 分享 3. Oracle DBA 心得 4. Android 開發心得 5. MoJo寵物手作粉絲成員 6. 程式客製及外包專案接案
2012年12月26日 星期三
Oracle ERP R12. - Inactive Price List by API
Sample Code :
CREATE OR REPLACE PROCEDURE XXX_INACTIVE_PRICE_LIST(I_ORG_ID IN NUMBER,
I_LIST_HEADER_ID IN NUMBER,
I_PURGE_LINE IN VARCHAR2 DEFAULT 'N')
IS
/*L_USER_ID NUMBER;
L_RESP_ID NUMBER;
L_APPL_ID NUMBER;*/
gpr_return_status varchar2(1) := NULL;
gpr_msg_count number := 0;
gpr_msg_data varchar2(2000);
gpr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type;
gpr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type;
gpr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type;
gpr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type;
gpr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type;
gpr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type;
gpr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type;
gpr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type;
ppr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type;
ppr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type;
ppr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type;
ppr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type;
ppr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type;
ppr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type;
ppr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type;
ppr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type;
--
CURSOR C_LINES IS
SELECT DISTINCT QLL.LIST_LINE_ID
FROM QP_LIST_LINES QLL
WHERE QLL.LIST_HEADER_ID = I_LIST_HEADER_ID;
BEGIN
/*SELECT USER_ID
INTO L_USER_ID
FROM FND_USER WHERE USER_NAME = 'A0964';
--
SELECT RESPONSIBILITY_ID, APPLICATION_ID
INTO L_RESP_ID, L_APPL_ID
FROM FND_RESPONSIBILITY_VL
WHERE UPPER(RESPONSIBILITY_NAME) LIKE 'OM FOR SUPERUSER(TSN)';
--
FND_GLOBAL.APPS_INITIALIZE(L_USER_ID, L_RESP_ID, L_APPL_ID);*/
gpr_price_list_rec.list_type_code := 'PRL';
gpr_price_list_rec.operation := QP_GLOBALS.G_OPR_UPDATE;
gpr_price_list_rec.active_flag := 'N';
gpr_price_list_rec.list_header_id := I_LIST_HEADER_ID;
gpr_price_list_rec.comments := 'Inactive by SYSADMIN';
--
QP_PRICE_LIST_PUB.Process_Price_List(p_api_version_number => 1,
p_init_msg_list => FND_API.G_FALSE,
p_return_values => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
x_return_status => gpr_return_status,
x_msg_count => gpr_msg_count,
x_msg_data => gpr_msg_data,
p_PRICE_LIST_rec => gpr_price_list_rec,
p_PRICE_LIST_LINE_tbl => gpr_price_list_line_tbl,
p_PRICING_ATTR_tbl => gpr_pricing_attr_tbl,
x_PRICE_LIST_rec => ppr_price_list_rec,
x_PRICE_LIST_val_rec => ppr_price_list_val_rec,
x_PRICE_LIST_LINE_tbl => ppr_price_list_line_tbl,
x_PRICE_LIST_LINE_val_tbl => ppr_price_list_line_val_tbl,
x_QUALIFIERS_tbl => ppr_qualifiers_tbl,
x_QUALIFIERS_val_tbl => ppr_qualifiers_val_tbl,
x_PRICING_ATTR_tbl => ppr_pricing_attr_tbl,
x_PRICING_ATTR_val_tbl => ppr_pricing_attr_val_tbl);
--
COMMIT;
--
IF I_PURGE_LINE = 'Y' THEN
FOR C1 IN C_LINES LOOP
gpr_price_list_line_tbl(1).list_line_id := C1.LIST_LINE_ID;
gpr_price_list_line_tbl(1).list_line_type_code := 'PLL';
gpr_price_list_line_tbl(1).operation := QP_GLOBALS.G_OPR_DELETE;
QP_PRICE_LIST_PUB.Process_Price_List(p_api_version_number => 1,
p_init_msg_list => FND_API.G_FALSE,
p_return_values => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
x_return_status => gpr_return_status,
x_msg_count => gpr_msg_count,
x_msg_data => gpr_msg_data,
p_PRICE_LIST_rec => gpr_price_list_rec,
p_PRICE_LIST_LINE_tbl => gpr_price_list_line_tbl,
p_PRICING_ATTR_tbl => gpr_pricing_attr_tbl,
x_PRICE_LIST_rec => ppr_price_list_rec,
x_PRICE_LIST_val_rec => ppr_price_list_val_rec,
x_PRICE_LIST_LINE_tbl => ppr_price_list_line_tbl,
x_PRICE_LIST_LINE_val_tbl => ppr_price_list_line_val_tbl,
x_QUALIFIERS_tbl => ppr_qualifiers_tbl,
x_QUALIFIERS_val_tbl => ppr_qualifiers_val_tbl,
x_PRICING_ATTR_tbl => ppr_pricing_attr_tbl,
x_PRICING_ATTR_val_tbl => ppr_pricing_attr_val_tbl);
COMMIT;
END LOOP;
END IF;
END;
CREATE OR REPLACE PROCEDURE XXX_INACTIVE_PRICE_LIST(I_ORG_ID IN NUMBER,
I_LIST_HEADER_ID IN NUMBER,
I_PURGE_LINE IN VARCHAR2 DEFAULT 'N')
IS
/*L_USER_ID NUMBER;
L_RESP_ID NUMBER;
L_APPL_ID NUMBER;*/
gpr_return_status varchar2(1) := NULL;
gpr_msg_count number := 0;
gpr_msg_data varchar2(2000);
gpr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type;
gpr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type;
gpr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type;
gpr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type;
gpr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type;
gpr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type;
gpr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type;
gpr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type;
ppr_price_list_rec QP_PRICE_LIST_PUB.Price_List_Rec_Type;
ppr_price_list_val_rec QP_PRICE_LIST_PUB.Price_List_Val_Rec_Type;
ppr_price_list_line_tbl QP_PRICE_LIST_PUB.Price_List_Line_Tbl_Type;
ppr_price_list_line_val_tbl QP_PRICE_LIST_PUB.Price_List_Line_Val_Tbl_Type;
ppr_qualifiers_tbl QP_Qualifier_Rules_Pub.Qualifiers_Tbl_Type;
ppr_qualifiers_val_tbl QP_Qualifier_Rules_Pub.Qualifiers_Val_Tbl_Type;
ppr_pricing_attr_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Tbl_Type;
ppr_pricing_attr_val_tbl QP_PRICE_LIST_PUB.Pricing_Attr_Val_Tbl_Type;
--
CURSOR C_LINES IS
SELECT DISTINCT QLL.LIST_LINE_ID
FROM QP_LIST_LINES QLL
WHERE QLL.LIST_HEADER_ID = I_LIST_HEADER_ID;
BEGIN
/*SELECT USER_ID
INTO L_USER_ID
FROM FND_USER WHERE USER_NAME = 'A0964';
--
SELECT RESPONSIBILITY_ID, APPLICATION_ID
INTO L_RESP_ID, L_APPL_ID
FROM FND_RESPONSIBILITY_VL
WHERE UPPER(RESPONSIBILITY_NAME) LIKE 'OM FOR SUPERUSER(TSN)';
--
FND_GLOBAL.APPS_INITIALIZE(L_USER_ID, L_RESP_ID, L_APPL_ID);*/
gpr_price_list_rec.list_type_code := 'PRL';
gpr_price_list_rec.operation := QP_GLOBALS.G_OPR_UPDATE;
gpr_price_list_rec.active_flag := 'N';
gpr_price_list_rec.list_header_id := I_LIST_HEADER_ID;
gpr_price_list_rec.comments := 'Inactive by SYSADMIN';
--
QP_PRICE_LIST_PUB.Process_Price_List(p_api_version_number => 1,
p_init_msg_list => FND_API.G_FALSE,
p_return_values => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
x_return_status => gpr_return_status,
x_msg_count => gpr_msg_count,
x_msg_data => gpr_msg_data,
p_PRICE_LIST_rec => gpr_price_list_rec,
p_PRICE_LIST_LINE_tbl => gpr_price_list_line_tbl,
p_PRICING_ATTR_tbl => gpr_pricing_attr_tbl,
x_PRICE_LIST_rec => ppr_price_list_rec,
x_PRICE_LIST_val_rec => ppr_price_list_val_rec,
x_PRICE_LIST_LINE_tbl => ppr_price_list_line_tbl,
x_PRICE_LIST_LINE_val_tbl => ppr_price_list_line_val_tbl,
x_QUALIFIERS_tbl => ppr_qualifiers_tbl,
x_QUALIFIERS_val_tbl => ppr_qualifiers_val_tbl,
x_PRICING_ATTR_tbl => ppr_pricing_attr_tbl,
x_PRICING_ATTR_val_tbl => ppr_pricing_attr_val_tbl);
--
COMMIT;
--
IF I_PURGE_LINE = 'Y' THEN
FOR C1 IN C_LINES LOOP
gpr_price_list_line_tbl(1).list_line_id := C1.LIST_LINE_ID;
gpr_price_list_line_tbl(1).list_line_type_code := 'PLL';
gpr_price_list_line_tbl(1).operation := QP_GLOBALS.G_OPR_DELETE;
QP_PRICE_LIST_PUB.Process_Price_List(p_api_version_number => 1,
p_init_msg_list => FND_API.G_FALSE,
p_return_values => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
x_return_status => gpr_return_status,
x_msg_count => gpr_msg_count,
x_msg_data => gpr_msg_data,
p_PRICE_LIST_rec => gpr_price_list_rec,
p_PRICE_LIST_LINE_tbl => gpr_price_list_line_tbl,
p_PRICING_ATTR_tbl => gpr_pricing_attr_tbl,
x_PRICE_LIST_rec => ppr_price_list_rec,
x_PRICE_LIST_val_rec => ppr_price_list_val_rec,
x_PRICE_LIST_LINE_tbl => ppr_price_list_line_tbl,
x_PRICE_LIST_LINE_val_tbl => ppr_price_list_line_val_tbl,
x_QUALIFIERS_tbl => ppr_qualifiers_tbl,
x_QUALIFIERS_val_tbl => ppr_qualifiers_val_tbl,
x_PRICING_ATTR_tbl => ppr_pricing_attr_tbl,
x_PRICING_ATTR_val_tbl => ppr_pricing_attr_val_tbl);
COMMIT;
END LOOP;
END IF;
END;
Oracle ERP R12. - Update Sales Order promise date / request date / explosion date by API
Sample code :
PROCEDURE XXX_UPDATE_SO_DATE(I_HEADER_ID IN NUMBER,
I_LINE_ID IN NUMBER,
I_REQUEST_DATE IN DATE,
I_EXPLOSION_DATE IN DATE,
I_PROMISE_DATE IN DATE,
O_RESULT OUT VARCHAR2) IS
/*L_USER_ID NUMBER;
L_RESP_ID NUMBER;
L_APPL_ID NUMBER;*/
L_LINE_TBL_IN OE_ORDER_PUB.LINE_TBL_TYPE;
L_HEADER_REC_OUT OE_ORDER_PUB.HEADER_REC_TYPE;
L_LINE_TBL_OUT OE_ORDER_PUB.LINE_TBL_TYPE;
L_HEADER_VAL_REC_OUT OE_ORDER_PUB.HEADER_VAL_REC_TYPE;
L_HEADER_ADJ_TBL_OUT OE_ORDER_PUB.HEADER_ADJ_TBL_TYPE;
L_HEADER_ADJ_VAL_TBL_OUT OE_ORDER_PUB.HEADER_ADJ_VAL_TBL_TYPE;
L_HEADER_PRICE_ATT_TBL_OUT OE_ORDER_PUB.HEADER_PRICE_ATT_TBL_TYPE;
L_HEADER_ADJ_ATT_TBL_OUT OE_ORDER_PUB.HEADER_ADJ_ATT_TBL_TYPE;
L_HEADER_ADJ_ASSOC_TBL_OUT OE_ORDER_PUB.HEADER_ADJ_ASSOC_TBL_TYPE;
L_HEADER_SCREDIT_TBL_OUT OE_ORDER_PUB.HEADER_SCREDIT_TBL_TYPE;
L_HEADER_SCREDIT_VAL_TBL_OUT OE_ORDER_PUB.HEADER_SCREDIT_VAL_TBL_TYPE;
L_LINE_VAL_TBL_OUT OE_ORDER_PUB.LINE_VAL_TBL_TYPE;
L_LINE_ADJ_TBL_OUT OE_ORDER_PUB.LINE_ADJ_TBL_TYPE;
L_LINE_ADJ_VAL_TBL_OUT OE_ORDER_PUB.LINE_ADJ_VAL_TBL_TYPE;
L_LINE_PRICE_ATT_TBL_OUT OE_ORDER_PUB.LINE_PRICE_ATT_TBL_TYPE;
L_LINE_ADJ_ATT_TBL_OUT OE_ORDER_PUB.LINE_ADJ_ATT_TBL_TYPE;
L_LINE_ADJ_ASSOC_TBL_OUT OE_ORDER_PUB.LINE_ADJ_ASSOC_TBL_TYPE;
L_LINE_SCREDIT_TBL_OUT OE_ORDER_PUB.LINE_SCREDIT_TBL_TYPE;
L_LINE_SCREDIT_VAL_TBL_OUT OE_ORDER_PUB.LINE_SCREDIT_VAL_TBL_TYPE;
L_LOT_SERIAL_TBL_OUT OE_ORDER_PUB.LOT_SERIAL_TBL_TYPE;
L_LOT_SERIAL_VAL_TBL_OUT OE_ORDER_PUB.LOT_SERIAL_VAL_TBL_TYPE;
L_ACTION_REQUEST_TBL_OUT OE_ORDER_PUB.REQUEST_TBL_TYPE;
L_MSG_COUNT NUMBER := 0;
L_MSG_DATA VARCHAR2(2000);
L_NUM_API_VERSION NUMBER := 1.0;
BEGIN
/*
SELECT USER_ID
INTO L_USER_ID
FROM FND_USER WHERE USER_NAME = 'A0964';
--
SELECT RESPONSIBILITY_ID, APPLICATION_ID
INTO L_RESP_ID, L_APPL_ID
FROM FND_RESPONSIBILITY_VL
WHERE UPPER(RESPONSIBILITY_NAME) LIKE 'OM FOR SUPERUSER';
--
FND_GLOBAL.APPS_INITIALIZE(L_USER_ID, L_RESP_ID, L_APPL_ID);*/
--
L_LINE_TBL_IN(1) := OE_ORDER_PUB.G_MISS_LINE_REC;
L_LINE_TBL_IN(1).HEADER_ID := I_HEADER_ID;
L_LINE_TBL_IN(1).LINE_ID := I_LINE_ID;
L_LINE_TBL_IN(1).OPERATION := OE_GLOBALS.G_OPR_UPDATE;
--
IF I_EXPLOSION_DATE IS NOT NULL THEN
L_LINE_TBL_IN(1).EXPLOSION_DATE := TO_DATE(TO_CHAR(I_EXPLOSION_DATE,
'YYYY/MM/DD HH24:MI:SS'),
'YYYY/MM/DD HH24:MI:SS');
END IF;
--
IF I_PROMISE_DATE IS NOT NULL THEN
L_LINE_TBL_IN(1).PROMISE_DATE := TO_DATE(TO_CHAR(I_PROMISE_DATE,
'YYYY/MM/DD HH24:MI:SS'),
'YYYY/MM/DD HH24:MI:SS');
END IF;
--
IF I_REQUEST_DATE IS NOT NULL THEN
L_LINE_TBL_IN(1).REQUEST_DATE := TO_DATE(TO_CHAR(I_REQUEST_DATE,
'YYYY/MM/DD HH24:MI:SS'),
'YYYY/MM/DD HH24:MI:SS');
END IF;
--
OE_MSG_PUB.DELETE_MSG;
--CALL API
OE_ORDER_PUB.PROCESS_ORDER(P_API_VERSION_NUMBER => L_NUM_API_VERSION,
P_INIT_MSG_LIST => FND_API.G_FALSE,
P_RETURN_VALUES => FND_API.G_FALSE,
P_ACTION_COMMIT => FND_API.G_FALSE,
P_LINE_TBL => L_LINE_TBL_IN,
X_HEADER_REC => L_HEADER_REC_OUT,
X_HEADER_VAL_REC => L_HEADER_VAL_REC_OUT,
X_HEADER_ADJ_TBL => L_HEADER_ADJ_TBL_OUT,
X_HEADER_ADJ_VAL_TBL => L_HEADER_ADJ_VAL_TBL_OUT,
X_HEADER_PRICE_ATT_TBL => L_HEADER_PRICE_ATT_TBL_OUT,
X_HEADER_ADJ_ATT_TBL => L_HEADER_ADJ_ATT_TBL_OUT,
X_HEADER_ADJ_ASSOC_TBL => L_HEADER_ADJ_ASSOC_TBL_OUT,
X_HEADER_SCREDIT_TBL => L_HEADER_SCREDIT_TBL_OUT,
X_HEADER_SCREDIT_VAL_TBL => L_HEADER_SCREDIT_VAL_TBL_OUT,
X_LINE_TBL => L_LINE_TBL_OUT,
X_LINE_VAL_TBL => L_LINE_VAL_TBL_OUT,
X_LINE_ADJ_TBL => L_LINE_ADJ_TBL_OUT,
X_LINE_ADJ_VAL_TBL => L_LINE_ADJ_VAL_TBL_OUT,
X_LINE_PRICE_ATT_TBL => L_LINE_PRICE_ATT_TBL_OUT,
X_LINE_ADJ_ATT_TBL => L_LINE_ADJ_ATT_TBL_OUT,
X_LINE_ADJ_ASSOC_TBL => L_LINE_ADJ_ASSOC_TBL_OUT,
X_LINE_SCREDIT_TBL => L_LINE_SCREDIT_TBL_OUT,
X_LINE_SCREDIT_VAL_TBL => L_LINE_SCREDIT_VAL_TBL_OUT,
X_LOT_SERIAL_TBL => L_LOT_SERIAL_TBL_OUT,
X_LOT_SERIAL_VAL_TBL => L_LOT_SERIAL_VAL_TBL_OUT,
X_ACTION_REQUEST_TBL => L_ACTION_REQUEST_TBL_OUT,
X_RETURN_STATUS => O_RESULT,
X_MSG_COUNT => L_MSG_COUNT,
X_MSG_DATA => L_MSG_DATA);
--
IF L_MSG_COUNT > 0 THEN
FOR L_INDEX IN 1 .. L_MSG_COUNT LOOP
L_MSG_DATA := OE_MSG_PUB.GET(P_MSG_INDEX => L_INDEX, P_ENCODED => 'F');
END LOOP;
END IF;
--
IF O_RESULT = FND_API.G_RET_STS_SUCCESS THEN
COMMIT;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
PROCEDURE XXX_UPDATE_SO_DATE(I_HEADER_ID IN NUMBER,
I_LINE_ID IN NUMBER,
I_REQUEST_DATE IN DATE,
I_EXPLOSION_DATE IN DATE,
I_PROMISE_DATE IN DATE,
O_RESULT OUT VARCHAR2) IS
/*L_USER_ID NUMBER;
L_RESP_ID NUMBER;
L_APPL_ID NUMBER;*/
L_LINE_TBL_IN OE_ORDER_PUB.LINE_TBL_TYPE;
L_HEADER_REC_OUT OE_ORDER_PUB.HEADER_REC_TYPE;
L_LINE_TBL_OUT OE_ORDER_PUB.LINE_TBL_TYPE;
L_HEADER_VAL_REC_OUT OE_ORDER_PUB.HEADER_VAL_REC_TYPE;
L_HEADER_ADJ_TBL_OUT OE_ORDER_PUB.HEADER_ADJ_TBL_TYPE;
L_HEADER_ADJ_VAL_TBL_OUT OE_ORDER_PUB.HEADER_ADJ_VAL_TBL_TYPE;
L_HEADER_PRICE_ATT_TBL_OUT OE_ORDER_PUB.HEADER_PRICE_ATT_TBL_TYPE;
L_HEADER_ADJ_ATT_TBL_OUT OE_ORDER_PUB.HEADER_ADJ_ATT_TBL_TYPE;
L_HEADER_ADJ_ASSOC_TBL_OUT OE_ORDER_PUB.HEADER_ADJ_ASSOC_TBL_TYPE;
L_HEADER_SCREDIT_TBL_OUT OE_ORDER_PUB.HEADER_SCREDIT_TBL_TYPE;
L_HEADER_SCREDIT_VAL_TBL_OUT OE_ORDER_PUB.HEADER_SCREDIT_VAL_TBL_TYPE;
L_LINE_VAL_TBL_OUT OE_ORDER_PUB.LINE_VAL_TBL_TYPE;
L_LINE_ADJ_TBL_OUT OE_ORDER_PUB.LINE_ADJ_TBL_TYPE;
L_LINE_ADJ_VAL_TBL_OUT OE_ORDER_PUB.LINE_ADJ_VAL_TBL_TYPE;
L_LINE_PRICE_ATT_TBL_OUT OE_ORDER_PUB.LINE_PRICE_ATT_TBL_TYPE;
L_LINE_ADJ_ATT_TBL_OUT OE_ORDER_PUB.LINE_ADJ_ATT_TBL_TYPE;
L_LINE_ADJ_ASSOC_TBL_OUT OE_ORDER_PUB.LINE_ADJ_ASSOC_TBL_TYPE;
L_LINE_SCREDIT_TBL_OUT OE_ORDER_PUB.LINE_SCREDIT_TBL_TYPE;
L_LINE_SCREDIT_VAL_TBL_OUT OE_ORDER_PUB.LINE_SCREDIT_VAL_TBL_TYPE;
L_LOT_SERIAL_TBL_OUT OE_ORDER_PUB.LOT_SERIAL_TBL_TYPE;
L_LOT_SERIAL_VAL_TBL_OUT OE_ORDER_PUB.LOT_SERIAL_VAL_TBL_TYPE;
L_ACTION_REQUEST_TBL_OUT OE_ORDER_PUB.REQUEST_TBL_TYPE;
L_MSG_COUNT NUMBER := 0;
L_MSG_DATA VARCHAR2(2000);
L_NUM_API_VERSION NUMBER := 1.0;
BEGIN
/*
SELECT USER_ID
INTO L_USER_ID
FROM FND_USER WHERE USER_NAME = 'A0964';
--
SELECT RESPONSIBILITY_ID, APPLICATION_ID
INTO L_RESP_ID, L_APPL_ID
FROM FND_RESPONSIBILITY_VL
WHERE UPPER(RESPONSIBILITY_NAME) LIKE 'OM FOR SUPERUSER';
--
FND_GLOBAL.APPS_INITIALIZE(L_USER_ID, L_RESP_ID, L_APPL_ID);*/
--
L_LINE_TBL_IN(1) := OE_ORDER_PUB.G_MISS_LINE_REC;
L_LINE_TBL_IN(1).HEADER_ID := I_HEADER_ID;
L_LINE_TBL_IN(1).LINE_ID := I_LINE_ID;
L_LINE_TBL_IN(1).OPERATION := OE_GLOBALS.G_OPR_UPDATE;
--
IF I_EXPLOSION_DATE IS NOT NULL THEN
L_LINE_TBL_IN(1).EXPLOSION_DATE := TO_DATE(TO_CHAR(I_EXPLOSION_DATE,
'YYYY/MM/DD HH24:MI:SS'),
'YYYY/MM/DD HH24:MI:SS');
END IF;
--
IF I_PROMISE_DATE IS NOT NULL THEN
L_LINE_TBL_IN(1).PROMISE_DATE := TO_DATE(TO_CHAR(I_PROMISE_DATE,
'YYYY/MM/DD HH24:MI:SS'),
'YYYY/MM/DD HH24:MI:SS');
END IF;
--
IF I_REQUEST_DATE IS NOT NULL THEN
L_LINE_TBL_IN(1).REQUEST_DATE := TO_DATE(TO_CHAR(I_REQUEST_DATE,
'YYYY/MM/DD HH24:MI:SS'),
'YYYY/MM/DD HH24:MI:SS');
END IF;
--
OE_MSG_PUB.DELETE_MSG;
--CALL API
OE_ORDER_PUB.PROCESS_ORDER(P_API_VERSION_NUMBER => L_NUM_API_VERSION,
P_INIT_MSG_LIST => FND_API.G_FALSE,
P_RETURN_VALUES => FND_API.G_FALSE,
P_ACTION_COMMIT => FND_API.G_FALSE,
P_LINE_TBL => L_LINE_TBL_IN,
X_HEADER_REC => L_HEADER_REC_OUT,
X_HEADER_VAL_REC => L_HEADER_VAL_REC_OUT,
X_HEADER_ADJ_TBL => L_HEADER_ADJ_TBL_OUT,
X_HEADER_ADJ_VAL_TBL => L_HEADER_ADJ_VAL_TBL_OUT,
X_HEADER_PRICE_ATT_TBL => L_HEADER_PRICE_ATT_TBL_OUT,
X_HEADER_ADJ_ATT_TBL => L_HEADER_ADJ_ATT_TBL_OUT,
X_HEADER_ADJ_ASSOC_TBL => L_HEADER_ADJ_ASSOC_TBL_OUT,
X_HEADER_SCREDIT_TBL => L_HEADER_SCREDIT_TBL_OUT,
X_HEADER_SCREDIT_VAL_TBL => L_HEADER_SCREDIT_VAL_TBL_OUT,
X_LINE_TBL => L_LINE_TBL_OUT,
X_LINE_VAL_TBL => L_LINE_VAL_TBL_OUT,
X_LINE_ADJ_TBL => L_LINE_ADJ_TBL_OUT,
X_LINE_ADJ_VAL_TBL => L_LINE_ADJ_VAL_TBL_OUT,
X_LINE_PRICE_ATT_TBL => L_LINE_PRICE_ATT_TBL_OUT,
X_LINE_ADJ_ATT_TBL => L_LINE_ADJ_ATT_TBL_OUT,
X_LINE_ADJ_ASSOC_TBL => L_LINE_ADJ_ASSOC_TBL_OUT,
X_LINE_SCREDIT_TBL => L_LINE_SCREDIT_TBL_OUT,
X_LINE_SCREDIT_VAL_TBL => L_LINE_SCREDIT_VAL_TBL_OUT,
X_LOT_SERIAL_TBL => L_LOT_SERIAL_TBL_OUT,
X_LOT_SERIAL_VAL_TBL => L_LOT_SERIAL_VAL_TBL_OUT,
X_ACTION_REQUEST_TBL => L_ACTION_REQUEST_TBL_OUT,
X_RETURN_STATUS => O_RESULT,
X_MSG_COUNT => L_MSG_COUNT,
X_MSG_DATA => L_MSG_DATA);
--
IF L_MSG_COUNT > 0 THEN
FOR L_INDEX IN 1 .. L_MSG_COUNT LOOP
L_MSG_DATA := OE_MSG_PUB.GET(P_MSG_INDEX => L_INDEX, P_ENCODED => 'F');
END LOOP;
END IF;
--
IF O_RESULT = FND_API.G_RET_STS_SUCCESS THEN
COMMIT;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
2012年12月25日 星期二
Oracle ERP R12. - Close PO by API
Sample code for close PO by API.
CREATE PROCEDURE XXX_CLOSE_PO_LINE(I_PO_HEADER_ID IN NUMBER,
I_PO_LINE_ID IN NUMBER,
I_ACTION IN VARCHAR2,
I_REASON IN VARCHAR2,
I_USER_ID IN NUMBER,
O_RESULT OUT BOOLEAN,
O_RETURN_CODE OUT VARCHAR2)
IS
BEGIN
FND_GLOBAL.APPS_INITIALIZE (USER_ID => I_USER_ID,
RESP_ID => 20707, --Modify it.
RESP_APPL_ID => 201); --Modify it.
--
O_RESULT := PO_ACTIONS.CLOSE_PO(P_DOCID => I_PO_HEADER_ID,
P_DOCTYP => 'PO',
P_DOCSUBTYP => 'STANDARD',
P_LINEID => I_PO_LINE_ID,
P_SHIPID => NULL,
P_ACTION => 'CLOSE',
P_REASON => I_REASON,
P_CALLING_MODE => 'PO',
P_CONC_FLAG => 'N',
P_RETURN_CODE => O_RETURN_CODE,
P_AUTO_CLOSE => 'N',
P_ACTION_DATE => SYSDATE,
P_ORIGIN_DOC_ID => NULL);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END XXX_CLOSE_PO_LINE;
CREATE PROCEDURE XXX_CLOSE_PO_LINE(I_PO_HEADER_ID IN NUMBER,
I_PO_LINE_ID IN NUMBER,
I_ACTION IN VARCHAR2,
I_REASON IN VARCHAR2,
I_USER_ID IN NUMBER,
O_RESULT OUT BOOLEAN,
O_RETURN_CODE OUT VARCHAR2)
IS
BEGIN
FND_GLOBAL.APPS_INITIALIZE (USER_ID => I_USER_ID,
RESP_ID => 20707, --Modify it.
RESP_APPL_ID => 201); --Modify it.
--
O_RESULT := PO_ACTIONS.CLOSE_PO(P_DOCID => I_PO_HEADER_ID,
P_DOCTYP => 'PO',
P_DOCSUBTYP => 'STANDARD',
P_LINEID => I_PO_LINE_ID,
P_SHIPID => NULL,
P_ACTION => 'CLOSE',
P_REASON => I_REASON,
P_CALLING_MODE => 'PO',
P_CONC_FLAG => 'N',
P_RETURN_CODE => O_RETURN_CODE,
P_AUTO_CLOSE => 'N',
P_ACTION_DATE => SYSDATE,
P_ORIGIN_DOC_ID => NULL);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END XXX_CLOSE_PO_LINE;
Oracle ERP R12. - Approval PO By API
Sample code for approval PO by API.
CREATE OR REPLACE PROCEDURE XX_PO_APPROVE_ACTION(I_HEADER_ID IN NUMBER,
X_RET_CODE OUT VARCHAR2, --S : Success / E : Error
X_RET_MSG OUT VARCHAR2 --Error message
)
IS
/**********************************************************************
I_ACTION ==>
*********************************************************************/
V_STATUS VARCHAR2(100); --For check this HEADER_ID Status. (Is 'INCOMPLETE' ?)
V_RETURN_CODE VARCHAR2(1) := 'S'; --Process status code ==> S : Success / E : Error
V_RETURN_MSG VARCHAR2(2000); --Error message
V_ITEM_KEY VARCHAR2(200); --For API
V_ITEM_TYPE VARCHAR2(20);
V_SEGMENT1 PO_HEADERS_ALL.SEGMENT1%TYPE; --For API
V_PREPARER_ID PO_HEADERS_ALL.AGENT_ID%TYPE; --For API
V_DOCUMENT_TYPE_CODE PO_DOCUMENT_TYPES_ALL.DOCUMENT_TYPE_CODE%TYPE; --For API
V_DOCUMENT_SUBTYPE PO_DOCUMENT_TYPES_ALL.DOCUMENT_SUBTYPE%TYPE; --For API
BEGIN
--Check PO HEADER_ID is exists ?
BEGIN
SELECT AUTHORIZATION_STATUS
INTO V_STATUS
FROM PO_HEADERS_ALL A
WHERE A.PO_HEADER_ID = I_HEADER_ID;
EXCEPTION
WHEN NO_DATA_FOUND THEN
V_STATUS := NULL;
V_RETURN_MSG := 'No data found : PO_HEADER_ID ==> '||I_HEADER_ID;
V_RETURN_CODE := 'E';
END;
IF V_RETURN_CODE = 'S' THEN
BEGIN
--Find API parameters
SELECT pha.org_id,
pha.agent_id,
pha.segment1,
pha.wf_item_type,
pha.wf_item_key,
pdt.document_subtype,
pdt.document_type_code
INTO V_ORG_ID,
V_PREPARER_ID,
V_SEGMENT1,
v_ITEM_TYPE,
V_ITEM_KEY,
V_DOCUMENT_SUBTYPE,
V_DOCUMENT_TYPE_CODE
FROM apps.po_headers_all pha, apps.po_document_types_all pdt
WHERE pha.type_lookup_code = pdt.document_subtype
AND pha.org_id = pdt.org_id
AND pdt.document_type_code = 'PO'
AND pha.PO_HEADER_ID = I_HEADER_ID;
EXCEPTION
WHEN OTHERS THEN
V_RETURN_MSG := 'No data found : po_document_types_all - ' || sqlerrm;
V_RETURN_CODE := 'E';
END;
END IF;
IF V_RETURN_CODE = 'S' THEN
mo_global.init('PO');
mo_global.set_policy_context('S', V_ORG_ID);
SELECT I_HEADER_ID /*P_EP_PO_HEADER_ID*/
|| '-' || TO_CHAR(PO_WF_ITEMKEY_S.NEXTVAL)
INTO V_ITEM_KEY
FROM DUAL;
--ORACLE API
BEGIN
--Restart WorkFlow
PO_REQAPPROVAL_INIT1.START_WF_PROCESS(ItemType => V_ITEM_TYPE, --'POAPPRV',
ItemKey => V_ITEM_KEY,
WorkflowProcess => 'POAPPRV_TOP',
ActionOriginatedFrom => 'PO_FORM',
DocumentID => I_HEADER_ID,
DocumentNumber => V_SEGMENT1, -- Purchase Order Number
PreparerID => V_PREPARER_ID, -- Buyer/Preparer_id
DocumentTypeCode => V_DOCUMENT_TYPE_CODE,
DocumentSubtype => V_DOCUMENT_SUBTYPE,
SubmitterAction => 'APPROVE',
forwardToID => NULL,
forwardFromID => NULL,
DefaultApprovalPathID => NULL,
Note => NULL,
PrintFlag => 'N',
FaxFlag => 'N',
FaxNumber => NULL,
EmailFlag => 'N',
EmailAddress => NULL,
CreateSourcingRule => 'N',
ReleaseGenMethod => 'N',
UpdateSourcingRule => 'N',
MassUpdateReleases => 'N',
RetroactivePriceChange => 'N',
OrgAssignChange => 'N',
CommunicatePriceChange => 'N',
p_Background_Flag => 'N', --N:標準API會COMMIT
p_Initiator => NULL,
p_xml_flag => NULL,
FpdsngFlag => 'N',
p_source_type_code => NULL);
--API
PO_REQAPPROVAL_ACTION.APPROVE_DOC(V_ITEM_TYPE,
V_ITEM_KEY,
NULL,
'RUN',
X_RET_MSG); --20120303
END;
IF NVL(V_RETURN_CODE, 'S') <> 'E' THEN
V_RETURN_CODE := 'S';
END IF;
END IF;
FND_FILE.PUT_LINE(FND_FILE.LOG, 'V_RETURN_CODE=' || V_RETURN_CODE);
FND_FILE.PUT_LINE(FND_FILE.LOG, 'V_RETURN_MSG=' || V_RETURN_MSG);
X_RET_CODE := V_RETURN_CODE;
X_RET_MSG := V_RETURN_MSG;
END XX_PO_APPROVE_ACTION;
CREATE OR REPLACE PROCEDURE XX_PO_APPROVE_ACTION(I_HEADER_ID IN NUMBER,
X_RET_CODE OUT VARCHAR2, --S : Success / E : Error
X_RET_MSG OUT VARCHAR2 --Error message
)
IS
/**********************************************************************
I_ACTION ==>
*********************************************************************/
V_STATUS VARCHAR2(100); --For check this HEADER_ID Status. (Is 'INCOMPLETE' ?)
V_RETURN_CODE VARCHAR2(1) := 'S'; --Process status code ==> S : Success / E : Error
V_RETURN_MSG VARCHAR2(2000); --Error message
V_ITEM_KEY VARCHAR2(200); --For API
V_ITEM_TYPE VARCHAR2(20);
V_SEGMENT1 PO_HEADERS_ALL.SEGMENT1%TYPE; --For API
V_PREPARER_ID PO_HEADERS_ALL.AGENT_ID%TYPE; --For API
V_DOCUMENT_TYPE_CODE PO_DOCUMENT_TYPES_ALL.DOCUMENT_TYPE_CODE%TYPE; --For API
V_DOCUMENT_SUBTYPE PO_DOCUMENT_TYPES_ALL.DOCUMENT_SUBTYPE%TYPE; --For API
BEGIN
--Check PO HEADER_ID is exists ?
BEGIN
SELECT AUTHORIZATION_STATUS
INTO V_STATUS
FROM PO_HEADERS_ALL A
WHERE A.PO_HEADER_ID = I_HEADER_ID;
EXCEPTION
WHEN NO_DATA_FOUND THEN
V_STATUS := NULL;
V_RETURN_MSG := 'No data found : PO_HEADER_ID ==> '||I_HEADER_ID;
V_RETURN_CODE := 'E';
END;
IF V_RETURN_CODE = 'S' THEN
BEGIN
--Find API parameters
SELECT pha.org_id,
pha.agent_id,
pha.segment1,
pha.wf_item_type,
pha.wf_item_key,
pdt.document_subtype,
pdt.document_type_code
INTO V_ORG_ID,
V_PREPARER_ID,
V_SEGMENT1,
v_ITEM_TYPE,
V_ITEM_KEY,
V_DOCUMENT_SUBTYPE,
V_DOCUMENT_TYPE_CODE
FROM apps.po_headers_all pha, apps.po_document_types_all pdt
WHERE pha.type_lookup_code = pdt.document_subtype
AND pha.org_id = pdt.org_id
AND pdt.document_type_code = 'PO'
AND pha.PO_HEADER_ID = I_HEADER_ID;
EXCEPTION
WHEN OTHERS THEN
V_RETURN_MSG := 'No data found : po_document_types_all - ' || sqlerrm;
V_RETURN_CODE := 'E';
END;
END IF;
IF V_RETURN_CODE = 'S' THEN
mo_global.init('PO');
mo_global.set_policy_context('S', V_ORG_ID);
SELECT I_HEADER_ID /*P_EP_PO_HEADER_ID*/
|| '-' || TO_CHAR(PO_WF_ITEMKEY_S.NEXTVAL)
INTO V_ITEM_KEY
FROM DUAL;
--ORACLE API
BEGIN
--Restart WorkFlow
PO_REQAPPROVAL_INIT1.START_WF_PROCESS(ItemType => V_ITEM_TYPE, --'POAPPRV',
ItemKey => V_ITEM_KEY,
WorkflowProcess => 'POAPPRV_TOP',
ActionOriginatedFrom => 'PO_FORM',
DocumentID => I_HEADER_ID,
DocumentNumber => V_SEGMENT1, -- Purchase Order Number
PreparerID => V_PREPARER_ID, -- Buyer/Preparer_id
DocumentTypeCode => V_DOCUMENT_TYPE_CODE,
DocumentSubtype => V_DOCUMENT_SUBTYPE,
SubmitterAction => 'APPROVE',
forwardToID => NULL,
forwardFromID => NULL,
DefaultApprovalPathID => NULL,
Note => NULL,
PrintFlag => 'N',
FaxFlag => 'N',
FaxNumber => NULL,
EmailFlag => 'N',
EmailAddress => NULL,
CreateSourcingRule => 'N',
ReleaseGenMethod => 'N',
UpdateSourcingRule => 'N',
MassUpdateReleases => 'N',
RetroactivePriceChange => 'N',
OrgAssignChange => 'N',
CommunicatePriceChange => 'N',
p_Background_Flag => 'N', --N:標準API會COMMIT
p_Initiator => NULL,
p_xml_flag => NULL,
FpdsngFlag => 'N',
p_source_type_code => NULL);
--API
PO_REQAPPROVAL_ACTION.APPROVE_DOC(V_ITEM_TYPE,
V_ITEM_KEY,
NULL,
'RUN',
X_RET_MSG); --20120303
END;
IF NVL(V_RETURN_CODE, 'S') <> 'E' THEN
V_RETURN_CODE := 'S';
END IF;
END IF;
FND_FILE.PUT_LINE(FND_FILE.LOG, 'V_RETURN_CODE=' || V_RETURN_CODE);
FND_FILE.PUT_LINE(FND_FILE.LOG, 'V_RETURN_MSG=' || V_RETURN_MSG);
X_RET_CODE := V_RETURN_CODE;
X_RET_MSG := V_RETURN_MSG;
END XX_PO_APPROVE_ACTION;
2012年12月24日 星期一
Oracle DBA - Query locked database objects
SELECT a.username, a.sid, a.objname1,objname2, SYSDATE current_time, TYPE lock_type, LMODE,
A.LOGON_TIME
FROM (SELECT sn.sql_address,
sn.sql_hash_value,
sn.username,
m.sid,
DECODE(m.type,
'TM','TM-DML enqueue',
'TX','TX-Transaction enqueue',
'UL','User supplied') type,
DECODE(m.lmode,
0,'None',
1,'Null(NULL)',
2,'Row Share(SS)',
3,'Row Excl.(SX)',
4,'Share(S)',
5,'S/Row Excl.(SSX)',
6,'Exclusive(X)',
lmode,ltrim(to_char(lmode, '990'))) lmode,
DECODE(m.request,
0,'None',
1,'Null(NULL)',
2,'Row Share(SS)',
3,'Row Excl.(SX)',
4,'Share(S)',
5,'S/Row Excl.(SSX)',
6,'Exclusive(X)',
request,ltrim(to_char(request, '990'))) request,
obj1.owner || '.' || obj1.object_name objname1,
obj2.owner || '.' || obj2.object_name objname2,
SN.LOGON_TIME
FROM v$session sn, V$lock m, dba_objects obj1, dba_objects obj2
WHERE sn.sid = m.sid
AND m.id1 = obj1.object_id(+)
AND m.id2 = obj2.object_id(+)
AND m.lmode != 4) a
WHERE username is not null
and a.objname1 <> '.'
ORDER BY 3, 1;
2012年10月7日 星期日
Oracle ERP R12. - Change Logo的步驟
若要將Web左上方的Oracle變為貴司自己的Logo做法如下 :
Step 1. 先將公司的Logo檔(.gif)上傳至 ????/apps/apps_st/comn/java/classes/oracle/apps/media
Step 2. 設定Corporate Branding Image for Oracle Applications 該Profile,輸入logo檔名(不用輸入附檔名)
Step 3. Refresh Web頁面即可
Step 1. 先將公司的Logo檔(.gif)上傳至 ????/apps/apps_st/comn/java/classes/oracle/apps/media
Step 2. 設定Corporate Branding Image for Oracle Applications 該Profile,輸入logo檔名(不用輸入附檔名)
Step 3. Refresh Web頁面即可
2012年9月2日 星期日
Oracle ERP R12. 密碼複雜度檢查機制開啟-Password complexity checks
一般公司為配合資安政策會要求User自行設定的密碼必需有一定程度的複雜性.
以下是Oracle ERP 啟用複雜性檢查的Profile
Profile : Signon Password Hard To Guess 設定為 Yes
其複雜性檢查邏輯如下 :
1. The password contains at least one letter and at least one number.
2. The password does not contain the username.
3. The password does not contain repeating characters
以下是Oracle ERP 啟用複雜性檢查的Profile
Profile : Signon Password Hard To Guess 設定為 Yes
其複雜性檢查邏輯如下 :
1. The password contains at least one letter and at least one number.
2. The password does not contain the username.
3. The password does not contain repeating characters
2012年8月12日 星期日
Oracle ERP R12. - Resubmitting WIP_MOVE_TXN_INTERFACE
Resubmitting Failed Move Transactions
若WIP_MOVE_TXN_INTERFACE執行失敗後,經修正完錯誤原因後,要重新執行的Update 語法如下 :
UPDATE WIP_MOVE_TXN_INTERFACE A
SET A.GROUP_ID = NULL,
A.TRANSACTION_ID = NULL,
A.PROCESS_STATUS = 1
WHERE A.TRANSACTION_ID = <要重新執行的那些資料>
參考文件 : Oracle - Resolving Period Close Pending Transaction
若WIP_MOVE_TXN_INTERFACE執行失敗後,經修正完錯誤原因後,要重新執行的Update 語法如下 :
UPDATE WIP_MOVE_TXN_INTERFACE A
SET A.GROUP_ID = NULL,
A.TRANSACTION_ID = NULL,
A.PROCESS_STATUS = 1
WHERE A.TRANSACTION_ID = <要重新執行的那些資料>
參考文件 : Oracle - Resolving Period Close Pending Transaction
Oracle ERP R12. - Resubmitting Pending Material Transactions
若有些交易卡在MTL_TRANSACTION_INTERFACE,並在修正完錯誤資料欄位,想透過Update interface的方式來重新執行,其Update 語法如下 :
UPDATE MTL_TRANSACTIONS_INTERFACE A
SET A.PROCESS_FLAG = 1,
A.LOCK_FLAG = 2,
A.TRANSACTION_MODE = 3,
A.ERROR_CODE = NULL
WHERE A.PROCESS_FLAG = 3 --ERROR
Ps. 但一般仍建議由Oracle Standard 的Transaction Interface功能(INVTVPTX)來Resubmit
參考文件 : Oracle - Resolving Period Close Pending Transaction
UPDATE MTL_TRANSACTIONS_INTERFACE A
SET A.PROCESS_FLAG = 1,
A.LOCK_FLAG = 2,
A.TRANSACTION_MODE = 3,
A.ERROR_CODE = NULL
WHERE A.PROCESS_FLAG = 3 --ERROR
Ps. 但一般仍建議由Oracle Standard 的Transaction Interface功能(INVTVPTX)來Resubmit
參考文件 : Oracle - Resolving Period Close Pending Transaction
Oracle ERP R12. - Resubmitting WIP_COST_TXN_INTERFACE
Resubmitting Failed or Pending Resource Transactions
若工單過站charge resource交易的成本收集失敗,其交易會卡在WIP_COST_TXN_INTERFACE,並會造成無法關結期間.
重新執行的Update語法如下:
UPDATE WIP_COST_TXN_INTERFACE A
SET A.GROUP_ID = NULL,
A.TRANSACTION_ID = NULL,
A.REQUEST_ID = NULL,
A.PROCESS_STATUS = 1
WHERE A.PROCESS_STATUS = 3 --Error
參考文件 : Oracle - Resolving Period Close Pending Transaction
若工單過站charge resource交易的成本收集失敗,其交易會卡在WIP_COST_TXN_INTERFACE,並會造成無法關結期間.
重新執行的Update語法如下:
UPDATE WIP_COST_TXN_INTERFACE A
SET A.GROUP_ID = NULL,
A.TRANSACTION_ID = NULL,
A.REQUEST_ID = NULL,
A.PROCESS_STATUS = 1
WHERE A.PROCESS_STATUS = 3 --Error
參考文件 : Oracle - Resolving Period Close Pending Transaction
Oracle ERP R12. - Resubmitting MTL_MATERIAL_TRANSACTIONS's Uncosted transactions
Resubmitting Uncosted Transactions
若MTL_MATERIAL_TRANSACTIONS有些交易執行Cost Manager失敗,導致該交易的成本未收集到,並影响關帳,其重新執行的Update 語法如下:
UPDATE MTL_MATERIAL_TRANSACTIONS A
SET A.COSTED_FLAG = 'N',
A.TRANSACTION_GROUP_ID = NULL
WHERE A.COSTED_FLAG IS NOT NULL
參考文件 : Oracle - Resolving Period Close Pending Transaction
若MTL_MATERIAL_TRANSACTIONS有些交易執行Cost Manager失敗,導致該交易的成本未收集到,並影响關帳,其重新執行的Update 語法如下:
UPDATE MTL_MATERIAL_TRANSACTIONS A
SET A.COSTED_FLAG = 'N',
A.TRANSACTION_GROUP_ID = NULL
WHERE A.COSTED_FLAG IS NOT NULL
參考文件 : Oracle - Resolving Period Close Pending Transaction
Oracle ERP R12 - Resubmitting MTL_MATERIAL_TRANSACTIONS_TEMP
Resubmitting Unporcessed Material Transactions :
Unporcessed Material Transactions指MTL_MATERIAL_TRANSACTIONS_TEMP內有未處理完成或失敗的交易.其重新執行的Update 語法如下 :
UPDATE MTL_MATERIAL_TRANSACTIONS_TEMP A
SET A.PROCESS_FLAG = 'Y',
A.LOCK_FLAG = 'N',
A.TRANSACTION_MODE = 3,
A.ERROR_CODE = NULL
WHERE A.TRANSACTION_HEADER_ID = <要重新執行的TRANSACTION_HEADER_ID>
參考文件 : Oracle - Resolving Period Close Pending Transaction
Unporcessed Material Transactions指MTL_MATERIAL_TRANSACTIONS_TEMP內有未處理完成或失敗的交易.其重新執行的Update 語法如下 :
UPDATE MTL_MATERIAL_TRANSACTIONS_TEMP A
SET A.PROCESS_FLAG = 'Y',
A.LOCK_FLAG = 'N',
A.TRANSACTION_MODE = 3,
A.ERROR_CODE = NULL
WHERE A.TRANSACTION_HEADER_ID = <要重新執行的TRANSACTION_HEADER_ID>
參考文件 : Oracle - Resolving Period Close Pending Transaction
2012年8月2日 星期四
Oracle DBA - Use DBMS_PROFILER performance tuning
DBMS_PROFILER該工具包主要用來追蹤PL/SQL執行過程中所使用的時間及SQL語句,以供DBA人員分析該PL/SQL裡TOP 10的SQL為何,DBA就可進一步針對該SQL進行SQL Tuning。
<前置作業>
Step 1. 請先檢查該Package是否已存在:
SELECT *
FROM DBA_OBJECTS A
WHERE A.OBJECT_NAME = 'DBMS_PROFILER';
若沒有資料,則表示該Package未建立,故請透過以下步驟來建立所需的Package及Table。
(該Package好像是Oracle 8i開始提供的)
Step 1.1. 請使用DBA權限登入 (例 : sqlplus / as sysdba)
Step 1.2. SQL>@?/rdbms/admin/profload.sql (profload.sql將會建立該Package並Grant權限)
Step 1.3. SQL>@?/rdbms/admin/proftab.sql
(proftab.sql將會建立PLSQL_PROFILER_DATA / PLSQL_PROFILER_UNITS / PLSQL_PROFILER_RUNS)
Step 2. 由Metalink下戴243755.1下戴Script ==> profiler.sql
Script to produce HTML report with top consumers out of PL/SQL Profiler DBMS_PROFILER data [ID 243755.1]
<PL/SQL 執行數據的收集>
Step 1. 執行DBMS_PROFILER.START_PROFILER來啟動收集程序 。
Step 2. 執行所需監控的PL/SQL。
Step 3. 執行DBMS_PROFILER.STOP_PROFILER來停止收集程序。
Step 4. 執行profiler.sql 進行HTML文件的產生
例 :
begin
DBMS_PROFILER.START_PROFILER('你自己的說明'); --啟動收集程序
--
MY_PKG.P_TEST(); --所需監控的PL/SQL
--
DBMS_PROFILER.STOP_PROFILER(); --停止收集程序
end;
SQL>@profiler.sql
其產出的HTML文件就會列出其TOP 10的SQL
<前置作業>
Step 1. 請先檢查該Package是否已存在:
SELECT *
FROM DBA_OBJECTS A
WHERE A.OBJECT_NAME = 'DBMS_PROFILER';
若沒有資料,則表示該Package未建立,故請透過以下步驟來建立所需的Package及Table。
(該Package好像是Oracle 8i開始提供的)
Step 1.1. 請使用DBA權限登入 (例 : sqlplus / as sysdba)
Step 1.2. SQL>@?/rdbms/admin/profload.sql (profload.sql將會建立該Package並Grant權限)
Step 1.3. SQL>@?/rdbms/admin/proftab.sql
(proftab.sql將會建立PLSQL_PROFILER_DATA / PLSQL_PROFILER_UNITS / PLSQL_PROFILER_RUNS)
Step 2. 由Metalink下戴243755.1下戴Script ==> profiler.sql
Script to produce HTML report with top consumers out of PL/SQL Profiler DBMS_PROFILER data [ID 243755.1]
<PL/SQL 執行數據的收集>
Step 1. 執行DBMS_PROFILER.START_PROFILER來啟動收集程序 。
Step 2. 執行所需監控的PL/SQL。
Step 3. 執行DBMS_PROFILER.STOP_PROFILER來停止收集程序。
Step 4. 執行profiler.sql 進行HTML文件的產生
例 :
begin
DBMS_PROFILER.START_PROFILER('你自己的說明'); --啟動收集程序
--
MY_PKG.P_TEST(); --所需監控的PL/SQL
--
DBMS_PROFILER.STOP_PROFILER(); --停止收集程序
end;
SQL>@profiler.sql
其產出的HTML文件就會列出其TOP 10的SQL
Oracle DBA - Performance tuning 參考文件
Master Note: Database Performance Overview [ID 402983.1]
這份文件內容如下 : 詳細資料請自行登入metalink後搜尋402983.1該文獻即可
這份文件內容如下 : 詳細資料請自行登入metalink後搜尋402983.1該文獻即可
Purpose |
Questions and Answers |
* Troubleshooting Guides |
* Common Problem Topics |
Slow Database Performance |
Concurrency Issues |
Database Hangs/Spins |
Session Hangs/Spins |
Locking Issues |
Deadlock |
Upgrade Planning |
Debugging Waits for Various Events |
Library Cache/Mutex Contention/Cursor Type Events: |
Other Types: |
Common Causes of Performance issues |
Cursor Sharing/High Version Counts for Cursors |
High CPU usage |
Issues With waits for 'log file sync' |
WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! |
Buffer Busy/Cache Buffers Chains Latch waits |
SYSAUX Issues |
Performance Diagnostics References |
General Diagnostics Overview |
AWR/Statspack |
10046 Trace |
Systemstates/Hanganalyze |
Errorstacks for Performance Issues |
PStack |
PL/SQL Profiler |
OS Watcher |
LTOM |
Trace/Result Interpretation |
Performance (and other) Webcasts |
Performance and Scalability White Papers and Documentation |
Interacting With Performance Support |
Community: Database Tuning |
References |
2012年7月31日 星期二
Oracle ERP R12. - 如何停止PO Output for Communication
很多公司會客制自動更新PO內容的程式,其更新後再呼叫API進行Apporval,而系統的標準行為則會自動呼叫[PO Output for Communication],其將造成系統資源的浪費。
Oracle TAR : 387853.1 的回覆如下 :
It is not possible to stop the 'PO Output for Communication' program from launching automatically based on how the PO Approval process triggered (whether it is submitted from Approval form or Change API).
Development in Bug # 4632841 already mentioned that:
'Approval is common code line regardless whether it is submitted from Approval form or Change API.
Hence during approval this concurrent request is submitted always. This is more essential if the supplier needs to be communicated.
It is less likely that development will work on this requirement as an enhancement, as it is a standard practice to communicate the PO creation & changes to supplier based on the communication method setting in the supplier and supplier site definition form.
WF is very flexible and can be easily customizable' to achieve this kind of 'deviations from the standard practice' or special requirements.
If po output format is set to 'PDF' irrespective of the communication set.
PO approval launches request to generate pdf document. This is done every time so that PO PDF document can be viewed using view documents special menu option. This doesn't depend on the communication method set at the vendor level and it can't be disabled unless PO output format in purchasing options is changed to text (Which have effect on entire operating unit and not a great workaround)
or approval workflow need to be customized.
Behavior is as per the design.
However EDI concurrent program still communicates the document based on EDI setup at the supplier when it is run.
A possible workaround that can be considered if it meets the Business Requirements is below:
Purchasing Super User - Navigate to Purchasing Options form
(Setup / Organizations / Purchasing Options)
Choose to use Text instead of PDF for the PO Output field. Then PO Output for Communication is not launched via PO Approval
其主要籍由設定Purchasing Options的Output Format為Text,造成與[PO Output for Communication ]的報表格式不一致,進而無法自動執行該程式。
Oracle TAR : 387853.1 的回覆如下 :
It is not possible to stop the 'PO Output for Communication' program from launching automatically based on how the PO Approval process triggered (whether it is submitted from Approval form or Change API).
Development in Bug # 4632841 already mentioned that:
'Approval is common code line regardless whether it is submitted from Approval form or Change API.
Hence during approval this concurrent request is submitted always. This is more essential if the supplier needs to be communicated.
It is less likely that development will work on this requirement as an enhancement, as it is a standard practice to communicate the PO creation & changes to supplier based on the communication method setting in the supplier and supplier site definition form.
WF is very flexible and can be easily customizable' to achieve this kind of 'deviations from the standard practice' or special requirements.
If po output format is set to 'PDF' irrespective of the communication set.
PO approval launches request to generate pdf document. This is done every time so that PO PDF document can be viewed using view documents special menu option. This doesn't depend on the communication method set at the vendor level and it can't be disabled unless PO output format in purchasing options is changed to text (Which have effect on entire operating unit and not a great workaround)
or approval workflow need to be customized.
Behavior is as per the design.
However EDI concurrent program still communicates the document based on EDI setup at the supplier when it is run.
A possible workaround that can be considered if it meets the Business Requirements is below:
Purchasing Super User - Navigate to Purchasing Options form
(Setup / Organizations / Purchasing Options)
Choose to use Text instead of PDF for the PO Output field. Then PO Output for Communication is not launched via PO Approval
其主要籍由設定Purchasing Options的Output Format為Text,造成與[PO Output for Communication ]的報表格式不一致,進而無法自動執行該程式。
2012年7月12日 星期四
Oracle ERP R12. 人員帳號停用Vs. PR Interface 注意事項
以下為本人Import PR時發現的錯誤,經分析其又關聯到人員資料及品號主檔。
狀況如下:
假設品號主檔內有設定Default的Buyer,其若該Buyer的狀態已失效(可能是是帳號停用或是Buyer角色失效)。
若PO_REQUISITIONS_INTERFACE_ALL沒有特別指定目前尚生效中的Buyer,則PR Interface會主動將MTL_SYSTEM_ITEMS_B.BUYER_ID的值帶入PO_REQUISITIONS_INTERFACE_ALL.SUGGESTED_BUYER_ID,這將造成Import PR失敗。
其錯誤訊息為:
The suggested buyer is not a valid buyer or worker
Cause: You entered an invalid buyer.
Action: Enter a valid buyer.
Solution :
Step 1. Update PO_REQUISITIONS_INTERFACE_ALL
SUGGESTED_BUYER_ID = 將其修正為目前尚生效的Buyer id
TRANSACTION_ID = NULL
PROCESS_FLAG = 1
REQUISITION_LINE_ID = NULL
REQ_DISTRIBUTION_ID = NULL
PROCESS_FLAG = 1
TRANSACTION_TYPE = UPDATE
Step 2. 執行Requisition Import ==> 重新Import
為避免類似狀況再發生,則建議以下動作亦需執行:
1. 品號主檔該失效的Buyer Id品號,皆需更新為生效中的Buyer Id,方法如下:
Step 1.
INSERT INTO MTL_SYSTEM_ITEMS_INTERFACE(ORGANIZATION_ID,
INVENTORY_ITEM_ID,
BUYER_ID,
PROCESS_FLAG,
TRANSACTION_TYPE)
SELECT MSI.ORGANIZATION_ID,
MSI.INVENTORY_ITEM_ID,
<新Buyer ID>,
1,
'UPDATE'
FROM MTL_SYSTEM_ITEMS_B MSI
WHERE MSI.ORGANIZATION_ID = <所屬Organization ID>
AND MSI.BUYER_ID = <舊Buyer ID>
Step 2. Import Item (Update only)
2. 修正公司的人員異動/離職手續內容,資訊人員除了關閉帳號外,亦需執行上述步驟。
2012年7月11日 星期三
Oracle ERP R12. SQL For 查詢SOB/LE/ORG/ORGANIZATION
有鑑於客製程式常需要取得SOB/LE/ORG_ID(OU Level)/Organization_id(Inventory Level)等資料.
為了方便及減少重覆撰寫相同SQL的狀況,故本人會將以下SQL建立為View,供其它開發人員直接調用.
SELECT /*
FOR TRACE OU ORG ID VS. INV ORGANIZATION ID
與ORG_ORGANIZATION_DEFINITIONS雷同,但資料更為完整
*/
C.LEGAL_ENTITY LE_ID,
C.OPERATING_UNIT ORG_ID,
HOU.NAME ORG_NAME,
A.ORGANIZATION_ID ORGANIZATION_ID,
B.ORGANIZATION_CODE,
D.LANGUAGE,
D.NAME SOB_NAME,
D.SHORT_NAME SOB_SNAME,
D.CHART_OF_ACCOUNTS_ID,
D.CURRENCY_CODE,
D.PERIOD_SET_NAME,
D.CHART_OF_ACCOUNTS_NAME,
D.SET_OF_BOOKS_ID,
B.MASTER_ORGANIZATION_ID,
E.NAME ORGANIZATION_NAME,
F.ADDRESS_LINE_1,
F.ADDRESS_LINE_2,
F.ADDRESS_LINE_3,
F.COUNTRY,
F.TELEPHONE_NUMBER_1,
F.TELEPHONE_NUMBER_2,
F.TELEPHONE_NUMBER_3,
D.DESCRIPTION SOB_DESCRIPTION
FROM HR_ORGANIZATION_INFORMATION A
JOIN MTL_PARAMETERS B
ON A.ORGANIZATION_ID = B.ORGANIZATION_ID
JOIN INV_ORGANIZATION_INFO_V C
ON A.ORGANIZATION_ID = C.ORGANIZATION_ID
JOIN (SELECT SOB.SET_OF_BOOKS_ID,
SOB.CURRENCY_CODE,
SOB.CHART_OF_ACCOUNTS_ID,
FIFS.ID_FLEX_STRUCTURE_NAME CHART_OF_ACCOUNTS_NAME,
FIFS.LANGUAGE,
SOB.NAME NAME,
SOB.PERIOD_SET_NAME,
SOB.ACCOUNTED_PERIOD_TYPE,
SOB.SHORT_NAME,
SOB.LATEST_OPENED_PERIOD_NAME,
SOB.DESCRIPTION
FROM FND_ID_FLEX_STRUCTURES_TL FIFS,
GL_SETS_OF_BOOKS SOB
WHERE FIFS.ID_FLEX_NUM = SOB.CHART_OF_ACCOUNTS_ID
AND FIFS.APPLICATION_ID = 101
AND FIFS.ID_FLEX_CODE = 'GL#') D
ON C.SET_OF_BOOKS_ID = D.SET_OF_BOOKS_ID
JOIN HR_ORGANIZATION_UNITS E
ON E.ORGANIZATION_ID = A.ORGANIZATION_ID
JOIN HR_OPERATING_UNITS HOU
ON HOU.ORGANIZATION_ID = C.OPERATING_UNIT
LEFT JOIN HR_LOCATIONS F
ON E.LOCATION_ID = F.LOCATION_ID
where A.ORG_INFORMATION_CONTEXT = 'Accounting Information';
為了方便及減少重覆撰寫相同SQL的狀況,故本人會將以下SQL建立為View,供其它開發人員直接調用.
SELECT /*
FOR TRACE OU ORG ID VS. INV ORGANIZATION ID
與ORG_ORGANIZATION_DEFINITIONS雷同,但資料更為完整
*/
C.LEGAL_ENTITY LE_ID,
C.OPERATING_UNIT ORG_ID,
HOU.NAME ORG_NAME,
A.ORGANIZATION_ID ORGANIZATION_ID,
B.ORGANIZATION_CODE,
D.LANGUAGE,
D.NAME SOB_NAME,
D.SHORT_NAME SOB_SNAME,
D.CHART_OF_ACCOUNTS_ID,
D.CURRENCY_CODE,
D.PERIOD_SET_NAME,
D.CHART_OF_ACCOUNTS_NAME,
D.SET_OF_BOOKS_ID,
B.MASTER_ORGANIZATION_ID,
E.NAME ORGANIZATION_NAME,
F.ADDRESS_LINE_1,
F.ADDRESS_LINE_2,
F.ADDRESS_LINE_3,
F.COUNTRY,
F.TELEPHONE_NUMBER_1,
F.TELEPHONE_NUMBER_2,
F.TELEPHONE_NUMBER_3,
D.DESCRIPTION SOB_DESCRIPTION
FROM HR_ORGANIZATION_INFORMATION A
JOIN MTL_PARAMETERS B
ON A.ORGANIZATION_ID = B.ORGANIZATION_ID
JOIN INV_ORGANIZATION_INFO_V C
ON A.ORGANIZATION_ID = C.ORGANIZATION_ID
JOIN (SELECT SOB.SET_OF_BOOKS_ID,
SOB.CURRENCY_CODE,
SOB.CHART_OF_ACCOUNTS_ID,
FIFS.ID_FLEX_STRUCTURE_NAME CHART_OF_ACCOUNTS_NAME,
FIFS.LANGUAGE,
SOB.NAME NAME,
SOB.PERIOD_SET_NAME,
SOB.ACCOUNTED_PERIOD_TYPE,
SOB.SHORT_NAME,
SOB.LATEST_OPENED_PERIOD_NAME,
SOB.DESCRIPTION
FROM FND_ID_FLEX_STRUCTURES_TL FIFS,
GL_SETS_OF_BOOKS SOB
WHERE FIFS.ID_FLEX_NUM = SOB.CHART_OF_ACCOUNTS_ID
AND FIFS.APPLICATION_ID = 101
AND FIFS.ID_FLEX_CODE = 'GL#') D
ON C.SET_OF_BOOKS_ID = D.SET_OF_BOOKS_ID
JOIN HR_ORGANIZATION_UNITS E
ON E.ORGANIZATION_ID = A.ORGANIZATION_ID
JOIN HR_OPERATING_UNITS HOU
ON HOU.ORGANIZATION_ID = C.OPERATING_UNIT
LEFT JOIN HR_LOCATIONS F
ON E.LOCATION_ID = F.LOCATION_ID
where A.ORG_INFORMATION_CONTEXT = 'Accounting Information';
2012年7月10日 星期二
Oracle ERP R12. FND_PROFILE.VALUE('GL_SET_OF_BKS_ID')取值順序
Oracle ERP 的Profile分為以下層級:
Site : 整個DB Level
Application : By模組
Responsibility : By Responsibility
User : By User獨立設定
但是並不是每個Profile都會有4個Level,這要看該Profile設定最低到那一階才會有作用.
例如 : 帳本,就不會By User設定,一般是By Responsibility才合理
一般程式開發人員認知的取值順序為
User ==> Responsibility ==> Application ==> Site
但需注意的是,若你是呼叫FND_PROFILE.VALUE('GL_SET_OF_BKS_ID')取得Set Of Book ID的話,
其取值順序不是User ==> Responsibility ==> Application ==> Site,而是Site ==> Application ==> Responsibility.
故若你有自行客制的程式必需要取得Responsibility的SOB_ID的話,則遇到Multi-Org (多SOB_ID)時,可能用FND_PROFILE.VALUE('GL_SET_OF_BKS_ID'),就會取到錯的值.
建議改用以下SQL取得:
Site : 整個DB Level
Application : By模組
Responsibility : By Responsibility
User : By User獨立設定
但是並不是每個Profile都會有4個Level,這要看該Profile設定最低到那一階才會有作用.
例如 : 帳本,就不會By User設定,一般是By Responsibility才合理
一般程式開發人員認知的取值順序為
User ==> Responsibility ==> Application ==> Site
但需注意的是,若你是呼叫FND_PROFILE.VALUE('GL_SET_OF_BKS_ID')取得Set Of Book ID的話,
其取值順序不是User ==> Responsibility ==> Application ==> Site,而是Site ==> Application ==> Responsibility.
故若你有自行客制的程式必需要取得Responsibility的SOB_ID的話,則遇到Multi-Org (多SOB_ID)時,可能用FND_PROFILE.VALUE('GL_SET_OF_BKS_ID'),就會取到錯的值.
建議改用以下SQL取得:
SELECT TO_NUMBER(O2.ORG_INFORMATION3)
FROM HR_ORGANIZATION_INFORMATION O1,
HR_ORGANIZATION_INFORMATION O2,
GL_LEDGERS_PUBLIC_V GL
WHERE O1.ORGANIZATION_ID = O2.ORGANIZATION_ID
AND O1.ORGANIZATION_ID = :ORG_ID --在此輸入OU Level的Org ID
AND O1.ORG_INFORMATION_CONTEXT = 'CLASS'
AND O2.ORG_INFORMATION_CONTEXT = 'Operating Unit Information'
AND O1.ORG_INFORMATION1 = 'OPERATING_UNIT'
AND O1.ORG_INFORMATION2 = 'Y'
AND O2.ORG_INFORMATION3 = GL.LEDGER_ID;
2012年6月15日 星期五
Oracle ERP R12. Personalization menu icon上傳路徑
Format of icon(圖檔格式): gif
Specific Dimensions(格式): 18×18 pixels (based on the size of existing icons)
Where to put file(上傳路徑): $OA_JAVA/oracle/apps/media
Specific Dimensions(格式): 18×18 pixels (based on the size of existing icons)
Where to put file(上傳路徑): $OA_JAVA/oracle/apps/media
例 :
/erpap/????/apps/apps_st/comn/java/classes/oracle/apps/media
/erpap/????/apps/apps_st/comn/java/classes/oracle/apps/media
2012年3月22日 星期四
Oracle ERP R12. 跨國分公司時區profile設定
假設有一海外分公司時區與目前Server所在的時區不一致,就會導致user在操作erp時的時間會與當地時間有誤差,必需要人工再去調整。
例如:
若母公司(Server所在地)的時區為+0,而子公司的時區為+2 ,其子公司人員在做庫存交易時,系統在畫面上預設帶出來的時間就會跟子公司當地的時間有2小時的落差。
這時可透過"Concurrent:Multiple Time Zones"該profile來改善該狀況。
設定如下:
1. Concurrent:Multiple Time Zones設為Yes
2. By User Level設定成Client Time zone即可
Ps :
其只是單純的將預設之當下時間帶出符合當地時間而已,而資料庫內的Creation_Date仍會是Server的時區時間。
例如:
若母公司(Server所在地)的時區為+0,而子公司的時區為+2 ,其子公司人員在做庫存交易時,系統在畫面上預設帶出來的時間就會跟子公司當地的時間有2小時的落差。
這時可透過"Concurrent:Multiple Time Zones"該profile來改善該狀況。
設定如下:
1. Concurrent:Multiple Time Zones設為Yes
2. By User Level設定成Client Time zone即可
Ps :
其只是單純的將預設之當下時間帶出符合當地時間而已,而資料庫內的Creation_Date仍會是Server的時區時間。
2012年3月19日 星期一
Oracle ERP R12. 委外託工收料轉WIP_MOVE_TRANSACTION行為分析
因最近常接到User反應,有些託工工單在PO收料後並不會自動執行WIP MOVE TRANSACTION,還需有人工執行。經分析是Resource 的AUTOCHARGE_TYPE設定錯誤造成的。
以下是該wip_operation_resources.autocharge_type說明:
1 : WIP Move: Work in Process automatically charges this type of resource to a job or repetitive schedule when you complete an operation.
2 : Manual: Work in Process does not automatically charge this type of resource to a job or repetitive schedule. You must manually charge it to a job or repetitive schedule using Work in Process.
3 : PO Receipt: Automatically charge this resource upon receipt of a purchase order in Oracle Purchasing. The assemblies are not automatically moved to the next operation upon receipt, so you must manually move them using Work in Process.
4 : PO Move: Automatically charge this resource upon receipt of a purchase order in Oracle Purchasing and move the assemblies to the Queue intraoperation step of the next operation, or to the To move intraoperation step if this is the last operation. <=== 所以若要在收料後能自動轉move transaction就要改為PO Move
以下是該wip_operation_resources.autocharge_type說明:
1 : WIP Move: Work in Process automatically charges this type of resource to a job or repetitive schedule when you complete an operation.
2 : Manual: Work in Process does not automatically charge this type of resource to a job or repetitive schedule. You must manually charge it to a job or repetitive schedule using Work in Process.
3 : PO Receipt: Automatically charge this resource upon receipt of a purchase order in Oracle Purchasing. The assemblies are not automatically moved to the next operation upon receipt, so you must manually move them using Work in Process.
4 : PO Move: Automatically charge this resource upon receipt of a purchase order in Oracle Purchasing and move the assemblies to the Queue intraoperation step of the next operation, or to the To move intraoperation step if this is the last operation. <=== 所以若要在收料後能自動轉move transaction就要改為PO Move
2012年3月4日 星期日
訂閱:
文章 (Atom)