DECLARE
p_cust_acct_site_rec hz_cust_account_site_v2pub.cust_acct_site_rec_type;
p_cust_account_rec hz_cust_account_v2pub.cust_account_rec_type;
x_return_status VARCHAR2 (2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (2000);
x_party_site_id number;
x_cust_acct_site_id number;
x_account_number VARCHAR2 (100);
l_msg_index_out NUMBER;
l_error_message VARCHAR2 (100);
BEGIN
p_cust_acct_site_rec.cust_account_id :='&cust_account_id';
p_cust_acct_site_rec.created_by_module :='TCA_V2_API';
hz_cust_account_site_v2pub.create_cust_acct_site( p_init_msg_list => 'T',
p_cust_acct_site_rec => p_cust_acct_site_rec,
x_cust_acct_site_id => x_cust_acct_site_id,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
IF x_return_status = fnd_api.g_ret_sts_success THEN
dbms_output.put_line('output information');
dbms_output.put_line('x_cust_acct_site_id:' || x_cust_acct_site_id);
DBMS_OUTPUT.put_line ('x_account_number:' || x_account_number);
DBMS_OUTPUT.put_line ('x_party_site_id:' || x_party_site_id);
IF x_msg_count > 0
THEN
FOR i IN 1 .. x_msg_count
LOOP
apps.fnd_msg_pub.get (p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => x_msg_data,
p_msg_index_out => l_msg_index_out
);
END LOOP;
IF l_error_message IS NULL
THEN
l_error_message := SUBSTR (x_msg_data, 1, 250);
ELSE
l_error_message :=
l_error_message || ' /' || SUBSTR (x_msg_data, 1, 250);
END IF;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error: ' || l_error_message);
DBMS_OUTPUT.put_line ('*****************************************');
END IF;
END IF;
END;
p_cust_acct_site_rec hz_cust_account_site_v2pub.cust_acct_site_rec_type;
p_cust_account_rec hz_cust_account_v2pub.cust_account_rec_type;
x_return_status VARCHAR2 (2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2 (2000);
x_party_site_id number;
x_cust_acct_site_id number;
x_account_number VARCHAR2 (100);
l_msg_index_out NUMBER;
l_error_message VARCHAR2 (100);
BEGIN
p_cust_acct_site_rec.cust_account_id :='&cust_account_id';
p_cust_acct_site_rec.created_by_module :='TCA_V2_API';
hz_cust_account_site_v2pub.create_cust_acct_site( p_init_msg_list => 'T',
p_cust_acct_site_rec => p_cust_acct_site_rec,
x_cust_acct_site_id => x_cust_acct_site_id,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data);
IF x_return_status = fnd_api.g_ret_sts_success THEN
dbms_output.put_line('output information');
dbms_output.put_line('x_cust_acct_site_id:' || x_cust_acct_site_id);
DBMS_OUTPUT.put_line ('x_account_number:' || x_account_number);
DBMS_OUTPUT.put_line ('x_party_site_id:' || x_party_site_id);
IF x_msg_count > 0
THEN
FOR i IN 1 .. x_msg_count
LOOP
apps.fnd_msg_pub.get (p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => x_msg_data,
p_msg_index_out => l_msg_index_out
);
END LOOP;
IF l_error_message IS NULL
THEN
l_error_message := SUBSTR (x_msg_data, 1, 250);
ELSE
l_error_message :=
l_error_message || ' /' || SUBSTR (x_msg_data, 1, 250);
END IF;
DBMS_OUTPUT.put_line ('*****************************************');
DBMS_OUTPUT.put_line ('API Error: ' || l_error_message);
DBMS_OUTPUT.put_line ('*****************************************');
END IF;
END IF;
END;
No comments:
Post a Comment