Showing posts with label XML Publisher. Show all posts
Showing posts with label XML Publisher. Show all posts

Friday, 19 December 2014

Consult the OPP service log for details

Problem:


+------------- 1) PUBLISH -------------+
Beginning post-processing of request 30182078 on node AUOHHSKKINC03 at 14-APR-2014 09:43:43.
Post-processing of request 3440182078 failed at 14-APR-2014 09:43:43 with the error message:
One or more post-processing actions failed. Consult the OPP service log for details.
+--------------------------------------+

Solution:

Check the RTF Template, Look for each and every field which should not use <?ref:xdo0034?>. Instead it should be holding appropriate column name. 

It will work...

Thanks.

XML Bursting

Background / Business Requirement for Bursting

In Oracle Purchasing we have PO Print Report which can be used to print new or selected Purchase order. Organizations usually schedule this program on a daily basis to print new purchase orders. If we want to integrate this Oracle Report to XML/BI Publisher to create eye candy layouts and email the PO automatically to the suppliers, the common issue we face is:-
How to split the XML file created by report ? This is because report will create a single XML file consisting of the all the PO selected and if we apply the template on this XML file , it will create a single PDF file consisting of all the PO’s , and we definitely don’t want purchase orders sent to a supplier which is not related to him .If we have to send PO to individual supplier there has to be a way to parse the XML file generated from the PO Print Report.After parsing the XML file we can break the XML into smaller chunks based on the PO Number and then email the PO to respective Suppliers.


Advantages of XMLP bursting

a. No Additional Coding, just need to create XML bursting File. ( Isn't it exciting , otherwise we would have to write java program to split the XML File and then use XMLP delivery manager API to send emails .
b. Process of Creating XML data Definition and Template remains AS – IS .

Prerequisitesa. Apply patch 5968876 if not already applied
b. Verify XMLP version is 5.6.3

Steps to Verify if XMLP is indeed 5.6.3
1. adident Header $OA_JAVA/oracle/apps/xdo/common/MetaInfo.class

Below matrix shows the the version you are and the patch to be applied to come to 5.6.3

Metainfo.class


Metainfo.class
XML Publisher
PatchReference
120.6XDO 5.6.3Patch 4440000
... for the Oracle E-Business Suite 11i
115.28XDO 5.6.3 Patch 5472959 Note 422508.1
115.27XDO 5.6.2 (core) Patch 5097966 Note 367394.1
115.26XDO 5.6.1Patch 4905678 Note 357308.1
115.24XDO 5.6.0 Patch 4561451Note 337999.1
115.22XDO 5.5.0 Patch 4206181 Note 316447.1
115.21XDO 5.0.1 (core) Patch 4236958
115.19XDO 5.0.0 Patch 3822219 Note 295036.1



c. Set Temporary Directory in the XML Publisher Administrator- > Administration- > General to a directory to which you have write permission .

d. After the Patch is applied we will see a new Bursting control file button in the XML Publisher Data Definition Page
To check this, please go to Responsibility "XML Publisher Administrator", and search for any existing report, and click on Update. While updating an existing data-definition, you should see the button Bursting Control File.
Now since we have finished setting up , now we will see how to implement Bursting . The major component in this is bursting control file


What is a bursting file ?

Its an XML file which tells bursting engine


a) How to split the XML File created ?

b) How to deliver the Documents ?


Lets see a sample bursting file and its components


a) <xapi:request select> tag tells busting engine , bursting should be done at the occurrence of which tag ?
b) <xapi:delivery > tag tells bursting engine , which delivery mechanism to be used and on what condition ?

Sample bursting file


<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
<xapi:request select="/xxx_HQ_XML_POXPRPOL/LIST_G_INIT_INFO/G_INIT_INFO/LIST_G_HEADERS/G_HEADERS">
<xapi:delivery>
<xapi:email id="123" server="xxxort" port="25" from="xxp@xx.org.uk xxp@xx.org.uk" reply-to="xx@xx.org.uk xx@xx.org.uk">
<xapi:message id="123" to="${CF_VENDOR_EMAIL}" attachment="true" subject=" Purchase Order No: ${POH_PO_NUM}">
Please review the attached PO ${POH_PO_NUM}
</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document output-type="pdf" delivery="123">
<xapi:template type="rtf" location="/u0350/app/apps/UAT/xx/1.0/data/XXHPAPOPRINT.rtf">
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>

Please Note : While doing testing please change the "to address" to your email address , else it will send the documents out to that email address .

Data Definition
Create the Data Definition and Template the normal way, where the Short name of the data definition is same as the short name of concurrent program to which you are integrating XMLP.While creating Data Definition Upload you bursting XML File . If there are any parsing issues in the XML file it will give error , please correct the format of the file and try to upload again .


Template File
Create the Template and Upload your Template file



Concurrent Program Registeration
In the Concurrent Program give the Output fomat as XML and the Concurrent Program Short name should be same as the data definition name .


After Report Trigger Changes
Now the Final Step , in the After report Trigger of your .RDf add the following code to call bursting program . This will lanuch the bursting program from your report , otherwise you will have to run the Bursting program ( which is a Java Concurrent Program ) manually .


Now you are all set to do the testing , run the report , please keep in mind to change "to email address" in the bursting control file to your email id while doing the testing . you will see the PO pdf coming to the email address given in the bursting control file. 

Thursday, 18 December 2014

LookUps

Lookup is an important concept in Oracle Applications, used for providing list of values for validation and selection. It can be easily understood by following examples:

Example 1: On a form, we have a field called 'Gender'. This field's possible values can be 'Male' and 'Female'. We can create a lookup of type 'Sex' and store 'Male' and 'Female' as the lookup values. In the runtime, we can retrieve these values and show it as the list of values on the field.


Example 2: A bank provides facilities of Saving Account, Current Account and Fixed Deposit Account. We can define a lookup type called 'Account Type' and associate these account type values with this look type.
Advantage and Uses of Lookups:
Oracle Applications comes with seeded lookup types. When implementing, we can add more values to it thus extending the Oracle Application functionality without making any code changes. In the above example of bank Account type lookup, we can associate more values with the lookup type 'Account Type' when bank decides to provide additional account types.
Lookup values contain a lookup code and meaning. The meaning of the lookup code is displayed on the screen and the lookup code is stored in the database. When it is desired to change the meaning for better understanding of the user, it can be changed in the lookup type setup and the changed meaning will be displayed in all the screens wherever the lookup is being used.
Lookup type can be defined at three levels:

System: Existing lookup values cannot be modified and new values cannot be inserted. These kind of lookup types are useful when application logic and functionality depends on the existence of pre-defined lookup values.
Extensible: Existing lookup values cannot be modified. However, new lookup values can be inserted. This kind of lookup provides flexibility in extending Oracle Applications' functionality.
User: Existing lookup values can be modified and new values can be inserted. This is the most flexible lookup type.
Oracle Application comes pre-seeded with all the above kind of lookups. It is also possible to define new lookup type by the implementation team for specific extension purposes.
Lookup Components
Lookup consists of lookup type and Lookup values:

Lookup Type: This is header entity and contains name of lookup type and the Application. It also has information on the level of lookup type (System, Extensible or User).
Lookup Value: This is detail entity and child of Lookup Type entity. For a given lookup type, we can have many lookup values.
Lookup type is also associated with a View Application. Based on that, we can divide lookup types in three categories:
• Application Object Library Lookups: The lookup type where view application is 'FND' (or the view application id is 0 - which is the application ID of FND application). These lookups are accessible from Application Developer or System Administrator Responsibilities.
• Common Lookup: The lookup type where the view application is 'AU' (or the view application ID is 3 - which is the application ID of AU application). These lookups are accessible for maintenance from Application Developer responsibilities.
• Quick Code: The lookup type where the View application id is same as Application ID. Some modules like AR, AP etc. make use of Quick codes to enable the lookup value modification through the respective applications. For example, a Quick code called 'SOURCE' is used to defined AP interface source and is available only through AP responsibilities.
Lookup Screen
Navigation: Application Developer => Application => Lookups => Application Object Library
Technical Details on Lookups
Lookup consists of lookup type and Lookup values:

Lookup Type: FND_LOOKUP_TYPES, FND_LOOKUP_TYPES_TL
Lookup Values: FND_LOOKUP_VALUES
Important fields of these tables are explained below:

FND_LOOKUP_TYPES (Lookup Type Base Table)
Application_ID Application associated with the lookup type
Lookup_Type Lookup type code
Customization_Level Customization Level. Value can be E, U or S.
View_Application_ID View Application. It is automatically derived based on which screen you choose to define lookup type.
FND_LOOKUP_TYPES_TL (Lookup type Translated Table)
Lookup_Type Primary key. Same as the primary key in Base table
Language Language
Meaning Meaning in the corresponding Language
Description Description in the corresponding Language
A View FND_LOOKUP_TYPES_VL is available which is a join between FND_LOOKUP_TYPES and FND_LOOKUP_TYPES_TL tables. This view will give the records for the current language.
FND_LOOKUP_VALUES (Lookup Value table)
Lookup_Type Foreign key from FND_LOOKUP_TYPES
Language Language
Lookup_Code Lookup Code.
Meaning Meaning of Lookup Code
Description Description of Lookup Code
Start_date_Active Start date of the lookup Code
End_Date_Active End date of the Lookup Code
A view FND_LOOKUP_VALUES_VL is available which gives records from FND_LOOKUP_VALUES for the current language.
Examples
In order to select all the values for a given lookup type (Say, a lookup type having a meaning of 'Approval Priority Type'), we can use the following query:

SELECT lookup_code
FROM fnd_lookup_values_vl val, fnd_lookup_types_vl type
WHERE type.lookup_type = val.lookup_type
AND type.meaning = 'Approval Priority Type'
The above query gives the following results:
LOOKUP_CODE
------------------------------
STANDARD
URGENT
Lookup APIs
 New Lookup types and values can be created through the Screen (Using System Administrator or Application Developer responsibilities). However, sometime we need to create large number of values for a given lookup type. In that case, it is better to use Oracle's standard API, which can read from a flat file and create the lookups programmatically.  
The standard Oracle APIs that can be used for creation lookups programmatically are given below:
FND_LOOKUP_TYPES_PKG.INSERT_ROW for inserting new lookup type
FND_LOOKUP_VALUES_PKG.INSERT_ROW for inserting new lookup value
Lookups created in one instance of Oracle Applications may need migration to another instance. For example, initially we would create a new lookup type or lookup values in Development instance. These values are needed to be migrated to another instance, say test instance.
We can make use of Oracle's standard FNDLOAD tool to achieve the migration. The tool creates a data file (called .LDT file) from the source instance. This data file is then uploaded into the target instance. The usage of this tool is given below.
Suppose we have a lookup type called 'OKL_AE_LINE_TYPE'. We want to download it from development instance in a file. We can use the following command in UNIX:

$FND_TOP/bin/FNDLOAD apps/<password>@DBNAME 0 Y DOWNLOAD$FND_TOP/patch/115/import/aflvmlu.lct xxx_line_type.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME ='OKL' LOOKUP_TYPE="OKL_AE_LINE_TYPE"
The above statement invokes tool FNDLOAD using the standard lct file called 'aflvmlu.lct'. The data of the lookup 'OKL_AE_LINE_TYPE' is downloaded in the flat file 'xxx_line_type.ldt'. This lookup then can be uploaded into another instance using the following command:
$FND_TOP/bin/FNDLOAD apps/<password>@DBNAME 0 Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct xxx_line_type.ldt
For more information on FNDLOAD, please go to Chapter on FNDLOAD from the main index.

FNDLOAD

Oracle provides a generic tool called FNDLOAD, which can be used for migration of FND entities from one instance to another. For example, the lookups and responsibilities created in development instance can be downloaded in a file and then uploaded into a test or production instance. This saves lot of time in configuration and is usually preferred over recreating the data manually in all the instances.

 
In an oracle implementation, usually setups are done in a development instance which need to be migrated to test and production instance. FNDLOAD can be used to create data files from the source instance and then this data file uploaded to target instance. The data file thus downloaded can be moved from one instance to another instance as a source controlled file.
 Some of the examples of the entities which can be migrated using FNDLOAD are:
· Attachment Definition
· Concurrent Programs
· Printers and Printer Styles
· Value-Sets
· Request Groups
· Request Sets
· Form Personalization
· Lookups
· Responsibilities
· Applications
· Profile Options
· Users
· Form, Functions and Menus
· Document Sequences
· Descriptive and Key Flex Fields


How FNDLOAD works


FNDLOAD is basically a concurrent program, run from command prompt. The script can either download or upload the data depending upon the parameter passed. To download data for a particular entity, it makes use of a definition file (called .lct file). These definition files are standard files (for each standard entity) and are available in the directory, $FND_TOP/patch/115/import/. For example, to download a concurrent program, a definition file afcpprog.lct is used.

Output data file is created with an extension .ldt. This data file can then subsequently be uploaded into other environment using FNDLOAD command with upload parameter.
For example, suppose there is a concurrent program defined in development instance. We want to migrate this concurrent program from development to Test instance. The can be achieved using the following two steps:

a. Run the FNDLOAD command (in Development instance) in DOWNLOAD mode, using definition file afcpprog.lct to create a .ldt file.
b. Run the FNDLOAD command (in Test instance) in UPLOAD mode, using the data file created in step (a) above.

FNDLOAD Command

FNDLOAD is run from Unix environment. It can be run for upload or download. The syntax of upload and download are as follows:

FNDLOAD logon 0 Y mode configfile datafile [ entity [ param ... ] ]
Logon is apps user and apps password, For example apps/apps.
Mode can be DOWNLOAD or UPLOAD
Configfile is a standard .lct file which is available in $FND_TOP/patch/115/import directory.
Datafile is a .ldt file which contains the downloaded data. The name of datafile can be any user defined name; however extension should be given as .ldt.
Entity is name of the entity (explained further).
Param is Name=Value string used for parameter substitution (explained further).

Standard Configuration files
Oracle has provided standard configuration files (.lct files) for migration of the standard entities. All of these configuration files are available at $FND_TOP/patch/115/import directory. The main configuration files are given below:
EntityConfiguration File
Attachment Definitionafattach.lct
Concurrent Programsafcpprog.lct
Printers and Printer Stylesafcppstl.lct, afcpprnt.lct
Value Setsafffload.lct
Request Groupsafcpreqg.lct
Request Setsafcprset.lct
Form Personalizationaffrmcus.lct
Lookupsaflvmlu.lct
Responsibilitiesafrole.lct
Applicationsafscapp.lct
Profile Optionsafscprof.lct
Usersafscursp.lct
Form, Functions, Menusafsload.lct
Document Sequencesafsncat.lct
Descriptive and Key Flex Fieldsafffload.lct
Messagesafmdmsg.lct


Examples on Upload Download of Commonly used Entities

Concurrent Program
Download
FNDLOAD apps/<password> O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt PROGRAM APPLICATION_SHORT_NAME="<Short Application Name>" CONCURRENT_PROGRAM_NAME="<concurrent program short name>"
Upload
FNDLOAD apps/<password> 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt

Printer Styles
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcppstl.lct file_name.ldt STYLE PRINTER_STYLE_NAME="printer style name"
Lookups
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct file_name.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME="FND"
LOOKUP_TYPE="lookup name"


Descriptive Flexfield
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt DESC_FLEX P_LEVEL=’COL_ALL:REF_ALL:CTX_ONE:SEG_ALL’ APPLICATION_SHORT_NAME="FND" DESCRIPTIVE_FLEXFIELD_NAME="desc flex name" P_CONTEXT_CODE="context name"

Key Flexfield Structures
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt KEY_FLEX P_LEVEL=’COL_ALL:FQL_ALL:SQL_ALL:STR_ONE:WFP_ALL:SHA_ALL:CVR_ALL:SEG_ALL’ APPLICATION_SHORT_NAME="FND" ID_FLEX_CODE="key flex code" P_STRUCTURE_CODE="structure name"

Value Sets with values
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt VALUE_SET FLEX_VALUE_SET_NAME="value set name"
Profile Options
 FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct file_name.ldt PROFILE PROFILE_NAME="profile option" APPLICATION_SHORT_NAME="FND"
Request GroupsFNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct file_name.ldt REQUEST_GROUP REQUEST_GROUP_NAME="request group" APPLICATION_SHORT_NAME="FND"
Request Sets
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct file_name.ldt REQ_SET
APPLICATION_SHORT_NAME="FND" REQUEST_SET_NAME="request set"

ResponsibilitiesFNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct file_name.ldt FND_RESPONSIBILITY RESP_KEY="responsibility"
MenusFNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct file_name.ldt MENU MENU_NAME="menu_name"
Forms PersonalizationFNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct file_name.ldt FND_FORM_CUSTOM_RULES function_name=FUNCTION_NAME

Tuesday, 16 December 2014

Oracle APIs and Version Numbers and API Error Handling

API Error Handling:


Every API has 3 out parameters as x_return_status, x_msg_count and x_msg_data. 
Using these 3 parameters, one can use below code to log or debug error in API's
dbms_output.put_line (SubStr('x_return_status = '||x_return_status, 1, 255));
dbms_output.put_line ('x_msg_count = '||TO_CHAR(x_msg_count));
dbms_output.put_line (SubStr('x_msg_data = '||x_msg_data, 1, 255));
IF x_msg_count >1 THEN
FOR I IN 1..x_msg_count
LOOP
dbms_output.put_line(I ||'.'|| SubStr(FND_MSG_PUB.Get(p_encoded =>FND_API.G_FALSE ), 1, 255));
END LOOP;
END IF;
END;

Explain The API In R12
You can run the following script and get all the packages related to API in Oracle applications, from which you can select APIs that pertain to AP:
SQL> select substr(a.OWNER,1,20) 
, substr(a.NAME,1,30) 
, substr(a.TYPE,1,20)  
, substr(u.status,1,10) Stat 
, u.last_ddl_time 
, substr(text,1,80) Description  
from dba_source a, dba_objects u  
WHERE 2=2  
and u.object_name = a.name  
and a.text like '%Header%'  
and a.type = u.object_type  
and a.name like 'AP_%API%'  
order by  
a.owner, a.name; 

Overview - API In R12
1) The Application Programming Interface or API is a PL/SQL packaged procedure which can be used as an alternative entry point into the system to the traditional online forms
2) The advantage being that the same logic used by the seeded online forms can also be used by other interfaces into the system, thus ensuring that the integrity of the data remains intact
Calling API
1) Ensure it is appropriate to allow that particular business operation
2) Validate the data passed to the API
3) Each API has a number of parameters, most of them mapped with DB column. Every parameter name starts with p_. If the parameter maps onto a database column, the remaining part of the name is usually the same as the column name
4) When calling the APIs, it is strongly recommended that you use Named Notation, instead of Positional Notation
Private APIs
Private APIs are for internal, development use only. Details are not provided to anyone outside of the immediate development environment, nor are they intended for use by anyone outside of the e-Business Suite development environment.
Public APIs
Public APIs are designed for customers and Oracle consultants to integrate non-Oracle systems into Oracle e-Business Suite or to extend the functionality of the base products. Oracle does not support public APIs unless they are published in a reference manual such as this one. The user accepts all risk and responsibility for working with non-published public APIs.
Public, published APIs
Public Published APIs are guaranteed by Oracle to remain valid from release to release and that patches will not alter the API behavior. Public, published APIs are supported by Oracle to the same extent as released software.
For non-published APIs, Oracle expressly does not provide any guarantees regarding consistency of naming, usage, or behavior of any API (public or private) between releases. It is also possible that a patch could alter any characteristic of any non-published e-Business Suite API. As such, those who choose to use these APIs do so at their own risk. However, Oracle does attempt to minimize all changes to public APIs, even if not published.
Note: In Applications release 11.5.9, many of the Applications' PL/SQL server side APIs have been enhanced to utilize the pass by reference semantics of PL/SQL. This improves performance considerably and reduces memory consumption. In the normal processing case (i.e. success), there is no change of behavior, and callers of these APIs are not impacted. However, in the case of exceptions, there is a behavior change which results in assignments being exposed to the caller, which are made in the API prior to any exceptions being raised. The previous behavior would rollback these assignments made by the API if an exception occurred in this API. Developers writing custom extensions to Oracle Applications, or third party integrators which use the standard Applications' APIs should be aware of this change in semantics.
Each published API provides an API specification, and definitions as for its parameters, data structures, and status messages. Sample scripts and documented process flow diagrams are included where applicable.
Note: The words procedure and API are used interchangeably in this document.
API Version Numbers
Oracle APIs incorporate a mechanism called API version numbers. This mechanism:
  • Allows an API to differentiate between changes that require you to change your API calling code and those that don't.
  • Allows an API to detect incompatible calls.
  • Allows you to quickly determine if calling a new version of an API requires you to change any of your code.
  • Allows you to easily figure out which version of an API you need to call to take advantage of new features.
Format of API Version Numbers
API version numbers consist of two segments separated by a decimal point. The first segment is the major version number; the second segment is the minor version number. The starting version number for an API is always 1.0.
The following table shows an example of an API Version number and the major and minor version derived from the API version.
API Version Number
Major Version
Minor Version
1.0
1
0
2.4
2
4
If the major version number has changed, then you probably need to modify your programs that call that API. Major version changes include changes to the list of required parameters or changing the value of an API OUT parameter.
If only the minor version number has changed, then you probably do not need to modify your programs.
Current API Version Number for This Package
The API version number for the APIs included in the current version of the CZ_modelOperations_pub package is:
1.0
The local constant that stores this version number is:
l_api_version   CONSTANT NUMBER
Checking for Incompatible API Calls
To detect incompatible calls, programs calling an API must pass an API version number as one of the input parameters. The API can then compare the passed version number to its current version number, and detect any incompatible calls.
The Oracle standard parameter used by all procedures in this package to pass in the API version number is:
p_api_version IN NUMBER
This parameter is required, and has no initial values, thus forcing your program to pass this parameter when calling an API.
If your call to the API results in a version incompatibility, then an error message is inserted in the table CZ_DB_LOGS.
Parameter Specifications
The specifications for the public APIs provided by the Resource Manager define four categories of parameters:
  • Standard IN
  • Standard OUT
  • Procedure specific IN
  • Procedure specific OUT
Standard IN and OUT parameters are specified by the Oracle Applications business object API Coding Standards, and are discussed in the following sections.
Procedure specific IN and OUT parameter are related to the API being specified, and are discussed with that individual API.
Standard IN Parameters
1) p_api_version IN NUMBER  
This must match the version number of the API. An unexpected error is returned if the calling program version number is incompatible with the current API version number
2) p_init_msg_list IN VARCHAR2 
The valid values for this parameter are: 
• True = FND_API.G_TRUE 
• False = FND_API.G_FALSE 
• Default = FND_API.G_FALSE 
If set to true, then the API makes a call to fnd_msg_pub.initialize to initialize the message stack. To set to true, use the value, "T". If set to false then the calling program must initialize the message stack. This action is required to be performed only once, even in the case where more 
than one API is called. To set to false, use the value, "F".
3) p_commit IN VARCHAR2  
The valid values for this parameter are: 
• True = FND_API.G_TRUE 
• False = FND_API.G_FALSE 
• Default = FND_API.G_FALSE 
If set to true, then the API commits before returning to the calling program. To set to true, use the value, "T". If set to false, then it is the calling program’s responsibility to commit the transaction. To set to false, use the value, "F".
The following table describes standard IN parameters, which are common to all public APIs provided by Resource Manager.
Standard IN Parameters
Parameter
Data Type
Required
Description
p_api_version
NUMBER
Yes
This must match the version number of the API. An unexpected error is returned if the calling program version number is incompatible with the current API version number (provided in the documentation).
p_init_msg_list
VARCHAR2
Yes
The valid values for this parameter are:
  • True = FND_API.G_TRUE
  • False = FND_API.G_FALSE
  • Default = FND_API.G_FALSE
If set to true, then the API makes a call to fnd_msg_pub.initialize to initialize the message stack. To set to true, use the value, "T".
If set to false then the calling program must initialize the message stack. This action is required to be performed only once, even in the case where more than one API is called. To set to false, use the value, "F".
p_commit
VARCHAR2(1)
No
The valid values for this parameter are:
  • True = FND_API.G_TRUE
  • False = FND_API.G_FALSE
  • Default = FND_API.G_FALSE
If set to true, then the API commits before returning to the calling program. To set to true, use the value, "T".
If set to false, then it is the calling program's responsibility to commit the transaction. To set to false, use the value, "F".
Standard OUT Parameters
1) x_return_status OUT NOCOPY VARCHAR2 
Indicates the return status of the API. The values returned are one of the following: 
• FND_API.G_RET_STS_SUCCESS 
Success: Indicates the API call was successful 
• FND_API.G_RET_STS_ERROR 
Expected Error: There is a validation error, or missing data error. 
• FND_API.G_RET_STS_UNEXP_ERROR 
Unexpected Error: The calling program can not correct the error.
2) x_msg_count OUT NOCOPY NUMBER 
Holds the number of messages in the message list.
3) x_msg_data OUT NOCOPY VARCHAR2 
Holds the encoded message if x_msg_count is equal to one 
The following table describes standard OUT parameters, which are common to all public APIs provided by Resource Manager.
Note: All standard OUT parameters are required.
Standard OUT Parameters
Parameter
Data Type
Description
x_return_status
VARCHAR2(1)
Indicates the return status of the API. The values returned are one of the following:
  • FND_API.G_RET_STS_SUCCESS
Success: Indicates the API call was successful
  • FND_API.G_RET_STS_ERROR
Expected Error: There is a validation error, or missing data error.
  • FND_API.G_RET_STS_UNEXP_ERROR
Unexpected Error: The calling program can not correct the error.
x_msg_count
NUMBER
Holds the number of messages in the message list.
x_msg_data
VARCHAR2(2000)
Holds the encoded message if x_msg_count is equal to one.
Parameter Size
Verify the size of the column from the base table for that column when passing a parameter of a specific length. For example, if you pass a NUMBER value, first query to find the exact value to pass. An incorrect value can cause the API call to fail.
Missing Parameter Attributes
The following table describes optional IN parameters which are initialized to pre-defined values representing missing constants. These constants are defined for the common PL/SQL data types and should be used in the initialization of the API formal parameters.
Initialized IN Parameters
Parameter
Type
Initialized Value
g_miss_num
CONSTANT
NUMBER:= 9.99E125
g_miss_char
CONSTANT
VARCHAR2(1):= chr(0)
g_miss_date
CONSTANT
DATE:= TO_DATE('1','j');
These constants are defined in the package FND_API in the file fndpapis.pls. All columns in a record definition are set to the G_MISS_X constant as defined for the data type.
Parameter Validations
The following types of parameters are always validated during the API call:
  • Standard IN
  • Standard OUT
  • Mandatory procedure specific IN
  • Procedure specific OUT
Invalid Parameters
If the API encounters any invalid parameters during the API call, then one of the following actions will occur:
  • An exception is raised.
  • An error message identifying the invalid parameter is generated.
  • All API actions are cancelled.
Version Information
It is mandatory that every API call pass a version number for that API as its first parameter (p_api_version).
This version number must match the internal version number of that API. An unexpected error is returned if the calling program version number is incompatible with the current API version number.
Warning: The currently supported version at this time is 1.0. Use only this for the API version number.
In addition, the object version number must be input for all update and delete APIs.
  • If the object_version_number passed by the API matches that of the object in the database, then the update is completed.
  • If the object_version_number passed by the API does not match that of the object in the database, then an error condition is generated.
Status Messages
Every API must return one of the following states as parameter x_return_status after the API is called:
  • S (Success)
  • E (Error)
  • U (Unexpected error)
Note: It is not required that all status notifications provide a number identifier along with the message, although, in many cases, it is provided.
Each state can be associated with a status message. The following table describes each state.
Status Message and Description
Status
Description
S
Indicates that the API performed all the operations requested by its caller.
  • A success return status may or may not be accompanied by messages in the API message list.
  • Currently, the Resource Manager APIs do not provide a message for a return status of success.
E
Indicates that the API failed to perform one or more of the operations requested by its caller.
An error return status is accompanied by one or more messages describing the error.
U
Indicates that the API encountered an error condition it did not expect, or could not handle, and that it is unable to continue with its regular processing.
  • For example, certain programming errors such as attempting to divide by zero causes this error.
  • These types of errors usually cannot be corrected by the user and requires a system administrator or application developer to correct.
Warning and Information Messages
In addition to these three types of possible status messages, you can also code the following additional message types:
  • Warnings
  • Information
To create a warning message, perform the following steps:
  1. Create a global variable to be used to signal a warning condition. For example, this could be similar to the following:
G_RET_STS_WARNING := 'W'
This global variable is not part of the FND_API package.
  1. Return this value if the warning condition is encountered. For example, using the same example as in step one, set up the following code in the API to process the warning condition:
x_return_status := G_RET_STS_WARNING
This code replaces the more usual:
x_return_status := fnd_api.g_ret_sts_unexp_error for "U"
  1. If desired, perform a similar procedure to create Information messages.

How to get log messages by using fnd_msg_pub.initialize API:
FND_MSG_PUB for error logging in Oracle Applications.
Use the following snipped of code while calling any seeded API in Oracle Applications, like CRM, or Financials.
Put this block exactly under the section where you invoke the private or public API. The errors raised in the API are logged in the following API. Use this code while error logging or while debugging. Comment out the code before moving into production.
IF ( FND_MSG_PUB.Count_Msg > 0) THEN
FOR i IN 1..FND_MSG_PUB.Count_Msg    LOOP
FND_MSG_PUB.Get(p_msg_index     => i,
          p_encoded       => 'F',
          p_data          => out_message,
          p_msg_index_OUT => l_msg_index_OUT );
dbms_output.put_line('l_msg_data :' ||out_message);
END LOOP;
END IF;

FND_GLOBAL.APPS_INITIALIZE for initializing session in Oracle Applications:


FND_GLOBAL.APPS_INITIALIZE is used for initializing the session before calling any public or private API's in Oracle Ebusiness suite. Its not required for all the API's but its recommended that you set this profile before making any calls to either private or public API.
Listed below is a sample call to FND_GLOBAL.APPS_INITIALIZE function
fnd_global.APPS_INITIALIZE(user_id=>l_user_id,
                                                   resp_id=>l_resp_id,
                                                resp_appl_id=>l_resp_appl_id);
  1. l_user_id is the fnd user ID which will be utilized during the call.
  2. l_resp_id is the responsibility ID
  3. l_resp_appl_id is the responsibility application ID.
You can use either sysadmin or use some user who has all the above listed responsibilities.
For SYSADMIN, utilize the following query to get the respective values
select fnd.user_id ,
       fresp.responsibility_id,
       fresp.application_id
from   fnd_user fnd
,      fnd_responsibility_tl fresp
where  fnd.user_name = 'SYSADMIN'
and    fresp.responsibility_name = 'Order Management Super User';
Another option is Help > Diagnostics > Examine and get the values from $profile session values