Vous êtes sur la page 1sur 38

Oracle Receivables

Adjustment API User Notes

Release 11i

June, 2001

Adjustment API User Notes for Release 11i Copyright 1996, 2000, Oracle Corporation. All rights reserved. Primary Author: Contributors: Saloni Shah

Dianna Ferguson, William Hogan

The Programs (which include both the software and documentation) contain proprietary information of Oracle Corporation; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs is prohibited. Program Documentation is licensed for use solely to support the deployment of the Programs and not for any other purpose. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error free. Except as may be expressly permitted in your license agreement for these Programs, no part of these Programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation. If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on behalf of the U.S. Government, the following notice is applicable: Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial computer software" and use, duplication, and disclosure of the Programs, including documentation, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, Programs delivered subject to the Federal Acquisition Regulations are "restricted computer software" and use, duplication, and disclosure of the Programs shall be subject to the restrictions in FAR 52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065. The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of such applications if the Programs are used for such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the Programs. Oracle is a registered trademark. Other names may be trademarks of their respective owners.

Contents
Overview .............................................................................................................................................. Major Features..................................................................................................................................... Flexibility ................................................................................................................................ Modular Approach................................................................................................................ Error Handling....................................................................................................................... Debugging .............................................................................................................................. Solution Outline ................................................................................................................................. Modular Approach................................................................................................................ Exception Handling and Result Messages ........................................................................ Return Status:.................................................................................................................. Messages :........................................................................................................................ API Usage ............................................................................................................................................. Ar_Adjust_pub.Create_Adjustment................................................................................... DESCRIPTION ............................................................................................................... Input Parameters ............................................................................................................ Output Parameters......................................................................................................... Validations of the parameters passed: ...................................................................... EXAMPLE ..................................................................................................................... Objective: ....................................................................................................................... Entered parameters:..................................................................................................... Call to the API:.............................................................................................................. Result :............................................................................................................................ Ar_Adjust_pub.Approve_Adjustment ............................................................................ Legend ........................................................................................................................... Validations of the parameters passed: ...................................................................... 1-2 1-3 1-3 1-3 1-3 1-3 1-4 1-4 1-4 1-5 1-5 1-7 1-8 1-8 1-8 1-8 1-16 1-16 1-16 1-16 1-16 1-16 1-16 1-17 1-22

EXAMPLE...................................................................................................................... Objective : ...................................................................................................................... Entered parameters : .................................................................................................... Call to the API :............................................................................................................. Result :............................................................................................................................ Ar_Adjust_pub.Modify_Adjustment ............................................................................... DESCRIPTION.............................................................................................................. Input Parameters .......................................................................................................... Output Parameters ....................................................................................................... Legend:........................................................................................................................... Validations of the parameters passed: ...................................................................... EXAMPLE...................................................................................................................... Objective : ...................................................................................................................... Entered parameters : .................................................................................................... Call to the API :............................................................................................................. Result :............................................................................................................................ Ar_Adjust_pub.Reverse_Adjustment............................................................................... DESCRIPTION.............................................................................................................. Input Parameters .......................................................................................................... Output Parameters ....................................................................................................... Validations of the parameters passed: ...................................................................... EXAMPLE...................................................................................................................... Objective : ...................................................................................................................... Entered parameters : .................................................................................................... Call to the API :............................................................................................................. Result :............................................................................................................................ Messages .............................................................................................................................................

1-22 1-22 1-22 1-22 1-22 1-22 1-22 1-23 1-23 1-23 1-27 1-27 1-27 1-27 1-27 1-28 1-28 1-28 1-28 1-28 1-29 1-29 1-29 1-29 1-29 1-30 1-31

vi

1
Adjustment API

Adjustment API

1-1

Overview

Overview
This document outlines the use of the Adjustment API. This API allows users to create, approve, update, and reverse adjustments for invoices using simple calls to PL/SQL functions. The Adjustment API is not intended to replace the existing Adjustment form, Adjustment Approval form or the batch Auto-Adjust program. The API can be accessed in two ways:

With standard PL/SQL servers-side routine calls Through Forms, using the capability of Forms6 to have a procedure as its underlying base table.

1-2

Adjustment API User Notes

Major Features

Major Features
Flexibility
The Adjustment API has an extensive defaulting mechanism for input parameters. This allows users to create, approve, update, and reverse adjustments while passing a minimal number of API parameters.

Modular Approach
The whole API has been designed in a highly modular fashion, resulting in code that is:

Easy to understand Easy to maintain Easy to expand

Error Handling
The Adjustment API provides an extensive error-handling and error-reporting mechanism whereby all the errors encountered in the defaulting and validation phases are reported and put on the message stack. The relevant entity handler is called only if there are no errors reported during the defaulting and validation phases.

Debugging
Users must enable debugging by calling the routine arp_standard.enable_file_ debug. Arp_standard.enable_file_debug requires 2 parameters: path_name and file_name. The path name can be identified by using the following select statement: select value from v$parameter where name = utl_file_dir; The file name can be any name, chosen by the user. Example: arp_standard.enable_file_debug (/sqlcom/log, txt.log);

Adjustment API

1-3

Solution Outline

Solution Outline
To create, modify, approve, or reverse adjustments, users can use the following routines:

4.1 Ar_Adjust_pub.Create_Adjustment : This routine can be used to create an adjustment for an invoice. 4.3 Ar_Adjust_pub.Modify_Adjustment : This routine can be used to modify an adjustments status, comments and reason code. NOTE: if the existing status of the adjustment is A or R then it cannot be modified. 4.2 Ar_Adjust_pub.Approve_Adjustment : This routine can be used to approve an adjustment. 4.4 Ar_Adjust_pub.Reverse_Adjustment : This routine can be used to reverse an adjustment.

Modular Approach
To modularize the Adjustment API, the basic structure of the API has been divided into three steps:
1. 2. 3.

Validating information the user has entered. Preparing data for the entity handlers by defaulting any values that may be needed. Calling to the entity handler to create/modify/approve/reverse the adjustment.

This results in code that is easy to understand and maintain. Any new functionality can be added using a simple code plug-in at any of the three steps.

Exception Handling and Result Messages


The Adjustment APIs return three types of information to their calling programs:

A return status Messages describing the operations performed and/or errors encountered by the APIs Other output values

1-4

Adjustment API User Notes

Solution Outline

Return Status:

The return status (p_return_status) of the API informs the caller about the result of the operation (or operations) performed by the API. The different possible values for an API return status are listed below:

Success ( FND_API. G_RET_STS_SUCCESS ) Error ( FND_API. G_RET_STS_ERROR) Unexpected error ( FND_API. G_RET_STS_UNEXP_ERROR)

Success A success return status means that the API was able to perform all the operations requested by its caller. A success return status may also be accompanied by messages in the API message list. Error An error return status means that the API failed to perform some or all of the operations requested by its caller. An error return status is usually accompanied by messages describing the error (or errors) and suggesting how to fix them. In most cases, end users can take corrective actions to fix regular expected errors like missing attributes or invalid date ranges. Unexpected error An unexpected error status means that the API has encountered an error condition it didnt expect or couldnt handle. In this case, the API is unable to continue with its regular processing. Examples of such errors are: irrecoverable data inconsistency errors, memory errors, programming errors (like attempting a division by zero), etc. In most cases, end users cant correct unexpected errors. System administrators or application developers generally must fix these errors.
Messages :

The APIs put result messages into a message list. Programs calling these APIs can then retrieve the messages from the list and process them by either issuing them, loading them in a database table or writing them to a log file. Messages are stored in an encoded format to enable the API callers to find out message names by using the standard functions provided by the message dictionary. It also allows users to store these messages in database tables and report off these tables in different languages. The API message list must be initialized every time a program calls an API. API callers have the choice of either calling the message list utility function FND_MSG_

Adjustment API

1-5

Solution Outline

PUB.Initialize or having the API initialize the message list automatically by setting the p_init_msg_list parameter to TRUE. The program calling the API can retrieve messages from the message stack using the existing FND API functions FND_MSG_PUB.Count_Msg and FND_MSG_ PUB.Get

1-6

Adjustment API User Notes

API Usage

API Usage
The following table shows Standard API parameters common to all the routines in the Adjustment API:

Parameter p_api_ version

Type IN

Data-type NUMBER

Default Required Value Yes

Description Used to compare version numbers of incoming calls to its current version number.

p_init_ msg_list

IN

VARCHAR2

FND_ API.G_ FALSE

Allows API callers to request that the API does initialization of the message list on their behalf. Used by API callers to ask the API to commit on their behalf. Not currently for use by the user. Allow this parameter to default.

p_commit

IN

VARCHAR2

FND_ API.G_ FALSE FND_ API.G_ VALID_ LEVEL_ FULL

p_ validation_ level

IN

NUMBER

p_return_ status p_msg_ count p_msg_ data

OUT

VARCHAR2

Represents the API overall return status. For possible values, 2.3 Error Handling. Number of messages in the API message list This is the message in encoded format if p_msg_ count=1

OUT OUT

NUMBER VARCHAR2

Adjustment API

1-7

API Usage

Ar_Adjust_pub.Create_Adjustment
DESCRIPTION

Use this routine to create adjustments to invoices. The API returns the Out parameter p_new_adjust_id, which represents the newly-created adjustment id. The following is a breakdown of parameters for this routine, divided according to parameter type:
Input Parameters

Standard API parameters:

Create Adjustment parameters: 6 required parameters (may vary depending on the adjustment type).
Output Parameters

Standard API parameters :

3 2

Create Adjustment parameters :

** Since the Create Adjustments API allows users to pass the adjustment record type to the procedure, it is not recommended for users to enter values for unnecessary fields. These fields could be populated for internal purpose only. The following table lists parameters that pertain specifically to the Create Adjustment routine:

Parameter p_adj_ rec.type

Type IN

Data-type VARCHAR2

Required Yes

Default Value

Description The type of adjustment to be created. Possible Values: INVOICE, LINE, TAX, FREIGHT, CHARGES Payment Schedule id of the transaction for which the transaction is to be created. If the adjustment type is any other value than INVOICE then this is a required field. The amount indicates the amount to be adjusted.

p_adj_ rec.paymen t_schedule_ id p_adj_ rec.amount

IN

NUMBER

Yes

IN

NUMBER

Yes/No

1-8

Adjustment API User Notes

API Usage

Parameter

Type

Data-type NUMBER

Required Yes/No

Default Value

Description If the adjustment type is LINE then the customer_ trx_line_id indicates the line to be adjusted. For all the other adjustment types the value is not required. The id of the activity name (from ar_receivables_trx) should be passed. The code combination id is not required. If the value is not passed then the default is the code combination id specified in the receivables_ trx_id record. If the value passed is not the same as the code_combination_id and the profile option of allow override of the default activity is set to N then this would error out. The apply date should be equal to or greater than the transaction date. The gl date should be equal to or greater than the transaction gl date, and the date should be from the open/future period. The reason code should a valid reason code in ar_ lookups with lookup_type = 'ADJUST_REASON'. The user can enter comments, upto 2000 bytes, for creating the adjustments which could be useful for the user, for future reference.

p_adj_ IN rec.custome r_trx_line_ id

p_adj_ rec.receivab les_trx_id p_adj_ rec.code_ combinatio n_id

IN

NUMBER

Yes

IN

NUMBER

No

p_adj_ rec.apply_ date p_adj_ rec.gl_date

IN

DATE

Yes

IN

DATE

Yes

p_adj_ rec.reason_ code p_adj_ rec.comme nts

IN

VARCHAR2

No.

IN

VARCHAR2

No.

Adjustment API

1-9

API Usage

Parameter p_adj_ rec.associat ed_cash_ receipt_id p_adj_ rec.ussgl_ transaction _code

Type IN

Data-type NUMBER

Required cfc

Default Value

Description The associated cash receipt id is the id of a valid cash receipt, and is to be associated with the adjustment. The USSGL transaction code should be a valid USSGL transaction code in gl_ussgl_ transaction_codes. Some value that indicates to the user that it was created through the adjustment api. Eg. ADJ-API This attribute_category and the attribute1 through attribute15 can be entered if the user want to enter the details of the descriptive flex field for the adjustment.

IN

VARCHAR2

No.

IN p_adj_ rec.created_ from p_adj_ rec.attribut e_category , p_adj_ rec.attribut e1 p_adj_ rec.attribut e15 p_adj_ rec.adjustm ent_id IN

VARCHAR2

Yes

VARCHAR2

No.

IN

No. Entered values will be overwritten No. Entered values will be overwritten . No. Entered values will be overwritten .

p_adj_ rec.acctd_ amount

IN

p_adj_ rec.gl_ posted_ date

IN

1-10

Adjustment API User Notes

API Usage

Parameter p_adj_ rec.set_of_ books_id

Type IN

Data-type

Required No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten .

Default Value

Description

p_adj_ rec.adjustm ent_type

IN

p_adj_ rec.status

IN

p_adj_ rec.line_ adjusted

IN

p_adj_ rec.freight_ adjusted

IN

p_adj_ rec.tax_ adjusted

IN

p_adj_ rec.receivab les_chages_ adjusted

IN

Adjustment API

1-11

API Usage

Parameter p_adj_ rec.batch_ id

Type IN

Data-type

Required No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten .

Default Value

Description

p_adj_ IN rec.custome r_trx_id

p_adj_ rec.subsequ ent_trx_id

IN

p_adj_ rec.chargeb ack_ customer_ trx_id p_adj_ rec.distribu tion_set_id

IN

IN

p_adj_ rec.associat ed_ application _id p_adj_ rec.automat ically_ generated

IN

IN

1-12

Adjustment API User Notes

API Usage

Parameter

Type

Data-type

Required No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten .

Default Value

Description

p_adj_ IN rec.postable

p_adj_ rec.approve d_by

IN

p_adj_ rec.adjustm ent_ nu,mber

IN

p_adj_ rec.doc_ sequence_ value

IN

p_adj_ rec.doc_ sequence_ id

IN

p_adj_ rec.posting _control_id

IN

p_adj_ IN rec.last_ updated_by

Adjustment API

1-13

API Usage

Parameter p_adj_ rec.last_ updated_ date

Type IN

Data-type

Required No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten . No. Entered values will be overwritten .

Default Value

Description

p_adj_ rec.last_ updated_ login

IN

p_adj_ IN rec.created_ by

p_adj_ rec.creation _date

IN

p_adj_ rec.progra m_ application _id p_adj_ rec.progra m_id

IN

IN

p_adj_ rec.progra m_update_ date

IN

1-14

Adjustment API User Notes

API Usage

Parameter

Type

Data-type

Required No.

Default Value

Description

p_adj_ IN rec.request_ id p_chk_ approval_ limits p_move_ deferred_ tax p_check_ amount p_new_ adjust_ number IN VARCHAR2

No.

FND_ API.G_ TRUE Y

This value can be set to F if the adjusted amount should not be validated against the users approval limit. This parameter is only used for BR. This value should never be set to F. It is used for some internal logic. If the adjustment is created successfully, then this parameter will contain the value of the new adjustment number. If the adjustment is created successfully, then this parameter will contain the value of the new adjustment id.

IN

VARCHAR2

No.

IN

VARCHAR2

No.

FND_ API.G_ TRUE

OUT

ar_ adjustment.a djustment_ number%typ e ar_ adjustment.a djustment_ id%type VARCHAR2 No NULL

p_new_ adjust_id

OUT

p_called_ from

IN

This flag is only used for BR.

NOTE: if the user passes values for any parameter not reported in the table above, those values will be ignored and will not show up in the record.

Default values for API parameters derive from the following:

Values of the other parameters in the API call Values set in the ar_system_parameters table entered through the System Options form Relevant profile option values

Depending on the users particular business needs, the minimum number of parameters that a user may need to pass to create an adjustment may vary.

Adjustment API

1-15

API Usage

Validations of the parameters passed:

All the parameters that are passed to the API are validated, and if any of the required fields are missing or invalid then the API returns an error message. A list of possible error messages appears in Appendix A.
EXAMPLE

The following is the simplest test case for creating an adjustment.


Objective:

To create an adjustment, passing the minimum number of parameters.


Entered parameters:

p_adj_rec.type = INOVICE, p_adj_rec.payment_schedule_id = 22222, p_adj_rec.receivables_trx = 15, p_adj_rec.apply_date = to_date('12-FEB-00', 'DD-MON-RR'), p_adj_rec.gl_date = to_date('12-FEB-00', 'DD-MON-RR'), p_adj_rec.created_from = ADJ-API
Call to the API:
AR_ADJUST_PUB.Create_Adjustment( p_api_name => 'AR_ADJUST_PUB', p_api_version => 1.0, p_msg_count => msg_count , p_msg_data => msg_data, p_return_status => return_status, p_adj_rec => adj_rec, p_new_adjust_number => new_adj_num, p_new_adjust_id => new_adj_id );

Result :

Creates an adjustment, passing 2 standard required parameters and 6 adjustment record related parameters.

Ar_Adjust_pub.Approve_Adjustment
DESCRIPTION Use this routine to approve an adjustment. The following is a breakdown of parameters for this routine, divided according to parameter type:

1-16

Adjustment API User Notes

API Usage

Input Parameters Standard API parameters:

Approve Adjustment parameters: 1 required parameter Output Parameters Standard API parameters:

** Although the Approve Adjustments API allows users to pass the adjustment record type to the procedure, all the values are overwritten by the values in the existing adjustment record except for the status and gl_date. The following table shows parameters that pertain specifically to the Approve Adjustment routine:
Legend

*If the values for the Required parameters are not passed in a call to this API, the call will fail. **The values for these fields will be copied from the existing values of the adjustment.

Parameter p_old_ adjust_id p_adj_ rec.type

Type IN IN

Data-type NUMBER VARCHAR2 NUMBER

Default Required Value Yes NO** NO**

Description The id of the adjustment that needs to be approved.

p_adj_ IN rec.paymen t_schedule_ id p_adj_ rec.amount IN

NUMBER NUMBER

No** No**

p_adj_ IN rec.custome r_trx_line_ id

Adjustment API

1-17

API Usage

Parameter

Type

Data-type NUMBER

Default Required Value No**

Description

p_adj_ IN rec.receivab les_trx_id p_adj_ rec.code_ combinatio n_id p_adj_ rec.apply_ date p_adj_ rec.gl_date IN

NUMBER

No**

IN

DATE

No**

IN

DATE

No

GL date of adjustment

The GL date should be entered if it is going to be different from the one in the old adjustment.

p_adj_ rec.reason_ code p_adj_ rec.comme nts p_adj_ rec.associat ed_cash_ receipt_id p_adj_ rec.ussgl_ transaction _code

IN

VARCHAR2

No**

IN

VARCHAR2

No**

IN

NUMBER

No**

IN

VARCHAR2

No**

p_adj_ IN rec.created_ from p_adj_ IN rec.attribut e_category , p_adj_ rec.attribut e1 p_adj_ rec.attribut e15

VARCHAR2

No**

VARCHAR2

No**

1-18

Adjustment API User Notes

API Usage

Parameter

Type

Data-type

Default Required Value No **

Description

p_adj_ IN rec.adjustm ent_id p_adj_ rec.acctd_ amount p_adj_ rec.gl_ posted_ date p_adj_ rec.set_of_ books_id IN

No **

IN

No **

IN

No **

IN p_adj_ rec.adjustm ent_type p_adj_ rec.status p_adj_ rec.line_ adjusted p_adj_ rec.freight_ adjusted p_adj_ rec.tax_ adjusted IN

No **

No

A if the status is null.

Possible Value: A which indicates Approval

IN

No **

IN

No **

IN

No **

p_adj_ IN rec.receivab les_chages_ adjusted p_adj_ rec.batch_ id IN

No **

No **

p_adj_ IN rec.custome r_trx_id

No **

Adjustment API

1-19

API Usage

Parameter

Type

Data-type

Default Required Value No **

Description

p_adj_ IN rec.subsequ ent_trx_id p_adj_ IN rec.chargeb ack_ customer_ trx_id IN p_adj_ rec.distribu tion_set_id p_adj_ rec.associat ed_ application _id IN

No **

No **

No **

p_adj_ IN rec.automat ically_ generated p_adj_ IN rec.postable p_adj_ IN rec.approve d_by p_adj_ IN rec.adjustm ent_ nu,mber p_adj_ rec.doc_ sequence_ value p_adj_ rec.doc_ sequence_ id IN

No **

No ** No **

No **

No **

IN

No **

1-20

Adjustment API User Notes

API Usage

Parameter

Type

Data-type

Default Required Value No **

Description

p_adj_ IN rec.posting _control_id p_adj_ IN rec.last_ updated_by p_adj_ rec.last_ updated_ date p_adj_ rec.last_ updated_ login IN

No **

No **

IN

No **

p_adj_ IN rec.created_ by p_adj_ IN rec.creation _date p_adj_ rec.progra m_ application _id p_adj_ rec.progra m_id p_adj_ rec.progra m_update_ date IN

No **

No **

No **

IN

No **

IN

No **

p_adj_ IN rec.request_ id p_chk_ approval_ limits IN VARCHAR2

No**

No**

FND_ API.G_ TRUE

This value can be set to F if the adjusted amount should not be validated against the users approval limit.

Adjustment API

1-21

API Usage

Parameter p_move_ deferred_ tax

Type IN

Data-type VARCHAR2

Default Required Value No Y

Description This flag is only used for BR

Validations of the parameters passed:

All the parameters that are passed to the API are validated, and if any of the required fields are missing or invalid then the API returns an error message. A list of possible error messages appears in Appendix A.
EXAMPLE

The following is the simplest test case for approving an adjustment.


Objective :

To approve an adjustment, passing the minimum number of parameters.


Entered parameters :

adjustment_id = 88888;
Call to the API :
AR_ADJUST_PUB.Approve_Adjustment( p_api_name => AR_ADJUST_PUB, p_api_version => 1.0, p_msg_count => msg_count , p_msg_data => msg_data, p_return_status => return_status, p_old_adjust_id => adjustment_id );

Result :

Approves an adjustment, passing 2 standard required parameters and 1 adjustment record parameter.

Ar_Adjust_pub.Modify_Adjustment
DESCRIPTION

Use this routine to update an adjustment. The attributes that can be modified are comments, gl date and status. If the status of the adjustment is already A (i.e. the adjustment has already been approved), you cannot update the adjustment. The following is a breakdown of parameters for this routine, divided according to parameter type:

1-22

Adjustment API User Notes

API Usage

Input Parameters

Standard API parameters :

Modify Adjustment parameters : 1 required parameter


Output Parameters

Standard API parameters :

Although the Modify Adjustments API allows users to pass the adjustment record type to the procedure, all of the values are overwritten by the existing adjustment record except for the status, comments and gl_date. The following table shows parameters that pertain specifically to the Modify Adjustments routine:
Legend:

*If the values for the Required parameters are not passed in a call to this API, the call itself will fail. **The values for these fields will be copied from the existing values of the adjustment.

Parameter

Type

Data-type NUMBER

Default Required Value Yes

Description The id of the adjustment that needs to be modified.

p_old_adjust_id IN

P_adj_rec.type p_adj_ rec.payment_ schedule_id p_adj_ rec.amount p_adj_ rec.customer_ trx_line_id p_adj_ rec.receivables_ trx_id

IN IN

VARCHAR2 NUMBER

NO** NO**

IN IN

NUMBER NUMBER

No** No**

IN

NUMBER

No**

p_adj_rec.code_ IN combination_id

NUMBER

No**

Adjustment API

1-23

API Usage

Parameter p_adj_ rec.apply_date p_adj_rec.gl_ date

Type IN IN

Data-type DATE DATE

Default Required Value No** No GL date of adjustment

Description

The GL date should be entered if the user wishes to modify the existing gl date of the adjustment.

P_adj_ IN rec.reason_code p_adj_ rec.comments IN

VARCHAR2 VARCHAR2

No** No The comments should be entered if the userwishes to modify the existing comments of the adjustment.

P_adj_ rec.associated_ cash_receipt_id

IN

NUMBER

No**

p_adj_rec.ussgl_ IN transaction_ code p_adj_ rec.created_ from p_adj_ rec.attribute_ category , p_ adj_ rec.attribute1 p_adj_ rec.attribute15 IN

VARCHAR2

No**

VARCHAR2

No**

IN

VARCHAR2

No**

p_adj_ IN rec.adjustment_ id p_adj_rec.acctd_ IN amount p_adj_rec.gl_ posted_date IN

No **

No ** No **

1-24

Adjustment API User Notes

API Usage

Parameter p_adj_rec.set_ of_books_id

Type IN

Data-type

Default Required Value No ** No **

Description

p_adj_ IN rec.adjustment_ type p_adj_rec.status IN

No

The status should be entered if the user wishes to change the existing status of the adjustment. Possible Value: A , R, M, W

p_adj_rec.line_ adjusted p_adj_ rec.freight_ adjusted p_adj_rec.tax_ adjusted

IN IN

No ** No **

IN

No ** No **

p_adj_ IN rec.receivables_ chages_adjusted p_adj_ rec.batch_id p_adj_ rec.customer_ trx_id IN IN

No ** No **

p_adj_ IN rec.subsequent_ trx_id p_adj_ IN rec.chargeback_ customer_trx_id p_adj_ IN rec.distribution_ set_id

No **

No **

No **

Adjustment API

1-25

API Usage

Parameter p_adj_ rec.associated_ application_id

Type IN

Data-type

Default Required Value No **

Description

p_adj_ IN rec.automaticall y_generated p_adj_ rec.postable p_adj_ rec.approved_ by IN IN

No **

No ** No **

p_adj_ IN rec.adjustment_ nu,mber p_adj_rec.doc_ sequence_value p_adj_rec.doc_ sequence_id p_adj_ rec.posting_ control_id p_adj_rec.last_ updated_by p_adj_rec.last_ updated_date p_adj_rec.last_ updated_login p_adj_ rec.created_by p_adj_ rec.creation_ date p_adj_ rec.program_ application_id IN IN IN

No **

No ** No ** No **

IN IN IN IN IN

No ** No ** No ** No ** No **

IN

No **

1-26

Adjustment API User Notes

API Usage

Parameter p_adj_ rec.program_id p_adj_ rec.program_ update_date p_adj_ rec.request_id p_chk_ approval_limits

Type IN IN

Data-type

Default Required Value No ** No **

Description

IN IN VARCHAR2

No** No** FND_ API.G_ TRUE This value can be set to F if the adjusted amount should not be validated against the users approval limit. This flag is only used for Y

p_move_ deferred_tax

IN

VARCHAR2

No

Validations of the parameters passed:

All the parameters that are passed to the API are validated, and if any of the required fields are missing or invalid then the API returns an error message. A list of possible error messages appears in Appendix A.
EXAMPLE

The following is the simplest test case for updating an adjustment.


Objective :

To update an adjustment, passing the minimum number of parameters. For this example, assume the user wants to update comments.
Entered parameters :

old_adjustment_id = 88888 adj_rec.comments = This is the new comment


Call to the API :
AR_ADJUST_PUB.Create_Adjustment( p_api_name => 'AR_ADJUST_PUB', p_api_version => 1.0, p_msg_count => msg_count , p_msg_data => msg_data, p_return_status => return_status,

Adjustment API

1-27

API Usage

p_adj_rec p_old_adjust_id

=>

=> adj_rec, old_adjustment_id );

Result :

Updates an adjustment, passing 2 standard required parameters and 1 adjustment record parameter. Users should also pass values for other parameters that the user wishes to update in the adjustment record.

Ar_Adjust_pub.Reverse_Adjustment
DESCRIPTION

Use this routine to reverse an adjustment. The following is a breakdown of parameters for this routine, divided according to parameter type:
Input Parameters

Standard API parameters :

Reverse Adjustment parameters : 1 required parameter


Output Parameters

Standard API parameters :

Reverse Adjustment parameters: 1 The following table shows parameters that pertain specifically to the Reverse Adjustment routine:

Parameter p_old_ adjust_id p_comments

Type IN

Data-type NUMBER

Requir ed Default Value Yes

Description The id of the adjustment that needs to be modified. The user can specify any comments that should appear in the reverse adjustment.

IN

VARCHAR2

No

p_reversal_ gl_date

IN

DATE

No

Old The user can enter a gl adjustments gl date if he wishes it to be date different from the old adjustments gl date.

1-28

Adjustment API User Notes

API Usage

Parameter p_reversal_ date

Type IN

Data-type DATE

Requir ed Default Value No Old adjustments date

Description The user can enter a date if he wishes it to be different from the old adjustments date.

p_new_adj_ id p_chk_ approval_ limits

OUT IN

NUMBER VARCHAR2 No FND_API.G_ TRUE This value can be set to F if the adjusted amount should not be validated against the users approval limit. This flag is only used for BR This flag is only used for BR

p_move_ deferred_tax p_called_ from

IN IN

VARCHAR2 VARCHAR2

No No

Y NULL

Validations of the parameters passed:

All the parameters that are passed to the API are validated, and if any of the required fields are missing or invalid then the API returns an error message. A list of possible error messages appears in Appendix A.
EXAMPLE

The following is the simplest test case for reversing an adjustment.


Objective :

To reverse an adjustment, passing the minimum number of parameters.


Entered parameters :

old_adjustment_id = 88888
Call to the API :
AR_ADJUST_PUB.Reverse_Adjustment( p_api_name => 'AR_ADJUST_PUB', p_api_version => 1.0, p_msg_count => msg_count , p_msg_data => msg_data, p_return_status => return_status, p_old_adjust_id => old_adjustment_id p_new_adj_id => new_adjustment_id);

Adjustment API

1-29

API Usage

Result :

Reverses an adjustment, passing 2 standard required parameters and 1 adjustment record parameter .

1-30

Adjustment API User Notes

Messages

Messages
The following table describes the possible messages returned by the Adjustment API.

Message Number 42963 42964

Message Name AR_AAPI_ADJ_ AMOUNT_ZERO AR_AAPI_ADR_ZERO_ INV

Message Description No Adjustment amount passed. Cannot adjust, because the amount due in the Payment Schedule is zero, and the type specified is INVOICE.

42965 42966

AR_AAPI_APPLYDATE_ The Apply date &APPLY_DATE is earlier than LT_TRXDATE the transaction date &TRX_DATE. AR_AAPI_DOC_SEQ_ NOT_REQD The specified document sequence : &DOCUMENT_SEQ is not required as the Unique Sequence Number profile option does not allow it. The GL date : &GL_DATE is not in an open or future enterable period.

42967 42968 42969 42970 42971 42972 42973 42974 42975

AR_AAPI_GLDATE_ INVALID_PERIOD

AR_AAPI_GLDATE_LT_ The GL date &GL_DATE is earlier than the apply APPLYDATE date &APPLY_DATE. AR_AAPI_GLDATE_LT_ The Adjustment GL date &GL_DATE is earlier TRXGLDATE than the transaction GL date &TRX_GL_DATE. AR_AAPI_INVALID_ ADJ_ID AR_AAPI_INVALID_ CCID AR_AAPI_INVALID_ CREATE_STATUS AR_AAPI_INVALID_ DESC_FLEX AR_AAPI_INVALID_ PAYSCHD AR_AAPI_INVALID_ RCVABLE_TRX_ID Invalid adjustment id :&ADJUSTMENT_ID specified. Invalid code combination id : &CCID Invalid status : &STATUS passed during creation of Adjustment Invalid Descriptive Flexfield has been provided. Invalid Payment Schedule Id : &PAYMENT_ SCHEDULE_ID Invalid receivables trx id : &RECEIVABLES_ TRX_ID

Adjustment API

1-31

Messages

Message Number 42976 42977

Message Name AR_AAPI_INVALID_ REASON_CODE AR_AAPI_INVALID_ RECEIPT_ID AR_AAPI_INVALID_ TRX_CLASS AR_AAPI_INVALID_ TYPE AR_AAPI_INVALID_ USSGL_CODE AR_AAPI_LINE_ID_ FOR_NONLINE AR_AAPI_NO_APPLY_ DATE AR_AAPI_NO_ APPROVAL_CODES AR_AAPI_NO_CCID AR_AAPI_NO_CCID_ FOR_ACTIVITY AR_AAPI_NO_ CHANGE_OR_ REVERSE AR_AAPI_NO_ CREATED_FROM AR_AAPI_NO_ CUSTOMER_ID AR_AAPI_NO_ CUSTOMER_TRX_ID AR_AAPI_NO_ CUSTOMER_TRX_ LINEID AR_AAPI_NO_GL_ DATE

Message Description The reason code &REASON_CODE is invalid. Invalid Associated Cash Receipt Id &ASSOCIATED_CASH_RECEIPT_ID has been specified. Adjustment not allowed for transactions of class : &CLASS Invalid type of adjustment : &TYPE Invalid Ussgl Transaction Code &USSGL_CODE has been specified Customer trx line id :&CUSTOMER_TRX_LINE_ ID passed for type = &TYPE Apply date has not been specified No valid approval codes exists for Adjustments in the Lookup table No valid code combinations exist for Adjustment No code combination id exists for receivables trx id :&RECEIVABLES_TRX_ID and no code combination has been specified No changes allowed for Adjustment with &STATUS status No values specified for the Created From attribute of the adjustment No customer id exists for payment schedule id : &PAYMENT_SCHEDULE_ID No customer trx id exists for payment schedule id : &PAYMENT_SCHEDULE_ID Invalid customer trx line id :&CUSTOMER_TRX_ LINE_ID passed for customer trx id : &CUSTOMER_TRX_ID GL date has not been specified

42978 42979 42980 42981 42982 42983 42984 42985

42986

42987 42988 42989 42990

42991

1-32

Adjustment API User Notes

Messages

Message Number Message Number 42992 42993 42994 42995 42996 42997

Message Name MessageName AR_AAPI_NO_OPEN_ FUTURE_PERIOD AR_AAPI_NO_ REASON_CODES AR_AAPI_NO_ RECEIVABLES_TRX AR_AAPI_NO_TYPE_ CODES AR_AAPI_NO_USSGL_ CODES AR_AAPI_OVERRIDE_ CCID_DISALLOW AR_AAPI_USSGL_ CODE_DISALLOW

Message Description Message Description No valid open or future enterable GL periods exist for the set of books id &SET_OF_BOOKS_ID No valid reason codes exist for Adjustments in the Lookup table No valid receivables activity exists for Adjustments No valid type codes exists for Adjustments in the Lookup table No valid Ussgl Codes exist for Adjustment Override Activity profile option does not allow to override the Code Combination Id provided in the Receivables Activity Ussgl Code is not allowed as the Ussgl Profile option does not allow it

42998

Adjustment API

1-33

Messages

1-34

Adjustment API User Notes

Vous aimerez peut-être aussi