6 Replies Latest reply: Oct 8, 2010 12:50 PM by VikramAwotar RSS

    Suppliers -- >  payment method default

    user627525
      HI All,

      I am working on supplier creation in R12 version.
      I have used APIs to create Supplier and supplier site information. I have used standard API (AP_VENDOR_PUB_PKG).
      Client has given 'xyz payments' as payment method. He wants that payment method as default one, when supplier is created.
      Kindly suggest me how can I do it.

      Please help me to sort out this issue.

      Thanks.

      Edited by: user627525 on 22 Apr, 2010 9:46 PM
        • 1. Re: Suppliers -- >  payment method default
          VikramAwotar
          Hello,

          Try to assign your payment method name to the attributes below:

          At Vendor header level:
          - ext_payee_rec.default_pmt_method := <payment_method_code>;
          - vendor_rec.ext_payee_rec.default_pmt_method := <payment_method_code>;

          At Vendor Site Level:
          - site_rec.ext_payee_rec.default_pmt_method := <payment_method_code>;


          HTH,
          Vik
          • 2. Re: Suppliers -- >  payment method default
            user627525
            Dear Vikram,

            Thanks very much for your reply. i have modified the code as per your suggestion, it is working fine. once again thanks a lot.

            Thanks.
            • 3. Re: Suppliers -- >  payment method default
              VikramAwotar
              Most welcome..

              grateful if u set your post as answered.

              Vik
              • 5. Re: Suppliers -- >  payment method default
                635603
                Hi Vikram,

                I am trying to update the default payment method in R12 using the api AP_VENDOR_PUB_PKG.Update_Vendor_Site

                The procedure is completing sucessfully but the updation is not happening in the from end please help

                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);

                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 := 'CHECK';
                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 => '109'

                );

                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;
                Thanks
                • 6. Re: Suppliers -- >  payment method default
                  VikramAwotar
                  Hi Boo!

                  I guess u should have

                  v_vensite_rec_type.ext_payee_rec.default_pmt_method := 'CHECK'

                  instead of

                  ext_payee_rec.default_pmt_method := 'CHECK' in your codes.

                  Hope this solve your issue.

                  Vik