Tuesday, March 31, 2015

API AP_VENDOR_PUB_PKG.Update_Vendor_Site to update the Payment Method at Supplier Site

 am using api AP_VENDOR_PUB_PKG.Update_Vendor_Site to update the Payment Method at Supplier Site level. The below code executes with no error but dont update the payment method. The requirement is to update the payment method to SEPA

Code :

DECLARE

v_error_reason VARCHAR2 (2000) := NULL;
v_msg_data VARCHAR2 (1000) := NULL;
v_msg_count NUMBER := NULL;
v_return_status VARCHAR2 (100) := NULL;
v_vensite_rec_type      AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;
ext_payee_rec           IBY_DISBURSEMENT_SETUP_PUB.EXTERNAL_PAYEE_REC_TYPE;

BEGIN

DBMS_OUTPUT.put_line ('BEFORE apps initialization');

--Fnd_Global.apps_initialize(-1,20639,200);

fnd_global.apps_initialize(730908,141200,401);

--DBMS_OUTPUT.put_line ('AFTER apps initialization'); 

v_error_reason := NULL;
v_return_status := NULL;
v_msg_count := NULL;
v_msg_data := NULL;

--ext_payee_rec.default_pmt_method := 'SEPA';
v_vensite_rec_type.org_id := 2796;
v_vensite_rec_type.vendor_site_code := '0653-01NEUSS';
v_vensite_rec_type.ext_payee_rec.default_pmt_method := 'SEPA';
--v_vensite_rec_type.ext_payee_rec.default_pmt_method:= 'CHECK';

DBMS_OUTPUT.put_line ('BEFORE remittance API');

AP_VENDOR_PUB_PKG.Update_Vendor_Site
( p_api_version => 1.0,
p_init_msg_list => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
p_validation_level => FND_API.G_VALID_LEVEL_FULL,
x_return_status =>v_return_status ,
x_msg_count => v_msg_count,
x_msg_data => v_msg_data,
p_vendor_site_rec =>v_vensite_rec_type,
p_vendor_site_id => '393130'

);

commit;

DBMS_OUTPUT.put_line ('AFTER pymt mtd API');
DBMS_OUTPUT.put_line (v_return_status);
DBMS_OUTPUT.put_line (v_msg_count);
DBMS_OUTPUT.put_line (v_msg_data);

IF v_return_status = fnd_api.g_ret_sts_success THEN
     IF v_msg_count >= 1 THEN
FOR i IN 1 .. v_msg_count
LOOP
IF v_error_reason IS NULL THEN
v_error_reason := SUBSTR (fnd_msg_pub.get (p_encoded => fnd_api.g_false), 1, 255);
ELSE
v_error_reason := v_error_reason|| ' ,'|| SUBSTR (fnd_msg_pub.get (p_encoded => fnd_api.g_false), 1, 255);
END IF;
DBMS_OUTPUT.put_line ('VENDOR_remittance email UPDATE API ERROR-' || v_error_reason);
END LOOP;
END IF;
ROLLBACK;
ELSE

DBMS_OUTPUT.put_line ('The updateion is sucessful');

COMMIT;

END IF;
EXCEPTION
WHEN OTHERS THEN

DBMS_OUTPUT.put_line (SQLERRM || '-' || SQLCODE);
END;

No comments:

Post a Comment

Types of animations

Animation is a diverse and creative field with a variety of styles that artists and filmmakers use to bring their visions to life. Here are ...