Вы находитесь на странице: 1из 13

Oracle Property Manager

Variable Rent Create/Update APIs

Prepared By:
Author: Vaishali Karanth
Creation Date: 15-Oct-2015
Last Updated:
Control Number: 1
Version:
Copyright (C) 1995 Oracle Corporation
All Rights Reserved
Product Design and Architecture
Contents
1.Goal ............................................................................................................................................................ 3

2.Introduction ............................................................................................................................................... 3

3. Prerequisite ............................................................................................................................................... 3

4.Create Variable Rent API Definition ........................................................................................................... 3

4.1 VAR_RENT_REC_TYPE ......................................................................................................................... 3

4.2 VARIABLE_RENT_LINES_REC ............................................................................................................... 5

4.3 BREAKPOINT_HEADER_REC_TYPE ...................................................................................................... 6

4.4 BREAKPOINT_Details_REC_TYPE ........................................................................................................ 6

4.5 CONSTRAINTS_REC_TYPE ................................................................................................................... 7

4.6 ALLOW-ABAT_REC_TYPE..................................................................................................................... 7

4.7 Sample Code for creating a variable rent using API is ........................................................................ 7

5. Update Variable Rent Agreement .......................................................................................................... 11

5.1 The sample script for update variable rent agreement is ................................................................ 11
1.Goal:
This document is written to explain the usage and structures of the Variable rent Create and Update APIs in Oracle Property
Manager Module

2.Introduction
You can use this API to create and update variable rent agreements from a custom table .
The Create/Update Variable Rent API enables you to create a new variable Rent Agreement and update existing variable rent
agreements. The Create/Update Variable Rent uses the PN_VAR_RENT_PUB
Procedure.

3. Prerequisite
The Variable rent Create / update API is available only from 12.1.3 application version onwards. On 12.1.3, it is recommended
to apply patch 21614433:R12.PN.B to avoid any known bug in Variable Rent API Code.

4.Create Variable Rent API Definition

The Create/Update Variable Rent API package is called: PN_VAR_RENT_PUB. The procedures in this package are
PN_VAR_RENT_PUB.create_var_rent and PN_VAR_RENT_PUB.update_var_rent.
The following table provides the arguments,types, value, and descriptions of the elements of the
PN_VAR_RENT_PUB procedure.
Each argument has a prefix of P, X, or PX. These prefixes mean the following:

• P - indicates an In argument
• X - indicates an Out argument

Argument Type Value Description


p_api_version NUMBER Internal use only Version of the API in
use.
p_init_msg_list VARCHAR2 DEFAULT fnd_api.g_false Determines whether the
messages stack
should be initialized
and cleared.
p_commit VARCHAR2 DEFAULT fnd_api.g_false Commits the transaction.
p_validate_flag VARCHAR2 DEFAULT 'N' Determines whether the
validation of data needs to be
done or not
x_return_status VARCHAR2 Determines the API
success.
x_msg_count NUMBER Number of messages
on the message stack.
x_msg_data VARCHAR2 Message stack.

4.1 VAR_RENT_REC_TYPE
The VAR_RENT_REC_TYPE structure contains information about the Variable rent header informations, such as the lease
name, variable rent number etc. The following table shows type and value information for each argument.
Argument Required / Optional Type Value

lease_id Internal Use only NUMBER Lease id of the lease which


is attached to VR
agreement
lease_num Optional VARCHAR2 Lease Number
lease_name Required VARCHAR2 Lease Name. We can pass
either lease number of
lease name
location_id Optional NUMBER Location id assigned to the
lease
location_code Optional VARCHAR2 Location code assigned to
the lease
rent_num Optional / Required VARCHAR2 If Automatic Number is
enabled in system options
then this is an option
argument. If Automatic
number is not enabled,
then it is a required field
abstracted_by_user_id Required NUMBER User id of the user running
the API
abstracted_by_user Optional VARCHAR2 Name of the user running
the API
commencement_date Required DATE Start date of VR Agreement
termination_date Required DATE End date of VR agreement
term_template_id Required NUMBER Billing / Payment Term
template ID
term_template_name Optional VARCHAR2 Billing / Payment Term
template name
currency_code Required VARCHAR2 Currency of VR agreement
proration_days Optional NUMBER Number of prorate dates
agreement_template_id Optional NUMBER VR rent agreement
template ID
agreement_template_name Optional VARCHAR2 VR rent agreement
template name
cumulative_vol_code Required VARCHAR2 Calculation Method
proration_rule_code Required VARCHAR2 Partial year method Value
invoice_on_code Required VARCHAR2 Invoice on Actual or
Forecasted
negative_rent_code Required VARCHAR2 Indicate whether negative
rent amounts should be
ignored, deferred, or
credited
type_code Required VARCHAR2 Type of business volume for
which you are calculating
rent.
purpose_code Required VARCHAR2 Business category for which
you are creating a rent
agreement
use_gl_calendar Optional VARCHAR2 Select to generate variable
rent periods using a GL
calendar. The default is
value is No.
gl_period_set_name Optional VARCHAR2 If use_gl_calendar option is
set to Y, then Need to pass
GL calendar name
period_type Optional VARCHAR2 If you choose to use a GL
calendar to generate
variable rent periods, select
the type of GL calendar
period. For example, you
can choose Month, Week,
or Quarter.
reptg_freq_code Required VARCHAR2 Calculation frequency
reptg_day_of_month Optional NUMBER Reporting number of days
After
year_start_date Optional DATE Optional if we check the
use_gl_calendar option to
Yes
vrg_reptg_freq_code Required VARCHAR2 Reporting Frequency
invg_day_of_month Optional NUMBER Invoice day
invg_days_after Optional NUMBER Invoice number of days
After
comments Optional VARCHAR2
invg_freq_code Required VARCHAR2 Invoicing frequency
last_update_date Required DATE
last_updated_by Required NUMBER
creation_date Required DATE
created_by Required NUMBER
last_update_login Optional NUMBER

4.2 VARIABLE_RENT_LINES_REC

VARIABLE_RENT_LINES_REC_TYPE structure contains information about the Variable rent lines like start date, end date of the
line and line types etc. The following table shows type and value information for each argument.

Argument Required / Optional Type Value


line_default_id Optional NUMBER
line_num Required NUMBER Line number
var_rent_id Optional NUMBER Variable rent id
var_rent_num Optional VARCHAR2 Variable Rent Number
sales_channel_code Required VARCHAR2 Breakpoint Channel Details
item_category_code Required VARCHAR2 Breakpoint Product Category
line_start_date Required DATE Start date of the Breakpoint
Line
line_end_date Required DATE End date of the Breakpoint
Line
processed_flag Optional NUMBER
last_update_date Required DATE
last_updated_by NUMBER
creation_date DATE
created_by NUMBER
last_update_login NUMBER
4.3 BREAKPOINT_HEADER_REC_TYPE
The BREAKPOINT_HEADER_REC_TYPE structure contains information about the Variable rent breakpoint, such as the
breakpoint Start and End date, breakpoint type etc. The following table shows type and value information for each argument.

Argument Required / Optional Type Value


bkhd_default_id Optional NUMBER
bkhd_detail_num Required NUMBER Break point header line
number
line_default_id Optional NUMBER
bkhd_start_date Required DATE Break point Header Start
date
bkhd_end_date Required DATE Break point Header End
date
break_type_code Required VARCHAR2 Break point type whether it
is Artificial or Natural
natural_break_rate Optional /Required NUMBER Not Required if Break Type
is Artificial. Required if the
Break Type is Natural
breakpoint_type_code Required VARCHAR2 Break Point type
var_rent_id Optional NUMBER Variable Rent id
last_update_date
last_updated_by
creation_date
created_by
last_update_login

4.4 BREAKPOINT_Details_REC_TYPE
The BREAKPOINT_Details_REC_TYPE structure contains information about the Variable rent breakpoint, such as the breakpoint
Start and End date, breakpoint volume Details, Rate etc. The following table shows type and value information for each
argument.

Argument Required / Optional Type Value


bkdt_default_id Optional NUMBER
bkdt_detail_num Required NUMBER Breakpoint Details Line Number
bkhd_detail_num Required NUMBER Breakpoint header Line
Number
bkdt_start_date Required DATE Break Point Line start Date
bkdt_end_date Required DATE Break Point Line End date
period_bkpt_vol_start Required NUMBER Period breakpoint volume Start
amount
period_bkpt_vol_end Required NUMBER Period breakpoint Volume end
amount
group_bkpt_vol_start Optional NUMBER Group Period breakpoint
volume Start amount
group_bkpt_vol_end Optional NUMBER Group Period breakpoint
volume Ending amount
bkpt_rate Required NUMBER Percentage rate for Rent
calculation
annual_basis_amount Optional NUMBER
var_rent_id Required NUMBER
last_update_date DATE
last_updated_by NUMBER
creation_date DATE
created_by NUMBER
last_update_login NUMBER

4.5 CONSTRAINTS_REC_TYPE
The Constraints_Rec_type structure contains information about the Variable rent breakpoint constraints such as the
Constraint Start and End date, Constraint type etc. The following table shows type and value information for each argument

Argument Required / Optional Type Value


constr_default_id Optional NUMBER
constr_default_num Required NUMBER Constraint Number
var_rent_id Required NUMBER Variable rent Agreement id
var_rent_num Required VARCHAR2 Variable Rent Numer
agreement_template_id Optional NUMBER Constraint Agreement template id
constr_template_id Optional NUMBER Constraint template Id
constr_start_date Required DATE Constraint Start date
constr_end_date Requited DATE Constraint End date
constr_cat_code Required VARCHAR2 Constraint category. Normally it is
set to “VARENT”
constr_type_code Required VARCHAR2 Constraint Type
constr_type_meaning Optional VARCHAR2 Constraint Type Meaning
constr_amount Required NUMBER Constraint Amount
last_update_date Required DATE
last_updated_by Required NUMBER
creation_date Required DATE
created_by Required NUMBER
last_update_login Required NUMBER

4.6 ALLOW-ABAT_REC_TYPE
The Allow_abat_rec_type structure contains information about the abatements such as the abatement type, abatement start
date, abatement end date etc. The following table shows type and value information for each argument

Argument Required / Optional Type Value


abatement_id Required NUMBER Abatement Id
var_rent_id Required NUMBER Variable rent id for which
Abatement is being created
var_rent_num Optional VARCHAR2 Variable rent number
abat_type_meaning Required VARCHAR2 Abatement Type code
abat_start_date Required DATE Abatement Start date
abat_end_date Required DATE Abatement End date
abat_amount Required NUMBER Abatement Amount
description Optional VARCHAR2 Description of Abatement
comments Optional VARCHAR2 Comments if any
last_update_date Required DATE
last_updated_by Required NUMBER
creation_date Required DATE
created_by Required NUMBER
last_update_login Required NUMBER
org_id Required NUMBER

4.7 Sample Code for creating a variable rent using API is

set serveroutput on
DECLARE
lv_mesg VARCHAR2(2000);
lv_api_version NUMBER;
lv_init_msg_list varchar2(100);
lv_rent_num VARCHAR2(50);
lv_rent_id NUMBER;
lv_validate VARCHAR2(100);
lv_msg_count NUMBER;
lv_msg_data VARCHAR2(1000);
lv_return_status VARCHAR2(10);
p_count NUMBER := 0;
lv_var_rent_rec pn_varen_pvt.var_rent_rec_type;
lv_variable_rent_lines_rec pn_varen_pvt.variable_rent_lines_rec_type;
lv_breakpoint_header_rec pn_varen_pvt. breakpoint_header_rec_type;
lv_breakpoint_details_rec pn_varen_pvt.breakpoint_details_rec_type;
lv_constraints_rec pn_varen_pvt.constraints_rec_type;
lv_variable_rent_lines_tbl pn_varen_pvt.variable_rent_lines_tbl_type;
lv_breakpoint_header_tbl pn_varen_pvt.breakpoint_header_tbl_type;
lv_breakpoint_details_tbl pn_varen_pvt.breakpoint_details_tbl_type;
lv_constraints_tbl pn_varen_pvt.constraints_tbl_type;
lv_allow_abat_tbl pn_varen_pvt.allow_abat_tbl_type;
lv_generate_periods VARCHAR2(2) := 'Y';
lv_generate_breakpoints VARCHAR2(2) := 'Y';
lv_generate_constraints VARCHAR2(2) := 'Y';

BEGIN
---Set the applications context
mo_global.init ('PN');
mo_global.set_policy_context ('S', '204');
fnd_global.apps_initialize (1318,21513,240);
---Initializing variables
--VR Header
--lv_var_rent_rec.rent_num := '111';
lv_var_rent_rec.lease_id:= 1240 ;
lv_var_rent_rec.location_id := NULL;
lv_var_rent_rec.location_code := NULL;
lv_var_rent_rec.term_template_id := 10020;
lv_var_rent_rec.abstracted_by_user_id := 1318;
lv_var_rent_rec.commencement_date := to_date('01-MAY-1999' , 'DD-MON-YYYY');
lv_var_rent_rec.termination_date := to_date('30-NOV-2004' , 'DD-MON-YYYY');
lv_var_rent_rec.currency_code := 'USD';
--lv_var_rent_rec.agreement_template_name := NULL;
lv_var_rent_rec.proration_rule_code := 'STD';
--lv_var_rent_rec.proration_days := 365;
lv_var_rent_rec.cumulative_vol_code:= 'C';
lv_var_rent_rec.invoice_on_code := 'ACTUAL';
lv_var_rent_rec.negative_rent_code := 'IGNORE';
--lv_var_rent_rec.order_of_appl_code :=
lv_var_rent_rec.purpose_code := 'RENT';
lv_var_rent_rec.type_code := 'PRCT' ;
--- lv_var_rent_rec.uom_code := ''
lv_var_rent_rec.creation_date := SYSDATE;
lv_var_rent_rec.created_by :=1318;
lv_var_rent_rec.last_update_date := SYSDATE;
lv_var_rent_rec.last_updated_by := 1318;
lv_var_rent_rec.comments := 'Test_VR';
lv_var_rent_rec.invg_freq_code := 'MON';
lv_var_rent_rec.period_type := 'YR';
lv_var_rent_rec.reptg_freq_code := 'MON';
--lv_var_rent_rec.var_rent_id :=
lv_var_rent_rec.vrg_reptg_freq_code := 'MON';

--VR Lines
--lv_variable_rent_lines_rec.line_default_id :=
lv_variable_rent_lines_rec.line_num := 1;
-- lv_variable_rent_lines_rec.var_rent_id := lv_var_rent_rec.var_rent_id; /*Included */
--lv_variable_rent_lines_rec.var_rent_num := '111' ;
lv_variable_rent_lines_rec.sales_channel_code :='DIRECT';
--lv_variable_rent_lines_rec.sales_channel_meaning :=
lv_variable_rent_lines_rec.item_category_code := 'FOOD' ;/*Included*/
--lv_variable_rent_lines_rec.item_category_meaning :=
--lv_variable_rent_lines_rec.agreement_template_id :=
lv_variable_rent_lines_rec.line_start_date := to_date('01-MAY-1999' , 'DD-MON-YYYY');
lv_variable_rent_lines_rec.line_end_date := to_date('30-NOV-2004' , 'DD-MON-YYYY');
-- lv_variable_rent_lines_rec.processed_flag :=
lv_variable_rent_lines_rec.last_update_date := SYSDATE;
lv_variable_rent_lines_rec.last_updated_by := 1318;
lv_variable_rent_lines_rec.creation_date := SYSDATE;
lv_variable_rent_lines_rec.created_by := 1318;
lv_variable_rent_lines_rec.last_update_login := 1318;
lv_variable_rent_lines_tbl(1) := lv_variable_rent_lines_rec;

--Breakpoint Header
--lv_breakpoint_header_rec.bkhd_default_id :=
lv_breakpoint_header_rec.bkhd_detail_num := 1;
--lv_breakpoint_header_rec.line_default_id := lv_variable_rent_lines_rec.line_default_id;
lv_breakpoint_header_rec.bkhd_start_date := to_date('01-MAY-1999' , 'DD-MON-YYYY');
lv_breakpoint_header_rec.bkhd_end_date := to_date('30-NOV-2004' , 'DD-MON-YYYY');
lv_breakpoint_header_rec.break_type_code := 'ARTIFICIAL'; --constant
--lv_breakpoint_header_rec.break_type_meaning
lv_breakpoint_header_rec.natural_break_rate := NULL;
lv_breakpoint_header_rec.breakpoint_type_code := 'STRATIFIED';
--lv_breakpoint_header_rec.breakpoint_type_meaning
-- lv_breakpoint_header_rec.var_rent_id :=lv_var_rent_rec.var_rent_id; /*Included */
lv_breakpoint_header_rec.last_update_date := SYSDATE;
lv_breakpoint_header_rec.last_updated_by := 1318;
lv_breakpoint_header_rec.creation_date := SYSDATE;
lv_breakpoint_header_rec.created_by := 1318;
lv_breakpoint_header_rec.last_update_login := 1318;
lv_breakpoint_header_tbl(1) := lv_breakpoint_header_rec;

---Breakpoint Line
--lv_breakpoint_details_rec.bkdt_default_id
lv_breakpoint_details_rec.bkdt_detail_num :=1;
lv_breakpoint_details_rec.bkhd_detail_num := lv_breakpoint_header_rec.bkhd_detail_num ; /*Included*/
--lv_breakpoint_details_rec.bkhd_detail_num := 1; /*Included*/
lv_breakpoint_details_rec.bkdt_start_date := to_date('01-MAY-1999' , 'DD-MON-YYYY');
lv_breakpoint_details_rec.bkdt_end_date := to_date('30-NOV-2004' , 'DD-MON-YYYY');
lv_breakpoint_details_rec.period_bkpt_vol_start := 0;
lv_breakpoint_details_rec.period_bkpt_vol_end := 240000;
lv_breakpoint_details_rec.bkpt_rate := 0.6;
lv_breakpoint_details_rec.last_update_date := SYSDATE;
lv_breakpoint_details_rec.last_updated_by := 1318;
lv_breakpoint_details_rec.creation_date := SYSDATE;
lv_breakpoint_details_rec.created_by := 1318;
lv_breakpoint_details_rec.last_update_login := 1318;
-- lv_breakpoint_details_rec.var_rent_id := lv_var_rent_rec.var_rent_id; /*Included */
lv_breakpoint_details_tbl(1) := lv_breakpoint_details_rec;

lv_breakpoint_details_rec.bkdt_detail_num :=2;
lv_breakpoint_details_rec.bkhd_detail_num := lv_breakpoint_header_rec.bkhd_detail_num ; /*Included*/
--lv_breakpoint_details_rec.bkhd_detail_num := 1; /*Included*/
lv_breakpoint_details_rec.bkdt_start_date := to_date('01-MAY-1999' , 'DD-MON-YYYY');
lv_breakpoint_details_rec.bkdt_end_date :=to_date('30-NOV-2004' , 'DD-MON-YYYY');
lv_breakpoint_details_rec.period_bkpt_vol_start := 240000;
lv_breakpoint_details_rec.period_bkpt_vol_end := 300000;
lv_breakpoint_details_rec.bkpt_rate := 0.7;
lv_breakpoint_details_rec.last_update_date := SYSDATE;
lv_breakpoint_details_rec.last_updated_by := 1318;
lv_breakpoint_details_rec.creation_date := SYSDATE;
lv_breakpoint_details_rec.created_by := 1318;
lv_breakpoint_details_rec.last_update_login := 1318;
-- lv_breakpoint_details_rec.var_rent_id := lv_var_rent_rec.var_rent_id; /*Included */
lv_breakpoint_details_tbl(2) := lv_breakpoint_details_rec;

DBMS_OUTPUT.put_line('Calling API');
PN_VAR_RENT_PUB.create_var_rent (
p_api_version => 1.0
, p_init_msg_list => FND_API.g_false
, p_commit => fnd_api.g_true
, p_validate_flag => fnd_api.g_true
, p_var_rent_rec => lv_var_rent_rec
, p_variable_rent_lines_tbl => lv_variable_rent_lines_tbl
, p_breakpoint_header_tbl => lv_breakpoint_header_tbl
, p_breakpoint_details_tbl => lv_breakpoint_details_tbl
, p_constraints_tbl => lv_constraints_tbl
, p_allow_abat_tbl => lv_allow_abat_tbl
, p_generate_periods => lv_generate_periods
, p_generate_breakpoints => lv_generate_breakpoints
, p_generate_constraints => lv_generate_constraints
, x_return_status => lv_return_status
, x_msg_count => lv_msg_count
, x_msg_data => lv_msg_data
, x_var_rent_id => lv_rent_id
, x_var_rent_num => lv_rent_num
);
DBMS_OUTPUT.put_line('RETURN_STATUS : '||lv_return_status);
DBMS_OUTPUT.put_line('RENT_ID : '||lv_rent_id);

IF lv_msg_count = 1
THEN
DBMS_OUTPUT.put_line ('lv_msg_data ' || lv_msg_data);
ELSIF lv_msg_count > 1
THEN
LOOP
p_count := p_count + 1;
lv_msg_data := fnd_msg_pub.get (fnd_msg_pub.g_next, fnd_api.g_false);

IF lv_msg_data IS NULL
THEN
EXIT;
END IF;
DBMS_OUTPUT.put_line ('Message ' || p_count || '. ' || lv_msg_data);
END LOOP;
END IF;

--COMMIT;

end;

Note:- The value passed to the below parameters needs to be changed according to the Property Manager Responsibility id and
user id from which the script is being run.

mo_global.set_policy_context ('S', '204');


fnd_global.apps_initialize (1318,21513,240);

In the above script org_id (204), resp_id (21513) and user_id (1318).

5. Update Variable Rent Agreement


For updating the existing variable rent agreement, we need to pass existing variable rent id to the API. In addition to that we
need to pass arguments under different rec’s depending on what values we want to update. For e.g if we want to update break
point details then you need to pass the BREAKPOINT_Details_REC_TYPE . In the same way if you want to update constraint
details then Constraints_Rec_type argument needs to be passed.

Also while trying to update the existing variable rent agreement, the below three parameters need to be passed

 p_undo_periods – Should be set to ‘Y’ if we want to undo the variable rent periods which are already generated.
Other wise p_undo_periods should be set to ‘N’
 p_undo_breakpoints - When you want to update the breakpoints through Update_Var_Rent API, the parameter
'p_undo_breakpoints' should have a value 'Y'.
 p_undo_constraints - When you want to update the constraints through Update_Var_Rent API, the parameter
'p_undo_constraints' should have a value 'Y'.

5.1 The sample script for update variable rent agreement is

create or replace
PROCEDURE XX_UPDATE_VRENT_BREAKPOINT_API(
errbuf OUT VARCHAR2,
retcode OUT NUMBER )
IS

lv_mesg VARCHAR2 (2000);


lv_api_version NUMBER;
lv_init_msg_list VARCHAR2 (100);
lv_validate VARCHAR2 (100);

lv_var_rent_rec pn_varen_pvt.upd_var_rent_rec_type;
lv_var_rent_lines_tbl pn_varen_pvt.variable_rent_lines_tbl_type;
lv_breakpoint_header_tbl pn_varen_pvt.breakpoint_header_tbl_type;
lv_breakpoint_details_tbl pn_varen_pvt.breakpoint_details_tbl_type;
lv_constraint_tbl pn_varen_pvt.constraints_tbl_type;
lv_allow_tbl pn_varen_pvt.allow_abat_tbl_type;
lv_return_status VARCHAR2 (1);
lv_msg_count NUMBER;
lv_msg_data VARCHAR2 (2000);
lv_vrent_lines_rec apps.pn_varen_pvt.variable_rent_lines_rec_type;
lv_breakpoint_header_rec apps.pn_varen_pvt.breakpoint_header_rec_type;
lv_breakpoint_line_rec apps.pn_varen_pvt.breakpoint_details_rec_type;
BEGIN
--DBMS_OUTPUT.put_line ('Apps Initialize:');
apps.mo_global.set_policy_context ('S', 204);
fnd_global.apps_initialize( user_id => 1318, -- operations
resp_id => 21513, -- Property Manager, Vision Operations (USA)
resp_appl_id => 240 -- Property Manager
);

--DBMS_OUTPUT.put_line ('Start');

--Vrent Details
--lv_var_rent_rec.var_rent_id := 28024;

--Vrent Line Details


-- lv_vrent_lines_rec.var_rent_id :=28024;
--lv_vrent_lines_rec.line_num :=1;
--lv_vrent_lines_rec.line_default_id :=16025;

--Vrent BreakPoint header Details


-- lv_breakpoint_header_rec.var_rent_id :=28024;
-- lv_breakpoint_header_rec.bkhd_detail_num :=1;
--lv_breakpoint_header_rec.break_type_code := 'ARTIFICIAL';
--lv_breakpoint_header_rec.bkhd_default_id :=28024;

--Vrent Breakpoint Line Details

lv_breakpoint_details_tbl (1).var_rent_id := 44022;


lv_breakpoint_details_tbl (1).bkdt_start_date := TO_DATE ('01-Jan-2016', 'DD-MON-YYYY');
lv_breakpoint_details_tbl (1).bkdt_end_date := TO_DATE ('30-Nov-2015', 'DD-MON-YYYY');
--lv_breakpoint_details_tbl (1).group_bkpt_vol_start := 250.00;
--lv_breakpoint_details_tbl (1).group_bkpt_vol_end := 333.33;
lv_breakpoint_details_tbl (1).bkdt_detail_num := 3;
lv_breakpoint_details_tbl (1).bkdt_default_id :=59042;
lv_breakpoint_details_tbl (1).bkpt_rate := -3.75;
--lv_breakpoint_details_tbl (1).annual_basis_amount := 0;

lv_breakpoint_details_tbl (2).var_rent_id := 44022;


lv_breakpoint_details_tbl (2).bkdt_start_date := TO_DATE ('01-DEC-2015', 'DD-MON-YYYY');
lv_breakpoint_details_tbl (2).bkdt_end_date := TO_DATE ('30-NOV-2030', 'DD-MON-YYYY');
lv_breakpoint_details_tbl (2).period_bkpt_vol_start := 200.0;
lv_breakpoint_details_tbl (2).period_bkpt_vol_end := 300.0;
lv_breakpoint_details_tbl (2).bkdt_detail_num :=4;
lv_breakpoint_details_tbl (2).bkhd_default_id :=51020;
lv_breakpoint_details_tbl (2).bkpt_rate := 4.25;
--lv_breakpoint_details_tbl (2).annual_basis_amount := 0;
lv_var_rent_lines_tbl (1) := lv_vrent_lines_rec;
lv_breakpoint_header_tbl (1) := lv_breakpoint_header_rec;

apps.pn_var_rent_pub.update_var_rent
( p_api_version => 1.0,
p_init_msg_list => apps.fnd_api.g_false,
p_commit => apps.fnd_api.g_false,
p_validate_flag => 'N',
p_upd_var_rent_rec => lv_var_rent_rec,
p_var_rent_lines_tbl => lv_var_rent_lines_tbl,
p_breakpoint_header_tbl => lv_breakpoint_header_tbl,
p_breakpoint_details_tbl => lv_breakpoint_details_tbl,
p_constraints_tbl => lv_constraint_tbl,
p_allow_abat_tbl => lv_allow_tbl,
p_undo_periods => 'N',
p_undo_breakpoints => 'Y',
p_undo_constraints => 'N',
x_return_status => lv_return_status,
x_msg_count => lv_msg_count,
x_msg_data => lv_msg_data
);

IF (lv_return_status <> apps.fnd_api.g_ret_sts_success) THEN

lv_msg_count := apps.fnd_msg_pub.count_msg;
IF lv_msg_count > 0 THEN
lv_mesg := ';' || SUBSTR (apps.fnd_msg_pub.get (apps.fnd_msg_pub.g_first, apps.fnd_api.g_false ), 1, 512 );
FOR i IN 1 .. (lv_msg_count - 1)
LOOP
lv_mesg := lv_mesg || ';' || SUBSTR (apps.fnd_msg_pub.get (apps.fnd_msg_pub.g_next, apps.fnd_api.g_false ),
1, 512 );
END LOOP;
END IF;
END IF;
apps.fnd_file.put_line (apps.fnd_file.LOG, lv_mesg);
COMMIT;
EXCEPTION
WHEN OTHERS THEN
apps.fnd_file.put_line (apps.fnd_file.LOG, 'Main Exception ' || SQLERRM);
END;

Вам также может понравиться