/
Cost Centres (COST_CENTRES_API)


Cost Centres (COST_CENTRES_API)


/wiki/spaces/QG/pages/24674321

 

Overview

 See table

Function Name

Purpose

Insert_cc

Inserts record into cost_centres table 

update_cc

Updates record in cost_centres table

validate_cc

Checks the business_associates, fa_ba_properties, overhead_methods, accounts, business_unit_operating_centre  and cost_centre_legals  tables to ensure that the specified action (insert, update, delete) is appropriate 

insert_comment

Inserts CC comment record into comments table 

update_comment

Updates CC comment record in comments table 

delete_comment

Deletes CC comment record in comments table 

validate_comment

Checks the comments table to ensure that the specified action (insert, update, delete) is appropriate 

insert_legal

Inserts CC legal record into cc_legals table 

insert_legal

Inserts CC legal record into cc_legals table, has a different set of parameters 

update_legal

Updates CC legal record in cc_legals table 

delete_legal

Deletes CC legal record from cc_legals table 

validate_legal

Checks the cost_centre_legals table to ensure that the specified action (insert, update, delete) is appropriate 

validate_location

Checks the survey_systems table to ensure that the specified action (insert, update, delete) is appropriate 

get_next_available_cc

Returns the next available cost centre number. 

validate_cc_hierarchy

Validates the hierarchy and parent entity for the given cost centre. 

insert_cc_hierarchy

Inserts a reporting entities row for the cost centre into the specified hierarchy under the specified parent entity.


cost_centres_api.INSERT_CC()

  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

i_cc_num

IN

VARCHAR2(10)


i_cc_type_code

IN

VARCHAR2(3)


i_cc_name

IN 

VARCHAR2(40)


i_ownership_org_id

IN 

NUMBER(4)


i_jib_flag

IN 

VARCHAR2(1)

'N'

i_alt_gl_code_reqd_flag

IN 

VARCHAR2(1)

'N'

i_use_jibe_edits_flag

IN

VARCHAR2(1)

'N'

i_term_date

IN 

DATE

NULL

i_cc_location

IN 

VARCHAR2

NULL

i_operator_cc_num

IN 

VARCHAR2(10)

NULL

i_unit_cc_num

IN 

VARCHAR2(10)

NULL

i_battery_num

IN 

VARCHAR2(10)

NULL

i_operator_client_id

IN 

NUMBER(6)

NULL

i_active_date

IN 

DATE

NULL

i_well_stat_code

IN 

VARCHAR2(6)

NULL

i_well_spud_date

IN 

DATE

NULL

i_well_rig_release_date

IN 

DATE

NULL

i_well_total_depth

IN 

NUMBER(10,2)

NULL

i_well_shut_in_date

IN 

DATE

NULL

i_primary_prod_code

IN 

VARCHAR2(6)

NULL

i_overhead_method_code

IN 

VARCHAR2(10)

NULL

i_managing_org_id

IN 

NUMBER(4)

NULL

i_producing_zone

IN 

VARCHAR2(20)

NULL

i_province

IN 

VARCHAR2(2)

NULL

i_overhead_recovery_cc_num

IN 

VARCHAR2(10)

NULL

i_survey_system_code

IN 

VARCHAR2(6)

NULL

i_location_element_1

IN 

VARCHAR(7)

NULL

i_location_element_2

IN 

VARCHAR(7)

NULL

i_location_element_3

IN 

VARCHAR2(7)

NULL

i_location_element_4

IN 

VARCHAR2(7)

NULL

i_location_element_5

IN 

VARCHAR2(7)

NULL

i_location_element_6

IN 

VARCHAR2(7)

NULL

i_location_element_7

IN 

VARCHAR2(7)

NULL

i_location_element_8

IN 

VARCHAR2(7)

NULL

i_capital_or_dry_hole_exp_code

IN 

VARCHAR2(1)

NULL

i_jibe_check_amt

IN 

NUMBER(14,2)

NULL

i_jibe_check_variance_pct

IN 

NUMBER(14,10)

NULL

i_allow_other_orgs_code

IN 

VARCHAR2(1)

NULL

i_contract_operator_client_id

IN 

NUMBER(6)

NULL

i_default_gl_sub_code

IN 

VARCHAR2(6)

NULL

i_cc_group_code

IN 

VARCHAR2(6)

NULL

i_billing_code

IN

VARCHAR2(1)

NULL

i_cc_udf_1_code

 …. i_cc_udf_20_code

IN

VARCHAR2(30)

NULL

i_operating_centre_code

IN

VARCHAR2(10) 

NULL

i_oc_cost_centre_flag

IN

VARCHAR2(1) 

'N'

i_user

IN

VARCHAR2(30)


o_return_status

*procedure only

OUT

VARCHAR2

Possible values:

  • ‘TRUE’
  • ‘FALSE’

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message

i_country_code

IN

VARCHAR2(2) 



cost_centres_api.UPDATE_CC()

  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

Same parameters as insert_cc()






cost_centres_api.VALIDATE_CC()

  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

i_mode

IN

VARCHAR2


i_cc_num

IN

VARCHAR2(10)

 

i_cc_type_code

IN

VARCHAR2(3)

 

i_cc_name

IN

VARCHAR2(40)

 

i_ownership_org_id

IN

NUMBER(4)

 

i_jib_flag

IN

VARCHAR2(1)


i_alt_gl_code_reqd_flag

IN

VARCHAR2(1)


i_use_jibe_edits_flag

IN

VARCHAR2(1)


i_term_date

IN

DATE


i_operator_cc_num

IN

VARCHAR2(10)


i_unit_cc_num

IN

VARCHAR2(10)


i_battery_num

IN

VARCHAR2(10)


i_operator_client_id

IN

NUMBER(6)


i_active_date

IN

DATE


i_well_stat_code

IN

VARCHAR2(6)


i_overhead_method_code

IN

VARCHAR2(10)


i_managing_org_id

IN

NUMBER(4)


i_producing_zone

IN

VARCHAR2(20)


i_province

IN

VARCHAR2(2)


i_overhead_recovery_cc_num

IN

VARCHAR2(10)


i_survey_system_code

IN

VARCHAR2(6)


i_location_element_1

IN

VARCHAR(7)


i_location_element_2

IN

VARCHAR(7)


i_location_element_3

IN

VARCHAR2(7)


i_location_element_4

IN

VARCHAR2(7)


i_location_element_5

IN

VARCHAR2(7)


i_location_element_6

IN

VARCHAR2(7)


i_location_element_7

IN

VARCHAR2(7)


i_location_element_8

IN

VARCHAR2(7)


i_capital_or_dry_hole_exp_code

IN

VARCHAR2(1)


i_jibe_check_amt

IN

NUMBER(14,2)


i_jibe_check_variance_pct

IN

NUMBER(14,10)


i_allow_other_orgs_code

IN

VARCHAR2(1)


i_contract_operator_client_id

IN

NUMBER(6)


i_default_gl_sub_code

IN

VARCHAR2(6)


i_cc_group_code

IN

VARCHAR2(6)


i_billing_code

IN

VARCHAR2(1)


i_cc_udf_1_code

 …. I_cc_udf_20_code

IN

VARCHAR2(30)


i_operating_centre_code

IN

VARCHAR2(10) 


i_oc_cost_centre_flag

IN

VARCHAR2(1) 


i_user

IN

VARCHAR2(30)


o_return_status


*procedure only

OUT

VARCHAR2

Possible values:

  • ‘TRUE’
  • ‘FALSE’

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message

i_country_code

IN

VARCHAR2(2)



Error Messages for CC() Functions

 See table

Message

Explanation

xxxx must be supplied 

Required value is NULL or not included in parameters.

Net Estimate Percent cannot be greater than 100.0 

The percent is greater than 100.0.

Cost Centre already exists

The Cost Centre cannot be inserted because it already exists (insert only). 

Cost Centre does not exist

The Cost Centre cannot be updated because it does not exist (update only). 

Invalid xxxx Code

The specified code does not exist in the codes table.

xxxx must be Y(Yes) or N(No)

The flag value is not ‘Y’ or ‘N’.

Invalid Unit Cost Centre

The specified unit cost centre does not exist in the cost_centres table.

Well Rig Release Date must be greater than or equal to Well Spud Date

The date specified in i_well_rig_release_date is less than the date specified in i_well_spud_date.

Invalid xxxx Organization ID

The specified organization does not exist in the organizations table.

Non-primary location(s) exist for this Cost Centre, cannot blank out primary location

To remove the primary legal location call delete_legal and it will automatically update the columns in the cost_centres table.

Survey System xxxx, Element number xxxx not found

The survey system element is not found in the table survey_systems.

Location element xxxx cannot be blank

The specified location element is defined as mandatory.

Location element xxxx must match the length of xxxx

The length of the specified location element is incorrect.

Error: Location element xxxx must be a character . ex. A

The format of the specified location element does not match that defined for the element.

Location element xxxx must be numeric. ex. 9

The specified location element must be numeric as defined.

Location element xxxx must be alphanumeric. ex. 9 or A

The specified location element must be alphanumeric as defined.

Invalid format mask for location element

An unhandled format character was used to define the specified location element.

Location element xxxx value xxxx must be between xxxx and xxxx

The specified location element is not between the required range as defined for the element.

JIBE Check Amount must be supplied if JIBE Edits are turned on

i_use_jibe_edits_flags is set to ‘Y’ with not value specified in i_jibe_check_amt or I_use_jibe_edits_flag is set to ‘N’ but there is a value in I_jibe_check_amt.

JIBE Variance Percent must be supplied if JIBE Edits are turned on

i_use_jibe_edits_flags is set to ‘Y’ with not value specified in i_jibe_check_variance_pct or i_use_jibe_edits_flag is set to ‘N’ but there is a value in i_jibe_check_variance_pct.

Invalid Business Associate used as xxx

The specified business associate does not exist in business_associates and/or fa_ba_properties.

Invalid Overhead Method

The specified overhead method does not exist in overhead_methods as an operating overhead method.

Invalid Recovery Account on Overhead Method

The recovery account for the overhead method that is specified in table overhead_methods is not a valid account.

Overhead Recovery Cost Centre must be supplied for the specified Method

The cost centre specified in the I_overhead_recovery_cc_num column does not exist in the table cost_centres.

Invalid Overhead Recovery Cost Centre

A cost centres has been specified in the i_overhead_recovery_cc_num column but it is not required for the recovery account.

Overhead Recovery Cost Centre must be NULL

A cost centre has been specified in the i_overhead_recovery_cc_num column but it is not required for the recovery account.

Operating Centre Code does not exist in Business Unit Relationships

The cost centre is defined as being an operating centre code but it does not exist in the table business_unit_operating_centre or the cost centre is not defined as being an operating centre code but the value specified in i_operating_centre_code does not exist in table business_unit_operating_centre. 

Operating Centre Code does not exist as a Cost Centre

The specified value in i_operating_centre_code is a valid operating centre code, however, it is set up as not being valid as a cost centre in the business_unit_operating_centre table.

CC_UDF_x_CODE – UDF Code cannot be NULL 

The UDF column is defined as mandatory but does not have a value supplied.

CC_UDF_x_CODE – Invalid UDF Type Code 

The UDF column is not defined in the udf_codes table.

CC_UDF_x_CODE – Invalid UDF Code Value 

The UDF code value does not exist in UDF Codes.

CC_UDF_x_CODE – Code cannot exceed xx characters long

The length of the UDF column value exceeds the length defined for that UDF column. 

CC_UDF_x_CODE – Invalid number

The UDF column is defined as numeric but does not have a numeric value. 

Warning - Value in cc_location Cannot Be Processed

A value was detected in the obsolete i_cc_location parameter.  This is a warning only and the insert/update was successful.  Please remove references to this column. 


Special Considerations for insert/update_CC() Functions

Create_date and create_user are automatically populated for calls to insert_cc.


Last_updt_date and last_updt_user are populated for calls to insert_cc and update_cc.

The term_user column is automatically populated with the value of i_user when the term_date is set to a value.


cost_centres_api.INSERT_COMMENT()

  • If there are no validation errors, an ID will automatically be generated and passed back in o_id.
  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

i_comment_type_code

IN

VARCHAR2(30) 


i_reference_id

IN

VARCHAR2(20) 


i_comment_date

IN

DATE 


i_comment_text

IN

VARCHAR2(2000) 


i_user                        

IN

VARCHAR2(30) 


o_id

OUT

NUMBER(10)


o_return_status


*procedure only

OUT

VARCHAR2

Possible values:

  • ‘TRUE’
  • ‘FALSE’ 

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error 

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message


cost_centres_api.UPDATE_COMMENT()

  • Updates the comment record with the ID passed in.
  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

i_id

IN

NUMBER(10) 


i_comment_type_code

IN

VARCHAR2(30) 


i_reference_id

IN

VARCHAR2(20) 


i_comment_date

IN

DATE 


i_comment_text

IN

VARCHAR2(2000) 


i_user                        

IN

VARCHAR2(30)


o_return_status


*procedure only

OUT

VARCHAR2

Possible values:

  • ‘TRUE’
  • ‘FALSE’

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message

 

cost_centres_api.DELETE_COMMENT()

  • Deletes the comment record with the ID passed in.
  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

i_id

IN

NUMBER(10)


o_return_status

*procedure only

OUT

VARCHAR2

Possible values:

  • ‘TRUE’
  • ‘FALSE’ 

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error 

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message 


cost_centres_api.VALIDATE_COMMENT()

  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

i_mode

IN

VARCHAR2 


i_id

IN

NUMBER(10) 


i_reference_id

IN

VARCHAR2(20) 


i_comment_type_code

IN

VARCHAR2(30) 


i_comment_date

IN

DATE 


i_comment_text

IN

VARCHAR2(2000) 


i_user                        

IN

VARCHAR2(30)


o_return_status


*procedure only

OUT

VARCHAR2

Possible values:

  • ‘TRUE’
  • ‘FALSE’

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message


Error Messages for COMMENT() Functions

 See table

Message

Explanation

xxxx must be supplied

Required value is NULL or not included in parameters. 

Record does not exist

The Comment record cannot be updated because it does not exist (update only). 

Invalid Comment Type Code

The comment type code does not exist in the codes table. 

Invalid BA ID:  xxxx

The reference_id (displayed in xxxx) references a Business Associate that does not exist.


cost_centres_api.INSERT_LEGAL()

  • If there are no validation errors, an ID will automatically be generated.
  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
 See table

Parameter

In/Out

Type

Default Value

i_cc_num                     

IN

VARCHAR2(10) 


i_primary_flag               

IN

VARCHAR2(1)

‘N’ 

i_survey_system_code         

IN

VARCHAR2(6)

NULL 

i_location_element_1      

IN

VARCHAR2(7)

NULL 

i_location_element_2      

IN

VARCHAR2(7)

NULL 

i_location_element_3         

IN

VARCHAR2(7)

NULL 

i_location_element_4         

IN

VARCHAR2(7)

NULL 

i_location_element_5         

IN

VARCHAR2(7)

NULL 

i_location_element_6         

IN

VARCHAR2(7)

NULL

i_location_element_7         

IN

VARCHAR2(7)

NULL 

i_location_element_8         

IN

VARCHAR2(7)

NULL 

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error 

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message 


cost_centres_api.INSERT_LEGAL()

  • If there are no validation errors, an ID will automatically be generated.
  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

i_cc_num                     

IN

VARCHAR2(10)

  

i_primary_flag               

IN

VARCHAR2(1)

‘N’ 

i_survey_system_code         

IN

VARCHAR2(6)

NULL 

i_location_element_1      

IN

VARCHAR2(7)

NULL 

i_location_element_2      

IN

VARCHAR2(7)

NULL 

i_location_element_3         

IN

VARCHAR2(7)

NULL 

i_location_element_4         

IN

VARCHAR2(7)

NULL

i_location_element_5         

IN

VARCHAR2(7)

NULL 

i_location_element_6         

IN

VARCHAR2(7)

NULL 

i_location_element_7         

IN

VARCHAR2(7)

NULL 

i_location_element_8         

IN

VARCHAR2(7)

NULL 

o_legal_id

OUT

NUMBER(10)


o_return_status


*procedure only

OUT

VARCHAR2

Possible values:

‘TRUE’

‘FALSE’ 

o_return_code

OUT

NUMBER

Possible values:

0 – Success

-20001 – Handled Application Error

-20000 – Generic Error 

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message 


cost_centres_api.UPDATE_LEGAL()

  • If there are no validation errors, an ID will automatically be generated.
  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

I_id

IN

NUMBER(10)

  

i_cc_num                     

IN

VARCHAR2(10)


i_primary_flag               

IN

VARCHAR2(1)

‘N’ 

i_survey_system_code         

IN

VARCHAR2(6)

NULL 

i_location_element_1      

IN

VARCHAR2(7)

NULL 

i_location_element_2      

IN

VARCHAR2(7)

NULL 

i_location_element_3         

IN

VARCHAR2(7)

NULL 

i_location_element_4         

IN

VARCHAR2(7)

NULL 

i_location_element_5         

IN

VARCHAR2(7)

NULL 

i_location_element_6         

IN

VARCHAR2(7)

NULL 

i_location_element_7         

IN

VARCHAR2(7)

NULL 

i_location_element_8         

IN

VARCHAR2(7)

NULL

o_return_status


*procedure only

OUT

VARCHAR2

Possible values:

  • ‘TRUE’
  • ‘FALSE’

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message


cost_centres_api.DELETE_LEGAL()

  • Deletes the legal record with the ID passed in.
  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

i_id

IN

NUMBER(10)


o_return_status


*procedure only

OUT

VARCHAR2

Possible values:

  • ‘TRUE’
  • ‘FALSE’ 

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message


cost_centres_api.VALIDATE_LEGAL()

  • Function returns BOOLEAN to indicate a successful/unsuccessful action.
  • Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
  • Available as both a function and a procedure.
 See table

Parameter

In/Out

Type

Default Value

i_mode

IN

VARCHAR2 


i_cc_mode             

IN

VARCHAR2 


i_id

IN

NUMBER(10) 


i_cc_num

IN

VARCHAR(10) 


i_primary_flag               

IN

VARCHAR2(1) 


i_survey_system_code         

IN

VARCHAR2(6) 


i_location_element_1      

IN

VARCHAR2(7) 


i_location_element_2      

IN

VARCHAR2(7)


i_location_element_3         

IN

VARCHAR2(7) 


i_location_element_4         

IN

VARCHAR2(7) 


i_location_element_5         

IN

VARCHAR2(7) 


i_location_element_6         

IN

VARCHAR2(7) 


i_location_element_7         

IN

VARCHAR2(7) 


i_location_element_8         

IN

VARCHAR2(7) 


o_return_status


*procedure only

OUT

VARCHAR2

Possible values:

  • ‘TRUE’
  • ‘FALSE’

o_return_code

OUT

NUMBER

Possible values:

  • 0 – Success
  • -20001 – Handled Application Error
  • -20000 – Generic Error

o_return_message

OUT

VARCHAR2

Insert ‘Successful’ or ‘Failure’ or error message


Error Messages for …LEGAL() Functions

 See table

Message

Explanation

Survey System xxxx, Element number xxxx not found 

The survey system element is not found in the table survey_systems.

Location element xxxx cannot be blank 

The specified location element is defined as mandatory.

Location element xxxx must match the length of xxxx 

The length of the specified location element is incorrect.

Location element xxxx must be a character . ex. A 

The format of the specified location element does not match that defined for the element.

Location element xxxx must be numeric. ex. 9 

The specified location element must be numeric as defined.

Location element xxxx must be alphanumeric. ex. 9 or A 

The specified location element must be alphanumeric as defined.

Invalid format mask for location element 

An unhandled format character was used to define the specified location element.

Location element xxxx value xxxx must be between xxxx and xxxx 

The specified location element is not between the required range as defined for the element.

Cost Centre Legals ID does not exist

Specified cost centre legal record does not exist in cost_centre_legals (update and delete).

Cannot delete a primary location because there are non-primary locations for this Cost Centre 

There always must be one primary legal location record.  To delete a primary location you must first designate another location as the primary location.


cost_centres_api.GET_NEXT_AVAILABLE_CC()

  • This procedure returns the next available Cost Centre Number for the specified Org and Cost Centre Type.
  • A return code of zero indicates success.
  • Auto-numbering for Cost Centres must be turned on in order for CC Numbers to be generated.
    • System Default: AUTO_NUMBER_CC=Y
 See table

Parameter

In/Out

Type

Default Value

i_cc_type_code  

IN

VARCHAR2(3) 


i_managing_org_id

IN

NUMBER(4) 


o_next_cc_num

OUT

VARCHAR2(10) 

Next available CC number

o_return_code

OUT`

NUMBER

Possible values:

  • 0 -  Success
  • Non-zero - Error
  • SQLCode - Database error

o_error_message

OUT

VARCHAR2

‘SUCCESSFUL’ or validation / database error message 


Error Messages for GET_NEXT_AVAILABLE_CC Function

 See table

Message

Explanation

Cost Centre auto-numbering not enabled. 

The system default AUTO_NUMBER_CC is not set to Y.

ERROR: The cost centre number can not be generated for this Org/CC type.

A qualifying row in the cost_centre_next_avail table was not found. Ensure a row exists in this table which will cover the specified org and cost centre type.

ERROR: Cost Centre type is required. 

The cost centre type was not specified.

ERROR: Cost Centre type: <code> not found. 

The specified cost centre type does not exist.

ERROR: Managing Org is required. 

The managing org id was not specified.

ERROR: Managing Org: <org id> not found. 

The specified managing org id does not exist.

ERROR in update_next_cc_number: Unable to update next_avail_cc_num. 

Unable to update the required cost_centre_next_avail row.

Database error message

A database error occurred.


cost_centres_api.INSERT_CC_HIERARCHY()

  • This procedure inserts the specified Cost Centre into the specified reporting hierarchy.
  • A return code of zero indicates success.
  • It inserts a reporting_entities row for the specified Cost Centre in the specified reporting hierarchy under the specified parent entity.
 See table

Parameter

In/Out

Type

Default Value

i_hierarchy_code

IN

VARCHAR2(10) 


i_parent_entity_code

IN

VARCHAR2(10) 


i_cc_num

IN

VARCHAR2(10) 


i_afe_name

IN

VARCHAR2(240)


o_return_code

OUT`

NUMBER

Possible values:

  • 0 -  Success
  • Non-zero - Error
  • SQLCode - Database error 

o_error_message

OUT

VARCHAR2

‘SUCCESSFUL’ or  validation / database error message


cost_centres_api.VALIDATE_CC_HIERARCHY()

  • This procedure validates the reporting hierarchy information for a Cost Centre.
  • A return code of zero indicates success.
  • The specified CC is validated using the specified reporting hierarchy and the specified parent entity.
 See table

Parameter

In/Out

Type

Default Value

i_hierarchy_code

IN

VARCHAR2(10) 


i_parent_entity_code

IN

VARCHAR2(10) 


i_cc_num

IN

VARCHAR2(10) 


o_parent_reporting_level

OUT

VARCHAR2(10) 

Reporting level of Parent

o_parent_entity_id

OUT

NUMBER(10) 

Parent entity id

o_return_code

OUT`

NUMBER

Possible values:

  • 0 -  Success
  • Non-zero - Error
  • SQLCode - Database error

o_error_message

OUT

VARCHAR2

‘SUCCESSFUL’ or  validation  /  database error message 


cost_centres_api.UPDATE_AFE_HIER_PAR_ENTY_CODE ()

  • This procedure is used for UPDATE of hierarchy information. If there is a hierarchy code associated with the Cost Centre Number, then the parent entity code is updated.

If the cost centre does not exist for the hierarchy code, the hierarchy code and the parent entity are inserted if they pass validation.

  • A return code of zero indicates success.
  • The specified CC is validated using the specified reporting hierarchy and the specified parent entity.
 See table

Parameter

In/Out

Type

Default Value

i_hierarchy_code

IN

VARCHAR2(10) 


i_parent_entity_code

IN

VARCHAR2(10) 


i_cc_num

IN

VARCHAR2(10) 


o_parent_reporting_level

OUT

VARCHAR2(10) 

Reporting level of Parent

o_parent_entity_id

OUT

NUMBER(10)

Parent entity id

o_return_code

OUT`

NUMBER

Possible values:

  • 0 -  Success
  • Non-zero - Error
  • SQLCode - Database error

o_error_message

OUT

VARCHAR2

‘SUCCESSFUL’ or  validation  /  database error message


Error Messages for …CC_HIERARCHY() Functions

 See table

Message

Explanation

<hierarchy code> not found.

The specified hierarchy code does not exist. 

<hierarchy code> is not a cost centre type hierarchy. 

The specified hierarchy is not a CC type hierarchy. 

Parent reporting level not found for hierarchy.

The parent reporting level was not found for the specified parent entity. 

Parent reporting level not specified for hierarchy. 

No parent reporting level is specified for the CC reporting level. 

Parent entity <entity code> not found. 

The specified parent entity code was not found in the specified hierarchy.

Cost centre <CC number> already exists in the <hierarchy code> hierarchy. 

The CC number already exists in the specified hierarchy.

ERROR: Hierarchy code is required. 

The hierarchy code was not specified.

ERROR: Parent Entity Code is required.

The parent entity code was not specified.

Database error message

A database error occurred.




Related content


Copyright© 2024 IFS AB. Copying prohibited. All rights reserved.