API to Create AP Supplier Site


API - pos_vendor_pub_pkg.create_vendor_site

DECLARE
 l_vendor_site_rec      ap_vendor_pub_pkg.r_vendor_site_rec_type;
 lc_return_status         VARCHAR2(10);
 ln_msg_count            NUMBER;
 lc_msg_data               VARCHAR2(1000);
 ln_vendor_site_id     NUMBER;
 ln_party_site_id         NUMBER;
 ln_location_id            NUMBER; 
BEGIN
         -- ---------------
         /* Required*?/
        l_vendor_site_rec.vendor_id               := 111;
        l_vendor_site_rec.vendor_site_code  := 'Site Name';
        l_vendor_site_rec.address_line1         := ' Main Street';
        l_vendor_site_rec.city                           := 'Palestine';
        l_vendor_site_rec.country                    := 'PS';
        l_vendor_site_rec.org_id                      := 88;

        -- --------------
                /* Optional  *?/
        -- --------------
        l_vendor_site_rec.purchasing_site_flag  :='N';
        l_vendor_site_rec.pay_site_flag                :='N';
        l_vendor_site_rec.rfq_only_site_flag       :='N'; 
        l_vendor_site_rec.TERMS_DATE_BASIS      := 'Invoice';
        l_vendor_site_rec.PURCHASING_SITE_FLAG          := 'Y';
        l_vendor_site_rec.language                      := 'ARABIC';

        pos_vendor_pub_pkg.create_vendor_site
        (
               /*-- ------------------------------ 
               Input elements 
              --------------------------------------*/
              p_vendor_site_rec    => l_vendor_site_rec,
             /*
              -- Output elements
             */
              x_return_status         => lc_return_status,
              x_msg_count             => ln_msg_count,
              x_msg_data                => lc_msg_data,
              x_vendor_site_id      => ln_vendor_site_id,
              x_party_site_id         => ln_party_site_id,
              x_location_id            => ln_location_id
        );

        COMMIT; 
 EXCEPTION
         WHEN OTHERS THEN
                       ROLLBACK;
                       DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;

1 comment:

2015@Bahaa Barghouti. Powered by Blogger.