Sunday, 4 November 2012
API to get Customer Credit Exposure Amount in Oracle Apps
DECLARE
V_HOLD_ID NUMBER DEFAULT 50;
L_CUST_TOTAL_EXPOSURE NUMBER;
P_CREDIT_CHECK_RULE_ID NUMBER;
V_MSG_DATA VARCHAR2 (4000);
L_RETURN_STATUS VARCHAR2 (30);
BEGIN
MO_GLOBAL.INIT ('ONT');
FND_GLOBAL.APPS_INITIALIZE (USER_ID => 1110,
RESP_ID => 50678,
RESP_APPL_ID => 7000
);
MO_GLOBAL.SET_POLICY_CONTEXT ('S', 83);
DBMS_OUTPUT.PUT_LINE ('Calling the API to get customr exposure amount');
OE_CREDIT_ENGINE_GRP.GET_CUSTOMER_EXPOSURE
(P_CUSTOMER_ID => 1590, ---- Customer Account ID
P_SITE_ID => NULL, ---- Customer Site ID
P_LIMIT_CURR_CODE => 'INR', ---- Currency Code
P_CREDIT_CHECK_RULE_ID => 1041, ---- Credit_Check_Rule_ID from table OE_CREDIT_CHECK_RULES
X_TOTAL_EXPOSURE => L_CUST_TOTAL_EXPOSURE,
X_RETURN_STATUS => L_RETURN_STATUS
);
IF L_RETURN_STATUS = FND_API.G_RET_STS_SUCCESS
THEN
DBMS_OUTPUT.PUT_LINE ('success:');
DBMS_OUTPUT.PUT_LINE ( 'l_total_exposure_amount - '
|| L_CUST_TOTAL_EXPOSURE
);
COMMIT;
ELSIF L_RETURN_STATUS IS NULL
THEN
DBMS_OUTPUT.PUT_LINE ('Status is null');
ELSE
DBMS_OUTPUT.PUT_LINE ('Failed: ' || V_MSG_DATA);
FOR I IN 1 .. OE_MSG_PUB.COUNT_MSG
LOOP
V_MSG_DATA := OE_MSG_PUB.GET (P_MSG_INDEX => I, P_ENCODED => 'F');
DBMS_OUTPUT.PUT_LINE (I || ') ' || V_MSG_DATA);
END LOOP;
ROLLBACK;
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.PUT_LINE ('Error is ' || SQLCODE || '---' || SQLERRM);
END;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment