Using Below script we can update payment terms for suppliers.

 

 

 

DECLARE 

    p_customer_profile_rec         hz_customer_profile_v2pub.customer_profile_rec_type; 

    xin_xout_object_version_number NUMBER; 

    x_return_status                VARCHAR2(2000); 

    x_msg_count                    NUMBER; 

    x_msg_data                     VARCHAR2(2000); 

    CURSOR c1 IS 

    ( SELECT 

        cust_account_id, 

        cust_account_profile_id, 

        object_version_number, 

        status, 

        standard_terms, 

        profile_class_id, 

        site_use_id 

    FROM 

        hz_customer_profiles 

    WHERE 

        cust_account_id IN ( 

            SELECT 

                cust_account_id 

            FROM 

                hz_cust_accounts 

            WHERE 

                    1 = 1 

                AND site_use_id IS NOT NULL 

                AND account_number IN ( ‘8215500.100765’)  

        ) 

    ); 

 

BEGIN 

    fnd_global.apps_initialize(0, 54177, 222); 

    mo_global.init(‘AR’); 

    FOR i IN c1 LOOP 

        p_customer_profile_rec.cust_account_profile_id := i.cust_account_profile_id; 

        p_customer_profile_rec.standard_terms := 1004; 

        p_customer_profile_rec.site_use_id := i.site_use_id; 

        xin_xout_object_version_number := i.object_version_number; 

        hz_customer_profile_v2pub.update_customer_profile(‘T’, p_customer_profile_rec, xin_xout_object_version_number, x_return_status, 

        x_msg_count, 

                                                         x_msg_data); 

        dbms_output.put_line(‘***************************’); 

        dbms_output.put_line(‘Output information ….’); 

        dbms_output.put_line(‘xin_xout_object_version_number: ‘ || xin_xout_object_version_number); 

        dbms_output.put_line(‘x_return_status: ‘ || x_return_status); 

        dbms_output.put_line(‘x_msg_count: ‘ || x_msg_count); 

        dbms_output.put_line(‘x_msg_data: ‘ || x_msg_data); 

        dbms_output.put_line(‘***************************’); 

    END LOOP; 

commit; 

END; 

/ 

 

Recent Posts

Start typing and press Enter to search