DECLARE l_vendor_rec ap_vendor_pub_pkg.r_vendor_rec_type; l_return_status varchar2(10); l_msg_count NUMBER; l_msg_data LONG; l_vendor_id NUMBER; l_party_id NUMBER; l_msg varchar2(200); l_org_name varchar2(50); l_user_name varchar2(50); BEGIN fnd_global.apps_initialize(32978, 50679, 200); mo_global.set_policy_context('S',81 ); select user_name INTO l_user_name from fnd_user where user_id = FND_GLOBAL.user_id; select name INTO l_org_name from HR_ALL_ORGANIZATION_UNITS where organization_id = FND_GLOBAL.org_id; l_vendor_rec.vendor_name := 'CTES_TEST002'; l_vendor_rec.VENDOR_NAME_ALT := 'CTES_TEST002 API'; l_vendor_rec.ENABLED_FLAG := 'N'; l_vendor_rec.VENDOR_TYPE_LOOKUP_CODE := 'VENDOR'; l_vendor_rec.ENABLED_FLAG := 'Y'; l_vendor_rec.INVOICE_CURRENCY_CODE := 'GBP'; l_vendor_rec.PAYMENT_CURRENCY_CODE := 'GBP'; l_vendor_rec.START_DATE_ACTIVE := trunc(sysdate); dbms_output.put_line('User Name:'||l_user_name); dbms_output.put_line('ORG Name:'||l_org_name); /*pos_vendor_pub.Create_Vendor ( p_vendor_rec => l_vendor_rec, x_return_status => l_return_status, x_msg_count => l_msg_count, x_msg_data => l_msg_data, x_vendor_id => l_vendor_id, x_party_id => l_party_id );*/ AP_VENDOR_PUB_PKG.create_vendor ( p_api_version => 1, p_init_msg_list => FND_API.G_TRUE, p_commit => FND_API.G_FALSE, p_validation_level => FND_API.G_VALID_LEVEL_FULL, x_return_status => l_return_status, x_msg_count => l_msg_count, x_msg_data => l_msg_data, p_vendor_rec => l_vendor_rec, x_vendor_id => l_vendor_id, x_party_id => l_party_id ); IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN dbms_output.put_line(l_return_status); dbms_output.put_line(l_msg_count); FOR i IN 1..FND_MSG_PUB.COUNT_MSG LOOP l_msg := FND_MSG_PUB.get( p_msg_index => i, p_encoded => FND_API.G_FALSE ); dbms_output.put_line(i||'. The API call failed with error '||l_msg); END LOOP; ROLLBACK; ELSE dbms_output.put_line('Status : '||l_return_status); dbms_output.put_line('Number of error message : '||l_msg_count); dbms_output.put_line('The API call ended with SUCESSS status'); dbms_output.put_line(l_vendor_id || ' ' || l_vendor_id); dbms_output.put_line(l_return_status || ' '|| l_msg_count || '-' || l_msg_data); dbms_output.put_line(l_vendor_id || ' ' || l_party_id); COMMIT; END IF; EXCEPTION WHEN OTHERS THEN ROLLBACK; DBMS_OUTPUT.PUT_LINE(SQLERRM); END; / SHOW ERROR;