March 6, 2010

HRMS API

Using API For inbound:

****************Points To Note*********************
Hr_assignment_api

In Parameters: p_assignment_id,p_effective_date
Required Parameters:
P_Validate: Boolean-> If remains true then data base value will not be changed,If false then assignment is updated.Default value is false.
P_Effective_Date->in Param
P_DateTrack_Update_mode->Correction or Update,In Param
P_Object_Version_Number->In,Out,Copy Param.Remains 1 for new assignment,gets increamented by one to each update.
P_Assignment_Status_type_id->in
P_Change_Reason->Explicitly set to null if no change needed.

************************************************
To change the status of a employee.the status should be active before modifying.


Change the status to suspend and run this script.

Now again status will be changed to active.

Pkg used is hr_assignment_api.activate_emp_asg

Base tables : per_assignments_f

declare

l_object_version_number number:=7;

l_effective_start_date date;

l_effective_end_date date;

begin

hr_assignment_api.activate_emp_asg

(p_validate =>false

,p_effective_date =>'1-JAN-2009'

,p_datetrack_update_mode =>'CORRECTION'

,p_assignment_id =>12854

,p_change_reason =>hr_api.g_varchar2

,p_object_version_number =>l_object_version_number

,p_assignment_status_type_id =>hr_api.g_number

,p_effective_start_date =>l_effective_start_date

,p_effective_end_date =>l_effective_end_date

);

dbms_output.put_line('Object Version Number ' l_object_version_number);

commit;

end;

/

To activate for contract employees

Create a contract employee first.

declare

l_object_version_number number:=5;

l_effective_start_date date;

l_effective_end_date date;

begin

hr_assignment_api.activate_cwk_asg

(p_validate =>false

,p_effective_date =>'1-JAN-2009'

,p_datetrack_update_mode =>'CORRECTION'

,p_assignment_id =>12894

,p_change_reason =>hr_api.g_varchar2

,p_object_version_number =>l_object_version_number

,p_assignment_status_type_id =>hr_api.g_number

,p_effective_start_date =>l_effective_start_date

,p_effective_end_date =>l_effective_end_date

);

dbms_output.put_line('Object Version Number ' l_object_version_number);

commit;

end;

/

Inbound Interface

1. Create a flat file using OUTBOUND or manually. (‘txt’ or ‘dat’ file)


(E:\vbbk\emp.txt)

SMITH$7369$800


ALLEN$7499$1600

WARD$7521$1250

JONES$7566$2975

MARTIN$7654$1250

BLAKE$7698$2850

CLARK$7782$2450

SCOTT$7788$3000

KING$7839$5000

TURNER$7844$1500

ADAMS$7876$1100

JAMES$7900$950

FORD$7902$3000

MILLER$7934$1300

KAARTHIK$$5565

$000$1515

RAMU$5454$

2. Create a staging table with




CREATE TABLE MY_EMP_STAG(ENAME VARCHAR2(10),EMPNO NUMBER(4),SAL NUMBER(7,2),FLAG VARCHAR2(2));



3. Create control file

(E:\vbbk\myin.ctl)



LOAD DATA

INFILE 'E:\VBBK\EMP.TXT'

INTO TABLE "MY_EMP_STAG"

INSERT

FIELDS TERMINATED BY '$'

TRAILING NULLCOLS

(ENAME,EMPNO,SAL)



4. Run SQLLDR to load the data into the table



D:\oracle\prodora\8.0.6\BIN>SQLLDR scott/tiger@prod control='e:\vbbk\myin.ctl'

SQL*Loader: Release 9.2.0.6.0 - Production on Sat Nov 24 11:44:58 2007

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Commit point reached - logical record count 17

D:\oracle\prodora\8.0.6\BIN>


5. Check the table

select * from my_emp_stag


6. To validate the table create a procedure

(EMP_VALIDATE)



CREATE OR REPLACE PROCEDURE EMP_VALIDATE IS

CURSOR MYCUR IS SELECT * FROM MY_EMP_STAG FOR UPDATE OF FLAG;

MYREC MYCUR%ROWTYPE;

BEGIN

FOR MYREC IN MYCUR LOOP

IF MYREC.ENAME IS NULL OR MYREC.EMPNO IS NULL OR MYREC.SAL IS NULL THEN

UPDATE MY_EMP_STAG SET FLAG='N' WHERE CURRENT OF MYCUR;

ELSE

UPDATE MY_EMP_STAG SET FLAG='Y' WHERE CURRENT OF MYCUR;

END IF;

END LOOP;

END;

7. Run the validation program

BEGIN

EMP_VALIDATE;

END;

8. Check the table

select * from my_emp_stag

Outbound Interface

Outbound Interface process:

Outbound Interface will be used to extract the data from oracle Database tables into the flat files.

Inbound Interface will be used to upload the data from legacy system (Flat files) into Oracle Applications base tables.

While developing the outbound Interface we will use UTL_File to Extract the data.

While Developing the Inbound interface we will use SQL * loader to import the data into base tables.


UTL_FILE Package :
==================

this is One of the PL/SQL Package which will be used to transfer the data from table to files from files to tables
But when we are working for file to table we will use SQl *Loader to transfer from table to file we have no alternative we have to use UTL_FILE.

We will use following three functions to generate the file.

1)Utl_File.fopen = To open (or) Create the file

2)Utl_File.Put_line = To Transfer the data into the File.

3)Utl_File.fclose = To close the File after Data transfer.

outbound Interface Process:
=============================

1)Develop the PL/SQL Program (Either Procedure or Package)

2)Write the Cursor to retrieve the data from database tables.

3)Create file or Open the File by using UTL_File.fopen().

4)Open the Cursor

5)If any validations are there write the validations

6)Transfer the Data into File by using UTL_File.Put_Line().

7)Close the Cursor.

8)Close the File by using UTL_File.fclose();

9)Register the Procedure or Package as Concurrent Program and submit from SRS Window.

Discoverer

Steps for Creating a Workbook and Graph In Discoverer




• Connect to administrator Edition with APPS/APPS@PROD

• Select Create a new Business Area From Load Wizard.

• Click on the On-Line Dictionary (By Default), Click Next

• Select the Database Link

• Select the user from the list. Ex. APPS

• Click on Next Button

• In the Available list of APPS all the tables and views will be displayed Select the corresponding table/view on which workbook has to be created.

• Select the table and move it to Selected List

• Click Next Button

• The following screen will be displayed


Select the Options as given in the screen.


• Click Next

• Give the name to business area and Also a Meaningful Description

• Click on Finish Button

• Select the Tool -> Security

• Select the Business Area which has been created


• Move the Available Users/roles to Selected User/roles

• Click on the User -> Business Area

• Select User/role – APPS





• Select the Business Area – REGION and Click on the Allow Administration Check box.


• Click on Apply

• Click OK Button

• Click on Tools -> Privileges

• In the Privileges table give the Appropriate privileges for the user like Create/Edit business Area, Format Business Area Etc.


• Click on Apply Button

• Click OK Button

Connect to Discover Desktop Edition – APPS/APPS@PROD




• Once connected to Discoverer Desktop Workbook Wizard will be opened

• Select Create a new workbook Option

• Select Table

• Click on Next

• Select the Business area (REGION) which has been created in Admin Edition



• Select the XX_COUNTRY


• Select the Columns which You want to display in workbook

• Move it to Selected List.

• Click Next

• Click on the Show Page Items Checkbox

• Drag the Region CD and move it to page items

• Click on the Hide Duplicate Check box also

• Click on the Next

• If any condition need to be specified can be specified in workbook wizard Step 4

• Click Next

• In Workbook wizard of step 5 Sorting Order can be specified

• Click Next

• In Workbook wizard of step 6 calculation like Totals, % Etc can be specified

• Click on Finish

• Workbook will be created

• Now Click on the graph

• Select the Type of the graph

• Click on the Next

• Click on Finish

• Graph will be created.

• Save the workbook in the database.

• In File ->Manage Workbooks giving sharing to users, so that they can access the workbook.

• For Connecting to Oracle Applications the following steps has to be done.

• In Administration Select Tools – Options





Select the 3 Option Button and specify the gateway/Password, FNDNAM


• Now connect with Oracle Application User Id Preceded with : for example 100875:

• Click on Oracle Application User Check box

• Once we click on the connect Responsibility Pop-Up window will be Populated will all the responsibilities will be displayed.

• Select One responsibility and press ok






The Process for Creating the Business Area and Workbook remains the same. In oracle Application the DBA has to give access to all the business areas then only user will be able to access the business areas.

In the Security also user can give access to Application Users and responsibility for accessing the business areas.

The Steps for Calling the Oracle Discover workbook and Graph in Oracle Applications

• Create a function as specified in the tab


In Tab of Properties select Type as SSWA PL/SQL Function

In the Form Tab Give the workbook Name which you have created. Give the name as specified in the Discoverer workbook. In Discover Desktop Edition select manage workbook and click on Properties. In that identifier name will be there. It should be same what we specify in the parameters workbook = ‘ASSET’

In HTML Call give the values as OracleOASIS.RunDiscoverer




• Save the function

• Create a Menu and attach the Function

• Assign this menu to Responsibility.

• Assign the responsibility to User.

• Log in with the user and select the responsibility




• In This Menu Graph will invoke the discoverer workbook and graph.

• Select the menu entry for discoverer. Which will invoke the Discoverer workbook and graph will be displayed on the browser.

Valuesets

What is $FLEX$ and $PROFILES$?


$FLEX$ and $PROFILES$ are Special Variables in oracle Apps environment and are used to hold values at runtime.

Every Oracle Apps technical consultant will be familiar with the term $FLEX$ and $PROFILES$.
 
To segregate this based on the functionality


$FLEX$: Used for basing the value of a parameter on another parameter.

$PROFILES$: used for fetching the data stored in the specified profile option value which is currently active.

Syntax:


:$FLEX$.previous_value_set_name

Important:

 $FLEX$ must always be in capitals.

 A ‘:’ must precede the declaration of $FLEX$.

 The previous value set name must have already been assigned and saved on a different parameter.

$PROFILES$.Profile_option_name

Important:

 $PROFILES$ must be always in capitals.

 ‘:’ must always precede the declaration.

 Profile option name is the Profile Name and not to be confused with the User profile Name.

XML Publisher

Oracle XML Publisher is a template-based publishing solution delivered with the Oracle E- Business Suite. XML Publisher is a tool which enables the users to produce


Flexible

High Quality

Template-Based Reports

The main feature of XML Publisher is that it separates the Data Source from the presentation/Layout

Steps To Create:
 
1. CREATING AN ORDINARY XML REPORT
Create a Report using a Query in .rdf format.


STEP1: Open the Report Builder and Select the option to build the report manually.

The Query used is to bring the items created after 01-Jan-2008



SELECT inventory_item_id, segment1, description, creation_date

FROM mtl_system_items_b

WHERE creation_date > TO_DATE ('01-JAN-2008') AND organization_id = 204



Connect as apps/apps@prod

Create the Layout. [Actually, there is no need to create layout for XML report. Here, we have created it for demo purpose.]

The Output will be like this.


Save this Report in the Inventory Top.

oracle\prodappl\inv\11.5.0\reports\US\xinv.RDF


STEP2: Generate XML File


Save it.
This is the XML coding for the RDF File.

STEP 3: CREATE XML TEMPLATE


Now, we have to create a template for Output. For this open Microsoft word.



If XML was installed in Your system, You can see this

Now Load the XML data

Select the XML saved Data

Create the Template.
Here, we are inserting all those fields. So, Select All Fields.


You will get the layout as Follows



This is the Template, we have created. Save this as rtf file [Rich Text Format].

STEP4: REGISTER THE REPORT IN APPS




Open the Application.

Goto System Administrator Responsibility. Create the Executable

Save it. Create the Concurrent Program


Save it.
Add it to request group and submit the request
Out put wil be in XML form that it is not that we need.

STEP5 : ATTACHING THE TEMPLATE


Now GO to XML Publisher Administrator responsibility


Creating the Data Denition

When you create the data definition, you register the source of the data that will be merged with your template layout to create your published report.



We have to create the Data Definition Now.

By Default, it will be in the query mode. So Click CREATE DDF

One Important thing here is, Give the Code name same as the Conc Prgm Short Name in caps. Else it will not give the result.


If you are using the Oracle Applications concurrent manager to generate your report, the data definition Code must match the concurrent program short name of the report program (for example, RAXCUS for the Customer Listing Summary). This enables the concurrent manager to locate the templates available for the report concurrent program when you submit the request.

After the data definition is created, all the fields are updateable except Application and Code





Creating the Template

When you create a template, you assign it a data definition and upload your template layout files. Assigning the data definition makes the template available to the corresponding data source at runtime.



Now Attach the Template,


After the template definition is created, the following fields are not updateable: Application, Code, and Type




Now, you Run the Report in the Inventory Responsibility

If You see the output, it will come in the Format we have give. Here we have given as PDF

March 5, 2010

FNDLOAD

The loader syntax is as follows:


we have set environmental variable first

from admin folder run fndload. run envinomental variable from appl_top path  . ./*.env

To download rules for a particular function:

FNDLOAD apps/apps@DEV07 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct filename.ldt PROGRAM APPLICATION_SHORT_NAME=ar CONCURRENT_PROGRAM_NAME=XXAR_INVOICE
FNDLOAD / 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct
FND_FORM_CUSTOM_RULES function_name=

Note: this style is not recommended, as the personalizations that affect a particular
function can now be a mix of function- and form-level rules.

To download rules for a particular form:

FNDLOAD / 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct
FND_FORM_CUSTOM_RULES form_name=
To download all personalizations (all forms and functions):

FNDLOAD / 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct
FND_FORM_CUSTOM_RULES

Upload:
FNDLOAD / 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct

************************************

FNDLOAD is stored in the path in the name of FNDLOAD.exe

Path: D:\oracle\prodappl\fnd\11.5.0\bin

Step: 1 Download the concurrent program in the local directory as .ldt file
To download concurrent program as .ldt file, you need afcpprog.lct (script file), which is in the path

Path: D:\oracle\prodappl\fnd\11.5.0\patch\115\import
Note: You have execute script, request set script etc., in that path.
This script file afcpprog.lct converts concurrent program to .ldt file.

Open Command Prompt:

Enter: D:\>cd oracle\prodappl\fnd\11.5.0\bin

Enter: D:\oracle\prodappl\fnd\11.5.0\bin>fndload

You have not provided the required arguments for this program.
Usage: FNDLOAD logon 0 Y mode configfile datafile [ entity [ param ... ] ]

Where
logon is username/password[@connect]

mode is either UPLOAD or DOWNLOAD

configfile is the configuration file,datafile is the data file entity is an entity name, or - to specify all values in an upload param is a NAME=VALUE string used for parameter substitution

Enter: D:\oracle\prodappl\fnd\11.5.0\bin>fndload apps/apps@prod 0 Y DOWNLOAD d:\oracle

\prodappl\fnd\11.5.0\patch\115\import\afcpprog.lct d:\tabular.ldt PROGRAM APPLICATION_SHORT_NAME="SQLAP" CONCURRENT_PROGRAM_NAME="TABULAR.PRG"

Log filename : L2770578.log
Report filename : O2770578.out

/*Copy the log filename after ‘type’ to see the download details */

Enter: D:\oracle\prodappl\fnd\11.5.0\bin>type L2770578.log

*********************************************************


D:\oracle\prodappl\fnd\11.5.0\bin>

Step: 2 Upload the concurrent program to other system.

Copy the .ldt code file and .rdf file to this system, here c:\tabular.ldt and D:\oracle\prodappl\ap\11.5.0\reports\US\ tabular.rdf

D:\>cd oracle\prodappl\fnd\11.5.0\bin
Enter: D:\oracle\prodappl\fnd\11.5.0\bin>fndload apps/apps@prod 0 Y UPLOAD d:\oracle\prodappl\
fnd\11.5.0\patch\115\import\afcpprog.lct c:\tabular.ldt

Log filename : L2753688.log
Report filename : O2753688.out

Enter: D:\oracle\prodappl\fnd\11.5.0\bin>type L2753688.log

***************************************



Uploading from the data file c:\tabular.ldt

Altering database NLS_LANGUAGE environment to AMERICAN
Dump from LCT/LDT files (d:\oracle\prodappl\fnd\11.5.0\patch\115\import\afcpprog.lct(115.39), c:\tabular.ldt) to stage tables
Dump LCT file d:\oracle\prodappl\fnd\11.5.0\patch\115\import\afcpprog.lct(115.39) into FND_SEED_STAGE_CONFIG
Dump LDT file c:\tabular.ldt into FND_SEED_STAGE_ENTITY
No data found for upload ------> /*if error this message will be shown*/

*********************************************

Enter: D:\oracle\prodappl\fnd\11.5.0\bin>fndload apps/apps@prod 0 Y UPLOAD d:\oracle\prodappl\ fnd\11.5.0\patch\115\import\afcpprog.lct c:\jb.ldt

Log filename : L2753692.log
Report filename : O2753692.out



Enter: D:\oracle\prodappl\fnd\11.5.0\bin>type L2753692.log

***************************************

Uploading from the data file c:\jb.ldt
Altering database NLS_LANGUAGE environment to AMERICAN
Dump from LCT/LDT files (d:\oracle\prodappl\fnd\11.5.0\patch\115\import\afcpprog.lct(115.39), c:\jb.ldt) to stage tables
Dump LCT file d:\oracle\prodappl\fnd\11.5.0\patch\115\import\afcpprog.lct(115.39

) into FND_SEED_STAGE_CONFIG
Dump LDT file c:\jb.ldt into FND_SEED_STAGE_ENTITY
Dumped the batch (EXECUTABLE SAMPLE1 SQLAP , PROGRAM JB_SAMPLE1_PRG SQLAP ) into
FND_SEED_STAGE_ENTITY
Upload from stage tables ------->/* if it is correct*/

+---------------------------------------------------------------------------+

Concurrent request completed successfully
Current system time is 29-MAR-2008 16:52:39

+---------------------------------------------------------------------------+



D:\oracle\prodappl\fnd\11.5.0\bin>

COALESCE-SQL

Coalesce- return the null values from the expression. It works similar to a case statement where if expression 1 is false then goes to expr...