Monday, October 08, 2012

Dependent Parameters in CCP using Value Set

ependent Parameters in Oracle Applications
Requirement:
Say there is a concurrent program that lets you retrieve employee details based on employee name or employee number.
The concurrent program has 3 parameters:
1.Search Criteria is a value set containing “Employee Name” and “Employee Number” as values
2.Employee Name
3.Employee Number
When the user wants to search employee based on Employee number, he selects Employee Number in the parameter “Search Criteria”.
Automatically Employee name parameter should be disabled so that user can enter only number in the parameter Employee number to search that employee.
Similarly if the users wants to to search employee based on Employee name, Employee number parameter should be disabled thus preventing the users to search based on Employee number.
clip_image002
As seen in the above screenshot, say there is a Concurrent program which has 3 parameters defined:
1. Select Parameter to Disable
2. Parameter – 1
3. Parameter – 2
And Parameter “Select Parameter to Disable” is a value set that has values –
PARAM-1, PARAM-2
The requirement here is if the user selects PARAM-1 as the value for the parameter “Select Parameter to Disable”, then the Parameter “Parameter – 1” should be disabled meaning the user should not be able to enter any information for that parameter.
If user selects PARAM-2 as the value for the parameter “Select Parameter to Disable”, then the Parameter “Parameter – 2” should be disabled.
Steps to implement the above requirement:
1. Create the below Value Sets:
I. Value Set “ERPS_SP_VS_PARA_DEMO”:
· Navigation: System Administrator responsibility>Application>Validation>Set
· Enter the details as shown in screenshot below and save your work.
clip_image004
· Navigation: System Administrator responsibility>Application>Validation>Values
· Give the name as “ERPS_SP_VS_PARA_DEMO” and click on Find.
clip_image006
· Enter Values as PARAM-1 and PARAM-2 as shown bin the below screenshot and save your work.
clip_image008
II. Value Set “ERPS_SP_VS_PAR1_DUMMY”:
· Navigation: System Administrator responsibility>Application>Validation>Set
· Enter the details as shown in screenshot below and save your work.
clip_image010
III. Value Set ERPS_SP_VS_PAR2_DUMMY
· Navigation: System Administrator responsibility>Application>Validation>Set
· Enter the details as shown in screenshot below
clip_image012
IV. Create Value Set ERPS_SP_VS_PAR1
· Navigation: System Administrator responsibility>Application>Validation>Set
· Enter the details as shown in screenshot below.
· Click “Edit Information” button.
clip_image014
· Select Event as Validate and add the below code in the Function textbox
FND PLSQL”BEGIN
IF :$FLEX$.ERPS_SP_VS_PAR1_DUMMY <> 1 THEN
NULL;
END IF;
END;

· Save your work
clip_image016
V. Create Value Set ERPS_SP_VS_PAR2
· Navigation: System Administrator responsibility>Application>Validation>Set
· Enter the details as shown in screenshot below.
· Click “Edit Information” button.
clip_image018
· Select Event as Validate and add the below code in the Function textbox
FND PLSQL”BEGIN
IF :$FLEX$.ERPS_SP_VS_PAR2_DUMMY <> 1 THEN
NULL;
END;

clip_image020
· Save your work
2. Define Executable for the concurrent program
· Navigation: System Administrator responsibility>Concurrent>Program>Executable
· Enter the details as shown in screenshot below.
· Save your work
clip_image022
3. Define the concurrent program:
· Navigation: System Administrator responsibility>Concurrent>Program>Define
· Enter the details as shown in screenshot below.
· Save your work
clip_image024
4. Define Parameters for the concurrent program:
· Click on “Parameters” button and enter the below details
A. Seq: 10
B. Parameter: Enter Parameter Num to Disable
C. Value Set: ERPS_SP_VS_PARA_DEMO
D. Prompt: Select Parameter to Disable
clip_image026
A. Seq:15
B. Parameter: Parameter – 1 Dummy
C. Value Set: ERPS_SP_VS_PAR1_DUMMY
D. Default Type: SQL Statement
E. Default Value: select 1 from Dual where :$FLEX$.ERPS_SP_VS_PARA_DEMO != ‘PARAM-1′
F. Uncheck the Display Checkbox
clip_image028
A. Seq:20
B. Parameter: Parameter – 1
C. Value Set: ERPS_SP_VS_PAR1
clip_image030
A. Seq:25
B. Parameter: Parameter – 2 Dummy
C. Value Set: ERPS_SP_VS_PAR2_DUMMY
D. Default Type: SQL Statement
E. Default Value: select 1 from Dual where :$FLEX$.ERPS_SP_VS_PARA_DEMO != ‘PARAM-2′
F. Uncheck the Display Checkbox
clip_image032
A. Seq:30
B. Parameter: Parameter – 2
C. Value Set: ERPS_SP_VS_PAR2
D. Save the work.
clip_image034
Assign this concurrent program to the desired responsibility and check the result.

FNDLOAD to transfer AOL Objects from one instance to another instance

The Generic Loader (FNDLOAD) is a concurrent program that can transfer Oracle Application entity data between database and text file. The loader reads a configuration file to determine which entity to access. In simple words FNDLOAD is used to transfer entity data from one instance/database to other. For example if you want to move a concurrent program/menu/value sets developed in DEVELOPMENT instance to PRODUCTION instance you can use this command.

Steps to Move a Concurrent program from one instance(Database) to other

  • Define your concurrent program and save it in first instance(for how to register a concurrent program click here)
  • Connect to your UNIX box on first instance and run the following command to download the .ldt file
    FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt PROGRAM APPLICATION_SHORT_NAME=”Concurrent program application short name” CONCURRENT_PROGRAM_NAME=”concurrent program short name”
  • Move the downloaded .ldf file to new instance(Use FTP)
  • Connect to your UNIX box on second instance and run the following command to upload the .ldt file
    FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt
Note: Make sure you are giving proper .lct file in the commands and don’t confuse with .lct and .ldt files

These following are the other entity data types that we can move with FNDLOAD

1 – 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”


2 – 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”


3 – Descriptive Flexfield with all of specific Contexts
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”


4 – 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”


5 – Concurrent Programs
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt PROGRAM APPLICATION_SHORT_NAME=”FND” CONCURRENT_PROGRAM_NAME=”concurrent name”


6 – Value Sets
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt VALUE_SET_VALUE FLEX_VALUE_SET_NAME=”value set name”


7 – 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”


8 – 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”


8 – Request Groups
FNDLOAD 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”


10 – 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”


11 – Responsibilities
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct file_name.ldt FND_RESPONSIBILITY RESP_KEY=”responsibility”


12 – Menus
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct file_name.ldt MENU MENU_NAME=”menu_name”


13 – Forms Personalization
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct file_name.ldt FND_FORM_CUSTOM_RULES function_name=FUNCTION_NAME


Note: UPLOAD command is same for all except replacing the .lct and passing any extra parameters if you want to pass

FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/corresponding.lct upload_file.ldt

Launch CCP from Menu

Normally we assign any concurrent program to a request group corresponding to the responsibility from which we want to run our concurrent program. What in case if user want to launch concurrent program directly from a menu.

To assign a concurrent program to a menu follow the steps

  • Create a new function of form type and name it as your concurrent program
  • In the parameter field pass a parameter Program=
  • Assign this function to a responsibility menu from which you want to run this concurrent program.
Now go to that responsibility and click on the function. It will directly launch the concurrent program.

Advantage: User can directly launch the concurrent program instead of navigating to view >> Requests >> Submit

Disadvantage: If you create a function for each concurrent program then in each responsibility you will have around 100 functions which look weird.

Oracle Attachments


About Attachments:

Attachment feature enables users to link files like images, word files, emails, e.t.c to a particular form/function/record. Once you link a file to a form in oracle it will be saved on your server so that you can retrieve it easily whenever you want it.

Supported Formats:

You can link the following types.

  • File (word, pdf, excel, images)
  • Short Text (Notes)
  • Long Text (emails and long descriptions)
  • Webpage (intranet or internet pages)
Related Tables:

  • FND_ATTACHED_DOCS_FORM_VL
  • FND_ATTACHED_DOCUMENTS
  • FND_ATTACHMENT_BLK_ENTITIES
  • FND_ATTACHMENT_BLOCKS
  • FND_ATTACHMENT_FUNCTIONS
  • FND_ATTACHMENT_REPLICATION
  • FND_DM_FOLDERATTACHMENTEXT
Enable Attachments

It can be better explained using an example so follow the below example to enable the attachment link in Payments Bank Screen from Account Payables

Form Information

Navigation: Payables Manager > Setup > Payments Banks

Short Name: APXSUMBA

Form Name: Set Up Bank Information

Block Name: BRANCHES

Primary Key: BANK_BRANCH_ID

Table Name: AP_BANK_BRANCHES

Define Entities:

Navigation: Application Developer > Responsibility > Attachments > Document Entities



Create the new record

Table: AP_BANK_BRANCHES

Entity ID: AP_BANK_BRANCHES

Entity Name: AP_BANK_BRANCHES

Prompt: Banks

Application: Payables



Close the form.

Navigation: Application Developer > Attachments > Attachment Functions



Enter the following

Type: Form

Name: APXSUMBA

User Name: Set Up Bank Information

Session Context Field:

Enabled: Check



Save.

Click on Categories and assign Miscellaneous



Save.

Close Categories Form.



Click on Blocks

Block Name: BRANCHES

Method: Allow Change

Secured By: None

Context 1: BRANCHES.BANK_NAME

Context 2: BRANCHES.BANK_BRANCH_ID



Save Now.

Click Entities

Entity: AP_BANK_BRANCHES

Display Method: Main Entity

Privileges: Always

Primary Key Fields: BRANCHES.BANK_BRANCH_ID

Save and Close.

Use Attachments:

Navigation: Payable Manager >> Setup >> Banks



Click to open



Now Query any record. If you click on attachments now it will ask you to query any record. This is because attachments are stored at record level and not at form level. Of course you can attach documents at form level also for that while defining your Block you should not give your context fields and primary key.

Press F11 and then CTL+F11



Now click on attachments ICON 



Enter Category as Miscellaneous and Data Type as Short Text. You can choose the data type as you need and finally enter some text in the yellow area.

Save and Close the Attachments Form.

Now Query the same record in Banks Screen

You should see that paper clip icon changes to 

Click on it to see your attached Text.



Note: The attachments you saved for this bank cannot be accessed when you query another bank which means all your attachments are saved at record level. You can restrict this level to form, function or record level.

DFF

Overview of Flexfields:

A flexfield is a field made up of sub–fields, or segments. There are two types of flexfields: key flexfields and descriptive flexfields.

Key Flexfields:

A Key flexfield is a field made up of segments, where each segment has both a value and a meaning, which appears on your form as a normal text field with an appropriate prompt.

One example of a key flexfield is the Accounting Flexfield. This flexfield can always be customized to have as many segments as needed like Company, Department, Cost center, Account etc.

Descriptive flexfields:

Descriptive flexfields lets you add additional fields to the form in order to track additional information needed by the business that would not be captured by the standard form. Descriptive flexfields can be context sensitive, where the information your application stores depends on other values your users enter in other parts of the form.

A descriptive flexfield appears on a form as a single–character, unnamed field enclosed in Square Brackets [ ]. Each field or segment in a descriptive flexfield has a prompt and can have a set of valid values

Descriptive Flexfield Concepts:

  • Descriptive Flexfield Segments:
Descriptive flexfields have two different types of segments, global and context–sensitive.

A global segment is a segment that always appears in the descriptive flexfield pop–up window.

A context–sensitive segment is a segment that may or may not appear depending upon what other information is present in your form.

A descriptive flexfield can get context information from either a field somewhere on the form, or from a special field (a context field) inside the descriptive flexfield pop–up window. If the descriptive flexfield derives the context information from a form field (either displayed or hidden from users), that field is called a reference field for the descriptive flexfield.

  • How and where are the segment information is stored:
A descriptive flexfield uses columns that are added on to a database table. A descriptive flexfield requires one column for each possible segment and one additional column in which to store structure information (that is, the context value). The descriptive flexfield columns are usually named ATTRIBUTEn where n is a number.

For example, if you have a descriptive flexfield on an Order Entry (Header) form, it populates the Structure column with the context field and the columns ATTRIBUTEn with the flexfield segments of the table OE_ORDER_HEADERS_ALL.

Example of enabling DFF:

Goal: Enable DFF in Sales Order form in Order Management


Navigation: Go to “Order management super User, Vision Operationsresponsibility

Orders, Returns >> Sales Orders





Enable the DFF at right bottom screen.

To know the name of the DFF in a particular form do the following

Navigation: Help Menu >> Diagnostics >> Examine

Select Block Name as $DESCRIPTIVE_FLEXFIELD$

Field as ORDER.DF

Value will be populated and it will be the title of your DFF.

Title: Additional Header Information (Order Management)

Order management in the brackets represent the Application in which this DFF is registered.



To enable this

Navigation: Go to Application Developer >> Flexfield >> Descriptive >> Segments





Query the DFF

Press F11 and enter

Title: Additional Header Information

Application: Order Management



Press CTL + F11 to query the record



Click on Segments

Enter the following information

Number: 5

Name: Erp Schools Demo

Window Prompt: Erp Schools Demo

Column: ATTRIBUTE11

Save the record (CTL + S)



Press OK

You can assign any value set if you want, its optional so I am just leaving it as blank

Now check the “Freeze Flexfield Definition” Checkbox



Press OK

Now Click Compile button



Press OK



You will see the confirmation as shown above.

Now to go to Order management super User, Vision Operations” and open the Sales order Form and click on DFF box.



You can hide the context field by un checking the Displayed Check Box in Context Field



To Make any changes you have to uncheck the “Freeze Flexfield Definition” Checkbox



Press OK

Now uncheck the Displayed Box in Context Field area as shown



Save your Record

Check the “Freeze Flexfield Definition” Checkbox



Press OK

Press Compile Button



Press OK



“Flexfield View Generator” concurrent program will be submitted. To see the status of the program go to View Menu on top >> Requests >> Find



Once you see the status as completed you can go to Order Management and check for your changes



Now you should be able to hide the Context.