-----------*********anonymous block for customer account site uses creation ****--------------------
declare
p_cust_site_use_rec hz_cust_account_site_v2pub.cust_site_use_rec_type;
p_customer_profile_rec hz_customer_profile_v2pub.customer_profile_rec_type;
x_site_use_id NUMBER;
x_return_status VARCHAR2 (2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (2000);
begin
p_cust_site_use_rec.cust_acct_site_id :=7697;
--p_cust_site_use_rec.site_use_code := 'SHIP_TO';
p_cust_site_use_rec.site_use_code := 'BILL_TO';
--p_cust_site_use_rec.site_use_code := 'SOLD_TO';
p_cust_site_use_rec.LOCATION := 'TCA';
p_cust_site_use_rec.created_by_module := 'HZ_CPUI';
hz_cust_account_site_v2pub.create_cust_site_use (
'T',
p_cust_site_use_rec ,
p_customer_profile_rec ,
'T',
'T',
x_site_use_id ,
x_return_status ,
x_msg_count ,
x_msg_data );
IF x_return_status ='S'THEN
COMMIT;
DBMS_OUTPUT.PUT_LINE('Creation of Customer account site use is Successful ');
DBMS_OUTPUT.PUT_LINE('Output information ....');
dbms_output.put_line('Cust party site use Id = '||TO_CHAR(x_site_use_id));
dbms_output.put_line('Return Status Of Api = '||x_return_status);
dbms_output.put_line('No of err msgs = '||x_msg_count);
dbms_output.put_line('err information = '||x_msg_data);
ELSE
DBMS_OUTPUT.put_line ('Creation of Customer account site use got failed:'||x_msg_data);
ROLLBACK;
FOR i IN 1 .. x_msg_count
LOOP
x_msg_data := fnd_msg_pub.get( p_msg_index => i, p_encoded => 'F');
dbms_output.put_line( i|| ') '|| x_msg_data);
END LOOP;
END IF;
DBMS_OUTPUT.PUT_LINE('Completion of API');
end;
/
declare
p_cust_site_use_rec hz_cust_account_site_v2pub.cust_site_use_rec_type;
p_customer_profile_rec hz_customer_profile_v2pub.customer_profile_rec_type;
x_site_use_id NUMBER;
x_return_status VARCHAR2 (2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (2000);
begin
p_cust_site_use_rec.cust_acct_site_id :=7697;
--p_cust_site_use_rec.site_use_code := 'SHIP_TO';
p_cust_site_use_rec.site_use_code := 'BILL_TO';
--p_cust_site_use_rec.site_use_code := 'SOLD_TO';
p_cust_site_use_rec.LOCATION := 'TCA';
p_cust_site_use_rec.created_by_module := 'HZ_CPUI';
hz_cust_account_site_v2pub.create_cust_site_use (
'T',
p_cust_site_use_rec ,
p_customer_profile_rec ,
'T',
'T',
x_site_use_id ,
x_return_status ,
x_msg_count ,
x_msg_data );
IF x_return_status ='S'THEN
COMMIT;
DBMS_OUTPUT.PUT_LINE('Creation of Customer account site use is Successful ');
DBMS_OUTPUT.PUT_LINE('Output information ....');
dbms_output.put_line('Cust party site use Id = '||TO_CHAR(x_site_use_id));
dbms_output.put_line('Return Status Of Api = '||x_return_status);
dbms_output.put_line('No of err msgs = '||x_msg_count);
dbms_output.put_line('err information = '||x_msg_data);
ELSE
DBMS_OUTPUT.put_line ('Creation of Customer account site use got failed:'||x_msg_data);
ROLLBACK;
FOR i IN 1 .. x_msg_count
LOOP
x_msg_data := fnd_msg_pub.get( p_msg_index => i, p_encoded => 'F');
dbms_output.put_line( i|| ') '|| x_msg_data);
END LOOP;
END IF;
DBMS_OUTPUT.PUT_LINE('Completion of API');
end;
/
give me author privilege
ReplyDelete