剛好遇到有很多客戶需要批次建Customer Profile Amount ,下面是個範例,可以參考看看:
DECLARE
P_CUSTOMER_PROFILE_REC HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE;
P_CUST_ACCT_RELATE_REC HZ_CUST_ACCOUNT_V2PUB.CUST_ACCT_RELATE_REC_TYPE;
P_CUST_PROFILE_AMT_REC HZ_CUSTOMER_PROFILE_V2PUB.CUST_PROFILE_AMT_REC_TYPE;
P_PROFILE_CLASS_ID NUMBER;
V_CUST_ACCOUNT_ID NUMBER;
V_ACCOUNT_NUMBER VARCHAR2(20);
V_PARTY_ID NUMBER;
V_PARTY_NUMBER VARCHAR2(20);
V_PROFILE_ID NUMBER;
V_RETURN_STATUS VARCHAR2(1);
V_MSG_COUNT NUMBER;
V_MSG_DATA VARCHAR2(2000);
V_CUST_ACCOUNT_PROFILE_ID NUMBER;
V_CUST_ACCT_PROFILE_AMT_ID NUMBER;
BEGIN
FND_GLOBAL.APPS_INITIALIZE(USER_ID => 3631,
RESP_ID => 50279,
RESP_APPL_ID => 660);
-- CREATE CUSTOMER PROFILE RECORD
P_CUSTOMER_PROFILE_REC.PARTY_ID := 123433;
P_CUSTOMER_PROFILE_REC.CUST_ACCOUNT_ID :=152127;
P_CUSTOMER_PROFILE_REC.SITE_USE_ID := 7459;
P_CUSTOMER_PROFILE_REC.CREATED_BY_MODULE := 'TCA_V2_API';
HZ_CUSTOMER_PROFILE_V2PUB.CREATE_CUSTOMER_PROFILE (
fnd_api.g_true, --'T',
P_CUSTOMER_PROFILE_REC ,
fnd_api.g_true, --'T',
V_CUST_ACCOUNT_PROFILE_ID ,
V_RETURN_STATUS ,
V_MSG_COUNT,
V_MSG_DATA );
-- CREATE CUSTOMER PROFILE AMOUNT RECORD
P_CUST_PROFILE_AMT_REC.CUST_ACCOUNT_PROFILE_ID := V_CUST_ACCOUNT_PROFILE_ID;
P_CUST_PROFILE_AMT_REC.CUST_ACCOUNT_ID := 152127;
P_CUST_PROFILE_AMT_REC.SITE_USE_ID := 7459;
P_CUST_PROFILE_AMT_REC.CURRENCY_CODE := 'TWD';
P_CUST_PROFILE_AMT_REC.TRX_CREDIT_LIMIT := '';
P_CUST_PROFILE_AMT_REC.OVERALL_CREDIT_LIMIT := '';
P_CUST_PROFILE_AMT_REC.CREATED_BY_MODULE := 'TCA_V2_API';
HZ_CUSTOMER_PROFILE_V2PUB.CREATE_CUST_PROFILE_AMT (
fnd_api.g_true, --'T',
fnd_api.g_true, --'T',
P_CUST_PROFILE_AMT_REC ,
V_CUST_ACCT_PROFILE_AMT_ID ,
V_RETURN_STATUS ,
V_MSG_COUNT ,
V_MSG_DATA
);
COMMIT;
END;