My Oracle Support Banner

Wrapper Code Calling API Process_limits Is Throwing Error : Limit Cannot Be Modified Because Balance Exists for This Limit (Doc ID 2970391.1)

Last updated on AUGUST 25, 2023

Applies to:

Oracle Advanced Pricing - Version 12.1.3 and later
Information in this document applies to any platform.
API
qp_limits_pub.process_limits
process_limits
qp_limits_pub

Symptoms

 When attempting to update modifier limits calling API process_limits the following error is shown in the output file.

Limit cannot be modified because balance exists for this Limit.

 

Issue may be replicated as follows:
1. Run custom wrapper code which calls API process_limits

Before:
The total amount - 5 and consumed -0 and available -5.
Trying to update:
the total amount -1 and consumed-0 and available-1.

Sample code used:

SET SERVEROUTPUT ON;



DECLARE
    x_return_status           VARCHAR2(240) := fnd_api.g_ret_sts_success;
    x_msg_count               NUMBER;
    x_msg_data                VARCHAR2(32000);
    p_limits_rec              qp_limits_pub.limits_rec_type;
    p_limits_val_rec          qp_limits_pub.limits_val_rec_type;
    p_limit_attrs_tbl         qp_limits_pub.limit_attrs_tbl_type;
    p_limit_attrs_val_tbl     qp_limits_pub.limit_attrs_val_tbl_type;
    p_limit_balances_tbl      qp_limits_pub.limit_balances_tbl_type;
    p_limit_balances_val_tbl  qp_limits_pub.limit_balances_val_tbl_type;
    x_limits_rec              qp_limits_pub.limits_rec_type;
    x_limits_val_rec          qp_limits_pub.limits_val_rec_type;
    x_limit_attrs_tbl         qp_limits_pub.limit_attrs_tbl_type;
    x_limit_attrs_val_tbl     qp_limits_pub.limit_attrs_val_tbl_type;
    x_limit_balances_tbl      qp_limits_pub.limit_balances_tbl_type;
    x_limit_balances_val_tbl  qp_limits_pub.limit_balances_val_tbl_type;
BEGIN
    oe_debug_pub.setdebuglevel(5);
    oe_debug_pub.g_dir := '/usr/tmp'; -- Example
    dbms_output.put_line('The File is' || oe_debug_pub.set_debug_mode('FILE'));
    oe_debug_pub.initialize;
    oe_debug_pub.debug_on;
    p_limits_rec.amount := 1;
    p_limits_rec.limit_id := &limit_id;
    p_limits_rec.list_header_id := &list_header_id;
    p_limits_rec.list_line_id := &list_line_id;
    p_limits_rec.last_updated_by := '-1';
    p_limits_rec.last_update_date := sysdate;
    p_limits_rec.operation := 'UPDATE';
    qp_limits_pub.process_limits(1.0, 'T',
                                'T',
                                'T',
                                x_return_status,
                                x_msg_count,
                                x_msg_data,
                                p_limits_rec,
                                p_limits_val_rec,
                                p_limit_attrs_tbl,
                                p_limit_attrs_val_tbl,
                                p_limit_balances_tbl,
                                p_limit_balances_val_tbl,
                                x_limits_rec,
                                x_limits_val_rec,
                                x_limit_attrs_tbl,
                                x_limit_attrs_val_tbl,
                                x_limit_balances_tbl,
                                x_limit_balances_val_tbl);

    COMMIT;
    dbms_output.put_line('x_msg_data limit - ' || x_msg_data);
    dbms_output.put_line('x_return_status limit - ' || x_return_status);
EXCEPTION
    WHEN OTHERS THEN
        dbms_output.put_line('Some error occurred' || sqlerrm);
        ROLLBACK;
END;
/


 
2. Review the output file and see above error.

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.