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;
沒有留言:
張貼留言