Monday, April 28, 2008

Attachment Functionality in Oracle Applications

why do i need a attachment functionality?
The attachments feature enables users to link unstructured data, such as images, wordprocessing documents, spreadsheets, or text to their application data. For example,users can link images to items or video to operations as operation instructions.
Can i enable it to any form i want?
For most of the standar you can do that..i hope custom form done in standard way can also have this feauture enabled
where should i start???
Lets Define the terms first
1.Entity:An entity is an object within Oracle Applications data, such as an item, an order, or anorder line. The attachments feature must be enabled for an entity before users can link attachments to the entity.
2.Category:A document category is a label that users apply to individual attachments anddocuments. Document categories provide security by restricting the documents that canbe viewed or added via a specific form or form function.
In the below example i am tryign to enable the attachment funcionality for the USer form..I want to upload the approval copy for creating a user or attaching new responsibility
what are the steps to do that??
Step1:First Define a Entity for which you are creating the attachments.In my case it is users.
define the base table and entityid and others things


Step2:Define a category(optional).if the attachments belongs logically to different group.
In this example i am addding to the miscellenous category.

Make the assignments of the Function once you define it.
step3:Find the Form Name,Function Name and block name to which the attachment feauture need to be enabled.
Step4:Define the Attachment Function .Seelct the type either you want the attachmetn feature at form level or Function level


Press the Blocks Button. and Enter the Block name you want to enable the attachment feauture.

Press the Entities Button

Enter the entity and other settings and see what fuctionalties are required for this form.like query,insert,update and delete allowed can be done or not from this form
Enter the primary Key so that it show the document based on the primary key.

If it a common document like across users then primary key should not be given.

Press the categories button to select the caegories

Press the Assignments Button in document categories and attach the Function.

Now the attache button is enabled..press the button and upload the document..




uploading document is self explainable
for developing some complex one..read tthe application developer for more info..
more or less it depends on the entity definition and the primary key for the document..
you can have more than one primary key...just play aroud with the primary key..you will be able to get any requirement...

Sunday, April 27, 2008

How to Make a Form Query only?

Hi all,
This is one of the common requirement.They are many ways of doing this like formpersonalization ,Cutom.plland others ..the easiest way to do it is by passing the parameter QUERY_ONLY=YES..
But it doesn't gurantee all the forms will behave as expected because the form should be coded to make it work for this..not all standard forms have this..
In HRMS Forms case there is another concept called task flow by which we can make the form read only..(i will provide a article on this at some other time)..
Steps:
1.Check the form which need ot be made as query only.
2.Go to the menu to which it is attached and the get the user function name of the form
3.query the function from application developer(resp)-->application-->function

4.query the function you have to modify
5.Create a new function logically same as the old one (attach the same form)
6.Go to Form tab in the functions window.

7.Enter QUERY_ONLY="YES" in the parameters window
8.Attach the new view only function to the required menu..
Using Form Personalization:

My requrirement is to not all the users to add new responsibilities or new user with responsibilities..it is only allowed for certain people..lets see this sceniro implementation throught form personalization
1.Go to the form which needs to be personalized
2.Open the personalization screen

3.create a rule at when new form instance level


make update,delete,insert allowed property to false to the block you want to remove the funcionaltiy
4.save the record..
if you want to give access to only one user sysadmin
create one rule to remove access by making delete ,insert and update allowed false..
Create another rule at new form instance level , context-> user and sysadmin and then make insert ,delete,update allowed true..
These two rules will make that only sysadmin to attach new responsibilities..

Thursday, April 24, 2008

Special Validation type Valuesets

How do you validate the parameter value of a concurrent program submitted through SRS window?

This is one of the recent requirement i come across..after some research i came to know it can be done using special valueset.

1.create a valueset of specail validation type

2.create a validate Event.you can write the PLSQL COde to validate

FND PLSQL "declare
l_email VARCHAR2(2000) := :!VALUE;
BEGIN
IF NVL(UPPER(substr(l_email,-9,9)),'INVALID')<>'GMAIL.COM' THEN
fnd_message.set_name('FND','INVALID_EMAIL');
fnd_message.raise_error;
end if;
end;"

3.attach it to the parameter in ..you will get a warning while saving the program ..ignore it..


As far i checked it is validation only when you enter...

THis is another sample available in one of the forums..but didn't work for me..

FND PLSQL "declare
l_payroll VARCHAR2(20) := ':$FLEX$.VALSET_TST5';
l_input DATE := :!VALUE;
BEGIN
if l_payroll is null and l_input is not null then
fnd_message.set_name('XXPAY','ONLY_ENTER_DATE_WITH_PAYROLL');
fnd_message.raise_error;
end if;
end;"

Jus try to experiment around..this might meet your requirement....

Changing Oracle Applications LOGO

We got this requirement to change the logo after some little search a good article i found in metalink 468971.1 .



1. Attributes of the login page

It is possible to control the display of some attributes of the login page, for instance user name or password hints, language switchers, forgot password link, corporate policy message, etc.

For this, you need to set the profile option 'Local Login Mask' (FND_SSO_LOCAL_LOGIN_MASK) with a number being the sum of the mask values described in the table below:


Description ask value

Hint for Username (USERNAME_HINT) 01

Hint for Password (PASSWORD_HINT) 02

Cancel button (CANCEL_BUTTON) 04

Forgot Password link (FORGOT_PASSWORD_URL) 08

Registration link (REGISTER_URL) 16

Language Images (LANGUAGE_IMAGES) 32

Corporate Policy Message (SARBANES_OXLEY_TEXT) 64



For instance the value 32 (default) displays only the language icons and value 127 will show all the attributes on the page. Please see the attached screen shots as an example.

The change takes effect immediately after re-login to E-Business Suite.


2. Message texts

It is possible to modify or add text on the login page by changing the value of some messages.
The following table shows the related messages and their default value:

Description Default value
FND_SSO_WELCOME Login
FND_SSO_EBIZ_SUITE E-Business Suite
FND_SSO_COPYRIGHT_TEXT Copyright (c) 2007, Oracle. All rights reserved.
FND_SSO_SARBANES_OXLEY_TEXT Corporate Policy Message



Note that some messages can be used elsewhere that in the login page.

The 'FND_SSO_SARBANES_OXLEY_TEXT' message is only displayed when the mask
value 64 is added to the profile option 'Local Login Mask'. The text will appear at the bottom of the page. Please review Note 391826.1 if you want to add a long text.



To change the value of a message:
1. Go to "Application Developer" responsibility
2. Select "Messages" from the menu
3. Query the message name and then enter your message text in the "Current Message Text" field
4. Save changes and exit
5. Clear cache and bounce Apache to see the change

Note that these message values can be updated by a patch.


3. Corporate branding logo

The Oracle logo is displayed on various E-Business Suite pages and can be changed by setting the
'Corporate Branding Image for Oracle Applications' (FND_CORPORATE_BRANDING_IMAGE) profile option to the full path name of an image file (.gif) that contains your corporate image.

However it is not possible to use this method for AppsLocalLogin.jsp since it is hard coded with the Oracle logo image file 'FNDSSCORP.gif'.
The non supported solution consists in:


1. Go to the $OA_HTML directory
2. Backup the AppsLocalLogin.jsp file
3. Copy your own corporate branding image under $OA_MEDIA directory
4. Edit the AppsLocalLogin.jsp file :

from :
ImageBean imgBean1 = new ImageBean("/OA_MEDIA/FNDSSCORP.gif", FND_ORACLE_LOGO);

to :ImageBean imgBean1 = new ImageBean("/OA_MEDIA/", FND_ORACLE_LOGO);

5. Clear caches and bounce Apache to see the change


4. Other modifications

AppsLocalLogin.jsp being a Java Server Page you can change the HTML or Java code (for instance with JDeveloper), create you own messages in the Messages Dictionnary thru AOL responsibility, etc., if you want to add other customizations. This is considered a customization and thus not supported by Oracle. If you apply patches replacing AppsLocalLogin.jsp the file will be overwritten.

Getting Profile values at different levels

This query will give the values of the profile option set at different level..
just use the profile option name or user profile option name which you see in the front end.
to query

SELECT user_profile_option_name,SUBSTR(e.profile_option_name,1,25) PROFILE
,DECODE(a.level_id,10001,'Site',10002,'Application',10003,'Resp',10004,'User') "Level"
,DECODE(a.level_id,10001,'Site',10002,c.application_short_name,10003,b.responsibility_name,10004,d.user_name) LValue
,NVL(a.profile_option_value,'Is Null') Value
,SUBSTR(a.last_update_date,1,25) UPDATED_DATE
FROM fnd_profile_option_values a
, fnd_responsibility_tl b
, fnd_application c
,fnd_user d
, fnd_profile_options e
, fnd_profile_options_tl f
WHERE 1=1
--and e.profile_option_name IN ('FND_BRANDING_SIZE','ASO_COMP_LOGO')
and f.user_profile_option_name in ('FND: Branding Size')
AND e.profile_option_id = a.profile_option_id AND a.level_value = b.responsibility_id (+)
AND a.level_value = c.application_id (+) AND a.level_value = d.user_id (+)
and f.PROFILE_OPTION_NAME(+)=e.profile_option_name
ORDER BY e.profile_option_name;

Friday, April 18, 2008

Forms Personalization -1

What is forms Personalization?

It is new features where some of the customization can be handled easy by simply setting the rules from the front end.It is available from 11.5.10.2

Why do we need forms Personalization?

For example in scenarios like

1.Change the prompts

2.Display some custom message when certain conditions are met

3.Enable and disabling fields/buttons based on conditions

4.For Enabling special menu.(like opening another reference form from the current form)

IF both Form personalization and custom pll are done for a form which one will take effect first?

Form personalization first and then only custom pll

How to start doing it?

Open the form where you want to personalize .

Menu Navigation: Help ->Diagnostics->Custom Code -> Personalize

This should open the personalization Form.

There are two profile options which will decide whether you able to see or not

Profiles:

Utilities: Diagnostics = Yes/No
Hide Diagnostics = Yes/No


There is new option available for level to define whether the rule need to be applied at form level or function level.Because a form can be attached to multiple functions.

Insert Get Expression & Insert item value button help you in building the conditional statement , very help for non technical people.

The major thing to observe are

1.SEQ: The sequence in which the rules are executed

2.Description:Description of the Rule

3.Level -- whether it is at form level or Function level..

4.Condition –what is the event and the object where the below condition need to

be checked

5.Action-- what actions it should perform when the condition is met

6.Context -- same a profile option levels at what level the rule need to be applied

Under actions

SEQ: it gives the list of actions that need to be performed when the condition is met

Type:1.Property – used for changing the properties of field

Message –used to display message when the condition is met

Built in --used to calling some standard form and AOL functionalities

Menu -- used in case of enabling special menu’s

General & Important Observations:

All actions and rules can be enabled and disabled(using checkbox) or deleted using delete option on the tool bar

Always validate the rule after you create using validate button

Save the record before you close this personalization form

To move form personalization from one instance to other there is FNDLOAD utility available .

Check the site for FNDLOAD examples…

UNIX Commands -Basics For Me-1

i am not a expert in unix and i always maintain a list of simple commands to work in the black screens..here i am posting it for people like for easy reference...

How to convert a file from dos mode to unix??
some time shell script developed in the window environment will create some problems because of carriage returns and other thing..those can be removed using the follwoing command

dos2unix
dos2unix movepdf

How to search files in unix??

find . -name "rc.conf" -print

This command will search in the current directory and all sub directories for a file named rc.conf.

Note: The -print option will print out the path of any file that is found with that name. In general -print wil print out the path of any file that meets the find criteria

How to search for a string in a selection of files (-exec grep ...).??

find . -exec grep "murthy ganjam" '{}' \; -print

If you want to just find each file then pass it on for processing use the -q grep option.
This finds the first occurrance of the search string. It then signals success to find and find continues searching for more files.

find . -exec grep -q "murthy ganjam" '{}' \; -print
This command is very important for process a series of files that contain a specific string.
You can then process each file appropriately.

How to view Files in UNIX??
use the cat command

cat filename
The more command will pause after displaying a page of text, and you can go on to the next page of text by hitting the space bar.
You can also do a keyword search of the text by typing

/keyword
For example, if you were looking through a file using the more command, and wanted to skip to the word "drosophila" you would type

/drosophila
and the more command would search through the file until it found that word.

LISTING FILES:

ls -a list all files, including the hidden ones
ls -g list which group owns the files
ls -lag list everything
ls *.txt list only files with a .txt on the end
ls data* list only files that start with the word "data"
ls -lrt list of all the files sorted

ls -la |grep '^d' Look only for files that are directories
ls -la |grep -v '^d' Let's only look for files that are not directories

COPY COMMAND:

cp -r * /tmp you would copy everything in the directory and RECURSIVELY (-r)
everything in the subdirectories underneath that directory to the /tmp directory.

cp file1 file2 copy file1 to a file called file2

cp file1 /tmp copy file1 to the /tmp directory

cp file1 ~smith copy file1 to the home directory of "smith"

cp * /tmp copy everything in the directory to the /tmp directory

MOVE COMMAND:

mv file1 file2 rename file1 to the name file2

mv file1 /tmp move file1 to the /tmp directory

mv file1 ~smith move file1 to the home directory of "smith"

mv * /tmp move everything in the directory to the /tmp directory

mv dir2 /tmp move the directory called dir2,and everything in it, to the /tmp directory
There is no rename command in unix use this command to rename...

Remove Command:

rm * delete everything in a subdirectory

rm *.txt remove only files with a .txt on the end

rm data* remove only files that start with the word "data"

rm -r dir2 removes everything in the subdirectory "dir2"

CD Command:

cd change to your home directory

cd .. move up one level

cd ~applmgr change to the home directory of user "smith"

cd /tmp change to the /tmp subdirectory



Saturday, April 12, 2008

INTRO TO INTERFACES(For Freshers to oracle Apps)-1

Hi All,
Here i a trying to get the basics of Interfaces.I will try to post as many interfaces code available.
Even though they might not very much helpful ..but gives the direction to look into and some head start...

First before i post the interfaces codes i would like to introduce some general concepts of interfaces for freshers..

What is a interface?
In terms of oracle applications interface is a communication channel that allows the data to move in and out of the system.

How many types of interfaces are there?
1.INBOUND INTERFACES
2.OUTBOUND INTEFACES

Inbound InterFace:The one which allows data to get into oracle application from outside is called inbound interface.

OutBound Interface:The one which allows data to get data from oracle applications to other systems is called outbound interface.

What are different types of inbound interfaces available?
1.Open interfaces
2.API's(Application Program Interface)
3.EDI(Electronic Data interchange)--Mainly used for automation transactions with third party systems
4.XML GATEWAY --Mainly used for automation transactions with third party systems
5.WEBADI--Used for uploading data from excel with the scope to have some validations--mainly used for one time loading..Just like sqlloader+validation program..
5.PLSQL Packages for Reading XML Data--Use this in case of importing non stadard transactions

What are different types of outbound interfaces available?
1.Custom programs where we pull data to a csv file using UTL_FILE in the required format
2.EDI
3.XMLGATEWAY
4.PLSQL Packages for generating XML

what is the difference between OPEN INTERFACE & API's?
OPEN INTERFACE:
I dont see much difference between the open other than the way we load data.
In case of open interface the data is loaded in to open interfce table like GL_INTERFACE or Sales Order Interface(OE_ORDER_HEADERS_IFACE_ALL).
Run the interface import program.
This will validate the data and put it into oracle applications.All the invalid records are marked as Error.
One thing is there are GUI Screens available for most of these interface where you check the errror message correct it there only and resubmit the interface.
From the technical perspective there are Error tables available for each interface

API:
API's are the oracle built packages where the validation logic is wrapped inside a package and the data is passed as parameters to the API.
Most of these api's use the PLSQL tables as paremeters to take the advantage of bulk binding concepts for faster loading data.
THey will have the two OUT parameterst to throw back the error code and message in case of data validation failure
Apis' are compartively faster than open interfaces.
If a API's and open interface are available it is better to load through API's.If the records are more...



This is what i understand till date...Plz put your comment in case of i am wrong any thing more that would be helpful to make this better...

Monday, April 7, 2008

Standard Forms Customization(Part1--Custom PLL )Draft

There are different ways to handle Forms Level Customizations.
1.Using Custom.PLL
2.Using Forms Personalizations
3.Copy the Standard form Object and Change the Code

First lets see Custom.pll how to use it?


What is Custom.PLL??
The CUSTOM.pll library is a standard Oracle Forms PL/SQL library that is supplied by Oracle with the Oracle
Applications. This is Oracle’s built-in feature that allows the customer to enhance the standard functionality of the
Applications by implementing site-specific business rules. Every Oracle Forms -based eBusiness screen, and any
custom form developed using the Oracle Application development standards, will access the CUSTOM library.
This makes an ideal point of creating business rules that effect the entire organization.

Where is this located?
Custom.pll is located in $AU_TOP/resource Directory.

How to add code to this ?
open this pll using the Form builder.make changes to the program units

How to compile this PLL ?
Once you make changes you need to compile the pll.use the F60gen to compile it
f60gen module=custom.pll userid=APPS/ output_file=$AU_TOP/resource/custom.plx module_type=library batch=no compile_all=special

What are Different Triggers that is supported?

WHEN-NEW-FORM-INSTANCE – initially entering a form

WHEN-NEW-BLOCK-INSTANCE – entering a zone (or block) within a form

WHEN-NEW-ITEM-INSTANCE – moving into a new field within the form

WHEN-NEW-RECORD-INSTANCE - creating a new record

WHEN-FORM-NAVIGATE – navigating thru a form using the mouse

WHEN-VALIDATE-RECORD – saving (committing) the information to the database

EXPORT – triggered by using the Export feature Some events are field specific

ZOOM – Pre -11 feature for moving to another form and querying up specific records

Some events are form specific

SPECIALn - (where n is a number between 1 and 45) used to generate entries in the ‘Special’ menu of the
tool bar and the code is triggered by selecting a menu choices from the ‘Special’ option on the toolbar

KEY-Fn – (where n is a number between 1 and 8) triggered by pressing the corresponding function key

Some events are application specific:
Application Object Library

WHEN-LOGIN-CHANGED – when a user logs on as a different user
WHEN-RESPONSIBILITY-CHANGED – when a user changes responsibilities
WHEN-PASSWORD-CHANGED – when a user changes their password

How to make changes get affected?
Once you make the changes compile the pll and generate the PLX
Since the CUSTOM library is loaded once for a given session, a user must log out of the
application and sign-on again before any changes will become apparent.



Examples--Metalink:

1. Sample code to make all the responsibilities read only for a specific user.
BEGIN

IF event_name = 'WHEN-NEW-FORM-INSTANCE' THEN
IF FND_PROFILE.VALUE('USER_NAME')='' THEN

BEGIN
COPY('Entering app_form.query_only_mode.','global.frd_debug');
COPY('YES', 'PARAMETER.QUERY_ONLY');
APP_MENU2.SET_PROP('FILE.SAVE', ENABLED,PROPERTY_OFF);
APP_MENU2.SET_PROP('FILE.ACCEPT', ENABLED,PROPERTY_OFF);
formname := NAME_IN('system.current_form');
blockname := GET_FORM_PROPERY(formname, FIRST_BLOCK);

WHILE (blockname is not null) LOOP

IF (GET_BLOCK_PROPERTY(blockname, BASE_TABLE) is not NULL) THEN

SET_BLOCK_PROPERTY(blockname, INSERT_ALLOWED, PROPERTY_FALSE);
SET_BLOCK_PROPERTY(blockname, UPDATE_ALLOWED, PROPERTY_FALSE);
SET_BLOCK_PROPERTY(blockname, DELETE_ALLOWED, PROPERTY_FALSE);

END IF;

blockname := GET_BLOCK_PROPERTY(blockname, NEXTBLOCK);

END LOOP;


END query_only_mode;


END;

2.How does one restrict or reduce the LOV?
"The customer LOV can be overriden using the when-new-item-instance or when-new-form-instance event at the form level through CUSTOM.pll."
You will need to write custom code using that specific event in the custom.pll

Some sample code
if (event_name = 'WHEN-NEW-FORM-INSTANCE' and form_name = 'form name')then
r:=find_group('group name');
if not id_null(r) then
delete_group('group name');
end if;
v:='select colum1,column2
from table';

r:=create_group_from_query('group name',v);

set_lov_property('lov NAME',group_name,r);--lov

See that the column names should be same as the old query so that the mappings still holds good



3.How to make the attachment function in specific responsibilities to act as read-only mode so that users who log into these specific responsibilities can only view attachments, while for the rest of the responsibilities allow users to add, update and delete attachments?


// Source File Name: custom.pll
// Source File path: $AU_TOP/resource

form_name varchar2(30) := name_in('system.current_form');
block_name varchar2(30) := name_in('system.cursor_block');
begin
if (event_name = 'WHEN-NEW-FORM-INSTANCE') then
if (form_name = 'FNDATTCH') then
if (FND_GLOBAL.RESP_NAME Like '') then --
Set_item_Property( SEQ_NUM, ENABLED,PROPERTY_FALSE);
Set_item_Property( CATEGORY_DESCRIPTION, ENABLED,PROPERTY_FALSE);
Set_item_Property( DOCUMENT_DESCRIPTION, ENABLED,PROPERTY_FALSE);
Set_item_Property( DATATYPE_NAME, ENABLED,PROPERTY_FALSE);
Set_item_Property( FILE_NAME_DISPLAY, ENABLED,PROPERTY_FALSE);
end if;
end if;
end if;

4. How to make the customisation CustomPO Number not less than PO 4 digits in sales order form?

procedure event(event_name varchar2) is
form_name varchar2(30) := name_in('system.current_form');
block_name varchar2(30) := name_in('system.cursor_block');
item_name varchar2(30) := name_in('system.cursor_item');

Begin
if (form_name = 'OEXOEORD'and block_name = 'ORDER') then
if LENGTH(name_in('ORDER.CUST_PO_NUMBER')) > 3 then
fnd_message.set_name('FND','Cust PO Number should be less than 4 digits');
fnd_message.Error;
RAISE FORM_TRIGGER_FAILURE;
End if;
End if;
End Event;

UGADI-New Year


Hi All,
Today is the New Year for US.
I wish u all a happy New Year..Today is New Start Even for My blog..i see my blog getting registered in blogs.oracle.com..This give me the encouragement to do better and share more knowledge and help the technical community in a better way..
Thank you,
Murthy Ganjam.

Tuesday, April 1, 2008

XMLPUBLISHER--Template Based on Parameter

Hi All,
Today i come across a problem of selecting layout based on parameter in XML Publisher..After a bit of R&D i come up with this solutionOne way of doing it is
1.Create a plsql procedure with all the parameter of the report

2.Based on the parameter select the layout either if Else logic or some where defined in the database.

3.set the layout using this function define below submit the report concurrent request from plsql

4.This should solve the problem

Modify your PL/SQL procedure to add a line similar to xml_layout:

1. First you must declare the variable xml_layout boolean;

2. Then you must call the ADD_LAYOUT API prior to submitting your Concurrent Program.
xml_layout := FND_REQUEST.ADD_LAYOUT('FND','FNDSCURS','en','US','PDF');

req_id := FND_REQUEST.SUBMIT_REQUEST('FND','FNDSCURS','FNDSUBMIT - Active Users XML');


Just for checking whethere working properly or not..

Note: The easiest way to find out the parameters for the ADD_LAYOUT API is to run the concurrent program from standard submission then check the OPP Manager log for the parameters after a successful submission.


i.e. From $APPLCSF/$APPLLOG/FNDOPP10367.txt[5/10/05 12:08:13 PM] [10367:RT239207] Starting XML Publisher post-processing action.[5/10/05 12:08:13 PM] [10367:RT239207] Template code: FNDSCURS
Template app: FND
Language: en
Territory: US
Output type: PDF[5/10/05 12:08:14 PM] [10367:RT239207] XML Publisher post-processing action complete.[5/10/05 12:08:14 PM] [10367:RT239207] Completed post-processing actions for request 239207.


The syntax of the ADD_LAYOUT is as follows:
-- Name -- add_layout -- Purpose -- Called before submission to add layout options for request output. --
-- Arguments -- Template_APPL_Name -
Template Application Short name. --
Template_code - Template code --
Template_Language -
Template File language (iso value) --
Template_Territory - Template File Territory (iso value) --
Output Format - Output Format --
function add_layout (template_appl_name in varchar2, template_code in varchar2, template_language in varchar2, template_territory in varchar2, output_format in varchar2) return boolean;
I didn't try this solution..as dev intance is not availble some one cross check and confirm..in the mean time i will see whether it can be done with writing plsql wrapperPlz try this one set the layout in the after report trigger..hope this should avoid the wrapper