DECLARE
l_msg_count NUMBER;
l_msg_data VARCHAR2(2000);
l_return_status VARCHAR2(30);
l_cc_hold_comment VARCHAR2(30);
l_result_out VARCHAR2(30);
i NUMBER;
BEGIN
dbms_output.put_line(' ================ start testing =========== ');
dbms_output.put_line(' .');
l_msg_count := 0;
l_msg_data := NULL;
l_result_out := NULL;
l_cc_hold_comment := NULL;
dbms_output.put_line(' Call OE_EXTERNAL_CREDIT_PUB.Check_External_Credit ');
dbms_output.put_line(' . ');
oe_external_credit_pub.check_external_credit(p_api_version => 1.0,
p_init_msg_list => fnd_api.g_true,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
p_customer_name => 'MGD_100',
p_customer_number => NULL,
p_customer_id => NULL,
p_bill_to_site_use_id => 4656,
p_bill_to_address1 => NULL,
p_bill_to_address2 => NULL,
p_bill_to_address3 => NULL,
p_bill_to_address4 => NULL,
p_bill_to_city => NULL,
p_bill_to_country => NULL,
p_bill_to_postal_code => NULL,
p_bill_to_state => NULL,
p_functional_currency_code => 'USD',
p_transaction_currency_code => 'USD',
p_transaction_amount => 1000,
p_org_id => 204,
p_operating_unit_name => NULL,
p_credit_check_rule_id => 1043,
p_credit_check_rule_name => NULL,
x_result_out => l_result_out,
x_cc_hold_comment => l_cc_hold_comment);
dbms_output.put_line(' . ');
dbms_output.put_line(' Out of API call with l_return_status =>' ||
l_return_status);
dbms_output.put_line(' +++++++++++++++++++++++++++++++++++++++++++ ');
dbms_output.put_line(' .');
dbms_output.put_line('CREDIT CHECK RESULT ==> ' || l_result_out);
dbms_output.put_line(' .');
dbms_output.put_line('Hold Comment ==> ' || l_cc_hold_comment);
dbms_output.put_line(' .');
dbms_output.put_line(' +++++++++++++++++++++++++++++++++++++++++++ ');
dbms_output.put_line(' . ');
dbms_output.put_line(' ------------------------------------ ');
dbms_output.put_line('l_cc_hold_comment: ' || l_cc_hold_comment);
dbms_output.put_line('l_msg_data: ' || substr(l_msg_data, 1, 2000));
dbms_output.put_line('l_msg_count: ' || l_msg_count);
dbms_output.put_line('l_result_out: ' || l_result_out);
dbms_output.put_line('l_return_status: ' || l_return_status);
dbms_output.put_line('-------------------------------------');
dbms_output.put_line(' .');
dbms_output.put_line(' ************ Print messages ************');
FOR i IN 1 .. l_msg_count LOOP
l_msg_data := oe_msg_pub.get(p_msg_index => i, p_encoded => 'F');
oe_debug_pub.add(substr(l_msg_data, 1, 255));
dbms_output.put_line('Error msg: ' || substr(l_msg_data, 1, 2000));
END LOOP;
dbms_output.put_line(' . ');
dbms_output.put_line(' ************ End messages ************');
dbms_output.put_line(' . ');
dbms_output.put_line(' . ');
dbms_output.put_line(' ================ End of testing =========== ');
dbms_output.put_line(' Output file name ==> cc_external_st.lst ');
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;