Thursday, 13 December 2018

WEB ADI Creation (using API)



1: Create a table


   Where WEB ADI will store the data. Table might be created in Custom schema.


 


2. Create a Package.


   (It has to be in APPS Schema)


   In this case XX_TRAVEL_EXPENSE_ADI_PKG package,


   procedure XX_TRAVEL_EXPENSE_PRC.


** Note XX_TRAVEL_EXPENSE_PRC parameters should start with p_


(


 


      p_company             VARCHAR2,


      p_vendor_name         VARCHAR2,


      p_invoice_num         VARCHAR2,


      p_inv_currency        VARCHAR2,


      p_invoice_date        DATE,


 


)


then only prompt will automatically appear company , vendor_name, invoice_num, inv_currency, invoice_date.


 


3. Once the database object is created,  then create integrator.


DECLARE


   ln_application_id    NUMBER;


   lc_integtr_code      VARCHAR2 (50);


   lx_interface_code    VARCHAR2 (50);


   lx_param_list_code   VARCHAR2 (50);


   ln_application_id    NUMBER;


   ln_ret       number;


 


  --Create integrator


   BEGIN


      bne_integrator_utils.create_integrator


          (p_application_id            => 20003,


           p_object_code               => 'XX_TRAVEL_INV',


           p_integrator_user_name      => 'XX Travel Invoice Upload WEB ADI',


           p_language                  => 'US',


           p_source_language           => 'US',


           p_user_id                   => -1,


           p_integrator_code           => lc_integtr_code


          );


      DBMS_OUTPUT.put_line ('lc_integtr_code =  ' || lc_integtr_code);


   END;


 


Check it once it is created


 


SELECT *


  FROM bne_integrators_b


 WHERE integrator_code LIKE 'XX_TRAVEL_INV%';


 


4. Create Interface


DECLARE


   ln_application_id    NUMBER;


   lc_integtr_code      VARCHAR2 (50);


   lx_interface_code    VARCHAR2 (50);


   lx_param_list_code   VARCHAR2 (50);


   ln_application_id    NUMBER;


   BEGIN


      bne_integrator_utils.create_interface_for_api


           (p_application_id           => 20003,


            p_object_code              => 'XX_TRAVEL_INV',


            p_integrator_code          => 'XX_TRAVEL_INV_INTG',


            p_api_package_name         => 'XX_TRAVEL_EXPENSE_ADI_PKG',


            p_api_procedure_name       => 'XX_TRAVEL_EXPENSE_PRC',


            p_interface_user_name      => 'XX Travel Invoice Upload WEB ADI',


            p_param_list_name          => 'XX Travel Invoice PL',


            p_api_type                 => 'PROCEDURE',


            p_api_return_type          => NULL,


            p_upload_type              => 2,


            p_language                 => 'US',


            p_source_lang              => 'US',


            p_user_id                  => -1,


            p_param_list_code          => lx_param_list_code,


            p_interface_code           => lx_interface_code


           );


      DBMS_OUTPUT.put_line ('lx_interface_code  =   ' || lx_interface_code);


      DBMS_OUTPUT.put_line ('lx_param_list_code =   ' || lx_param_list_code);


   --EXCEPTION


   --   WHEN OTHERS


   --   THEN


   --      DBMS_OUTPUT.put_line ('Error  =      ' || SQLERRM);


   END;


 


Check Interface


 


SELECT *


  FROM bne_interface_cols_tl


 WHERE interface_code LIKE 'XX%' ;


 


SELECT *


  FROM bne_interface_cols_vl


 WHERE interface_code LIKE 'XX%';


 


SELECT *


  FROM bne_interface_cols_b


 WHERE interface_code LIKE 'XX%'


 


 


4. Create an ADI function with following values:


 


FunctionName UserFunctionName Description         Type                  MaintainanceMode ContextDependence


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


<User defined>  <User defined> <User defined>  SSWA servlet function None   Responsibility


 


Form Application


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


Parameter


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


<none> <none>  bne:page=BneCreateDoc&bne:noreview=true&bne:integrator=20003:GENERAL%25&bne:reporting=N


 


HTML Call   Host Name


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


BneApplicationService  http://le0003.oracleads.com:80


 


 


5. Use the ORACLE WEB ADI responsibility and go to DEFINE LAYOUT option


 


  Give LAYOUT name


 From the drop down select the INTERGRATOR USER NAME as defined above and click on 'GO'


 A screen with all the procedure parameters will appear.


 Select 'LINE' as placement value for all the parameters and APPLY


 


7. Create and entry against the USER FUNCTION NAME in the menu under which ADI needs to be accessed.


ADI is ready to use.


 


 


 


Additional Steps:


Add Date LOV in the WEB ADI Column


 


 


DECLARE


   ln_application_id    NUMBER;


   lc_integtr_code      VARCHAR2 (50);


   lx_interface_code    VARCHAR2 (50);


   lx_param_list_code   VARCHAR2 (50);


   ln_application_id    NUMBER;


BEGIN


   bne_integrator_utils.create_calendar_lov


                                (p_application_id          => 20003,


                                 p_interface_code          => 'XX_TRAVEL_INV_INTF',


                                 p_interface_col_name      => 'P_INVOICE_DATE',--proc params


                                 p_window_caption          => 'Select Date',


                                 p_window_width            => 400,


                                 p_window_height           => 300,


                                 p_table_columns           => 'INVOICE_DATE',


                                 p_user_id                 => 10803


                                );


END;


 


ADD Lov in the fields,


 


DECLARE


   ln_application_id    NUMBER;


   lc_integtr_code      VARCHAR2 (50);


   lx_interface_code    VARCHAR2 (50);


   lx_param_list_code   VARCHAR2 (50);


   ln_application_id    NUMBER; 


BEGIN


   bne_integrator_utils.create_table_lov


                                (p_application_id          => 20003,


                                 p_interface_code          => 'XX_TRAVEL_INV_INTF',


                                 p_interface_col_name      => 'P_INV_CURRENCY',


                                 p_id_col                  => 'CURRENCY_CODE',


                                 p_mean_col                => 'CURRENCY_CODE',


                                 p_desc_col                => 'CURRENCY_CODE',                              


                                 p_table                   => 'GL_CURRENCIES',


                                 p_addl_w_c                => 'NVL (ENABLED_FLAG, ''N'') = ''Y''',


                                 p_window_caption          => 'Select Currency',


                                 p_window_width            => 400,


                                 p_window_height           => 300,


                                 p_table_block_size        => 10,


                                 p_table_sort_order        => 'Yes',


                                 p_user_id                 => 0


                                );


END;


 


Other usefull API:


1. Delete Integrator


DECLARE


   v_value   NUMBER;


BEGIN


   v_value :=


      bne_integrator_utils.delete_integrator (20003, 'XX_TRAVEL_INV_INTG');


   DBMS_OUTPUT.put_line (v_value);


END;


 


2. delete Interface


DECLARE


   v_value   NUMBER;


BEGIN


   v_value :=


      bne_integrator_utils.DELETE_INTERFACE (20003, 'XX_TRAVEL_INV_INTF');


   DBMS_OUTPUT.put_line (v_value);


END;


 


Change the Prompt lebel,


UPDATE bne_interface_cols_tl


      SET prompt_left = 'Company',


          prompt_above = 'Company',


          user_hint = '*List - Text'


    WHERE prompt_left = 'COMPANY'


      AND interface_code = 'XX_TRAVEL_INV_INTF'


      AND LANGUAGE = 'US';


 


 UPDATE bne_interface_cols_tl


      SET prompt_left = 'Invoice Date',


          prompt_above = 'Invoice Date',


          user_hint = '*List - Date'


    WHERE prompt_left = 'INVOICE_DATE'


      AND interface_code = 'XX_TRAVEL_INV_INTF'


      AND LANGUAGE = 'US';

Tuesday, 11 December 2018

Oracle Web ADI

Oracle WEB ADI- Oracle Web Application Desktop Integrator

Wed ADI automatically imports data into your Web ADI spreadsheets from the Oracle E-Business Suite or from a text file. Imported information can be quickly
modified in Excel, validated, and uploaded to the Oracle E-Business Suite.
This feature can be useful when migrating data from a legacy system to the Oracle E-Business Suite.
All data in the spreadsheet can be validated against Oracle E-Business Suite business rules before it is uploaded.
You can use the layout functionality to determine what fields appear in your spreadsheet, where they appear, and if they contain default values. These definitions can
be saved, reused, and modified as needed.

Concepts
Integrator – This is the definition that stores the information about the action the user wishes to perform. For example, downloading specific data to a spreadsheet for viewing or
to modify and upload back to the database. For ADE sers, this equated to the Style.
API – Application Programming Interface. This is the pl/sql interface by which data is validated and uploaded into Oracle HRMS. You would associate an api with an integrator
if it was intended to either create new data in the application or update data that had been previously downloaded. See Oracle HRMS Configuring,Reporting and System
Administration manual for a list of supported apis.
View – A view is an object by which you can query data on a table or tables. If the action you are intending to perform involves downloading data, you must associate a view
with the integrator. If you are using Create style APIs, you do not require a view. You can elect to use a seeded view, for example, PER_PEOPLE_V, to use with your integrator.
However, if the integrator is for updating data, then it is recommended that you create your own views and remember to include the OBJECT_VERSION_NUMBER, and any
other In/Out parameters used by your chosen API.
One thing to beware of is the use of Aliases in views if you are downloading from a form. For example,if you use an alias for Applicant_Name called Starter, and then use a
restrictive query in the form on Applicant Name before running the integrator in Web ADI, you will get the following error in the BNE log.
BneBaseSQL.executeBneQuery: Exception while running query. Error Code: 904, Message: ORA-00904: "APPLICANT_NAME": invalid identifier
The column APPLICANT_NAME has been overwritten by the alias in the definition loaded into the BNE tables.
Layout – This is where the user selects the columns to be displayed in the spreadsheet or Word document from the API and/or View used by the integrator. An integrator can
have more than one layout defined for it. You can choose which one to use when you create your document.
Mapping – the mapping definition links the data source to the api columns. If no view is specified against the integrator or no text file used to load data, then no mapping is
needed. When the data source is a view, the mapping is created automatically, however if a text file is being used then a mapping needs to be manually defined to associate each
column in the file (source) to the relevant api parameter (target). See example c) in section, A Step by Step Guide to Creating HRMS Integrators.


Pre-req
For Microsoft Excel 2002 or 2003:
1.From the Tools menu, select Macro, then Security, and then Security Level.
2.In the Security Level tab, select the High option.
3.In the Trusted Sources or Trusted Publishers tab, select the Trust access to Visual Basic Project option.
For Microsoft Excel 2007:
1.Choose the Microsoft Office button, and then choose Excel Options. In the Trust Center category, choose Trust Center Settings, and then the Macro Settings category.
2.Select the Disable all macros except digitally signed macros option.
3.Select the Trust access to the VBA project object model option.
Set profile option 'BNE Allow No Security Rule' to Yes at user level. The default value is No.
Add responsibilities 'Desktop Integration Manager', 'Desktop Integrator' to the current user.
Debugging
You can get a log file to help diagnose an error in Web ADI. The following profile options need to be set:
BNE: Server Log Filename: Use this profile option to change the name of the Web ADI log file on the middle tier. If this profile option is not set, bne.log is used.
BNE: Server Log Path: This profile option can be used to set the directory for the Web ADI log file on the applications server. If this profile option is not set, then the
FND_TOP/log directory is used.
BNE: Server Log Level: This profile option determines the level of detail that is recorded in the Web ADI log file. The valid values are noted below. The level of granularity and
amount of information recorded to the log file increases as you move down the list.
CRITICAL_ERROR: - Messages that are the result of a system failure. The integrity and reliability of the system is in doubt as a result of this error.
ERROR: - Messages that are the result of an unexpected error in the system. It is possible to recover from these errors; the system may still be in a usable state.
Setting the profile option to this value will include CRITICAL_ERROR messages in the log file.
WARNING: - Messages trapped by the application.These errors were handled by the application but the system administrator should be aware of them occurring.
Setting the profile option to this value will include ERROR and CRITICAL_ERROR messages as well.


INFORMATION: - Additional messaging is added to the log file that includes processing information. Setting the profile option to this value includes
CRITICAL_ERROR, WARNING, and ERROR log messages. This is the setting that is used by Web ADI if the profile option is not set at the site level.
DETAIL: - Messages that summarize what is written to the log file. Setting the profile option to this value includes CRITICAL_ERROR, WARNING, ERROR, and
INFORMATION log messages.
TRACE: - Messaging that generated detailed debugging statements. Setting the profile option to this value includes CRITICAL_ERROR, WARNING, ERROR,
INFORMATION and DETAIL log messages.

Main Tables and API
BNE_INTEGRATORS_TL
BNE_INTERFACES_TL
BNE_INTERFACE_COLS_TL
BNE_CONTENTS_TL
BNE_MAPPINGS_TL
BNE_LAYOUTS_TL
BNE_LAYOUT_COLS

API to create custom web adi programmatically..

BNE_INTEGRATOR_UTILS.CREATE_INTEGRATOR
BNE_INTEGRATOR_UTILS.CREATE_INTERFACE_FOR_API
BNE_INTEGRATOR_UTILS.CREATE_DEFAULT_LAYOUT
BNE_INTEGRATOR_UTILS.CREATE_TABLE_LOV
BNE_INTEGRATOR_UTILS.CREATE_CCID_KFF
BNE_INTEGRATOR_UTILS.CREATE_JAVA_LOV

Oracle Time and Labor Windows and their Navigation Paths

Create Applications with Special Information Types in Oracle

Task – To create a Medical Reimbursement form on SSHR screen so the employees can easily update their medical bills every month and their
manager can approve these bills and at the end of the month a process have to be run which will transfer these bills into employee’s payroll elements
so before payroll run these bill should be updated

Step 1 – Creating SIT
Login in as System Administrator -> Flexfield -> Key -> Segments
Search for Application (Human Resources) and Flexfield Title (Personal Analysis Flexfield)
Define a new row, we can call it MEDICAL_REIMBURSEMENT_KFF and the description can be Job Requests.
Next we click on "Segments" to define the form fields to be used in the application.
Field - ValueSet
=============
Employee Name LOV
Nature of Sickness LOV
Details of Sickness 30Char
Hospital Name 30Char
Date FND_STANDARD_DATE
Amount Allowed CRL_YES_NO
Amount Number
Then we save and compile.
Next, login as Global Super HRMS Manager. And look for the function "Define Special Information Type". Find the one we just created
MEDICAL_REIMBURSEMENT_KFF and check the "Enabled" and "Other" checkboxes and save.

Step 2 – Configure WorkFlow Process
Change the node attribute of HR_SIT_JSP_PRC seeded WF to Yes or Yes Dynamic
or
Copy the seeded workflow
open Workflow builder, login Open the HR item type. Under processes, find HR_SIT_JSP_PRC workflow process as a template Copy it, and paste.
When pasting, the internal name should be MEDICAL_REIMBURSEMENT_SIT_PROC_JSP_P (i.e the name of our new workflow process). The
display name can be Medical Reimbursement.
Save the workflow locally and upload it via WFLoad command

Step 3 – Define Function
After this, we go back into SysAdmin and go to Application -> Function
The function can be:
Function, User Function Name, Description
==================================
MEDICAL_REIMBURSEMENT_PROCESS., TEST Job Request Process, Special Information Types
Under the properties tab, we have:


Function, Type, Maintenance Mode, Context dependence
===========================================
MEDICAL_REIMBURSEMENT_PROCESS., SSWA jsp function , None, None
Under the Form tab we have
Parameters
==========
pAMETranType=SSHRMS&pAMEAppId=&pProcessName=
MEDICAL_REIMBURSEMENT_SIT_PROC_JSP_P&pItemType=HRSSA&pCalledFrom= MEDICAL_REIMBURSEMENT_PROCESS
&pPersonID=&pFromMenu=Y
Under the Web HTML tab, we have
HTML Call
=========
OA.jsp?akRegionCode=HR_CREATE_PROCESS_TOP_SS&akRegionApplicationId=800&OAFunc= MEDICAL_REIMBURSEMENT_PROCESS
MEDICAL_REIMBURSEMENT_SIT_PROC_JSP_P is the name of the workflow process we created earlier.
pCalledFrom and OAFunc must be the function name
save & Exit.


Step 4 – Map Function with Menu
Next is to add this function (Medical Reimbursement) to the Menu for TEST Employee Self Service.
Then we also need to open the menu "Global Self Service Functions Custom". And add our function to it as well under the function column.
Next we now navigate to our function and we have to personalize the page for it.

Step 5 – Personalize the Page
After this, we have to personalize the page:
/oracle/apps/per/selfservice/specialinformation/webui/PersonSitPG
to only show our SIT at functional level.
To do this, we will click on our new function in SSHR. But this will show all of the SIT's available which is quite a lot.
So on this page, we click on the "Personalization" link at the top.
Then from here, we find the column "Flex: Key flex for Sit" near the very bottom click the pen image to personalize the page.
Now, on the next page that shows up, find the "Segment List" column.
For this field, we enter values under the function header in the format:
STRUCTURE 1|Segment 1|Segment 2||Structure 3|Segment 7|Segment 8
So for our example we can have:
MEDICAL_REIMBURSEMENT_KFF | Employee Name | Date | Amount | Hospital Name | Details of Sickness

Step 6 – Setting up AME
The final thing to do is to setup AME rules for this workflow process:
Login as "Approvals Management Business Analyst" and create a new Rule under TEST HR
Combination, Header,
Condition - WORKFLOW_PROCESS_NAME in (HR_SIT_JSP_PRC) or (MEDICAL_REIMBURSEMENT_SIT_PROC_JSP_P) whatever you are using
Actions - Supervisory (one level up) or whatever we want it to be.

Deploy OA Framework

How to Deploy OA framework in the Instance

Deployment of OA framework consists of 5 steps.
  • Deploying Class files and VO/EO/AM xml files
  • Deploying PG/RN xml files
  • Deploying jpr files for Substitution
  • Setup AOL to access the page
  • Restart the server

Let's look at these one by one.

Deploying Class files


The files such as
  • Controllers *CO.class
  • Application modules *AM.class
  • View Objects *VOImpl.class, *VORowImpl.class, *VO.xml
  • Entity objects *EO.xml, *EOImpl.java

should be deployed in the $JAVA_TOP/<path of your file>.

For eg:
if your files path in jdeveloper is
$jdev_home/myprojects/oracle/apps/ap/setup/webui/setupCO.java
then place your class files in the following path in the instance
$JAVA_TOP/oracle/apps/ap/setup/webui/setupCO.class


Deploying Page and Region files


The Page xml files(*PG.xml) and region xml(*RN.xml) files resides in the database. So you have to import the file into the database to make it work in the instance. Oracle application provides XMLExporter/XMLImporter to export and import page files from and to the database.

Deploy the files to the Instance

java oracle.jrad.tools.xml.importer.XMLImporter /home/prasanna/pages/SetupPG.xml -username <data base user name> -password <data base password> -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host =<hostname> ) (port = <port id>)))(connect_data = (sid = <sid>)))"

This command will import the SetupPG.xml file into the database.


Extracting from instance

If you have done your personalizations in the developement instance and you want to deploy the personalizations into the production instance, then you can extract the personalization using XMLExporter command from the developement instance and Import the extracted xml file into the production instance in the same way you did for PG.xml files.

java oracle.jrad.tools.xml.exporter.XMLExporter /oracle/apps/ap/setup/webui/customizations/site/0/SetupPG -rootdir <destination path> -username <data base user name> -password <data base password> -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host =<hostname> ) (port = <port id>)))(connect_data = (sid = <sid>)))"

The above command will export the SetupPG from the data base to your file system at the destination path as XML file (SetupPG.xml)


Deploying jpr files for Substitutions, if any


If you have extended EO, VO or AM and created substitutions in your project. Then you have to deploy your .jpx file into the instance.

java oracle.jrad.tools.xml.importer.JPXImporter $AP_TOP/xxx/Setup.jpx -username <data base user name> -password <data base password> -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host =<hostname> (port = <port id>)))(connect_data = (sid = <sid>)))"


Setup AOL to access the page


In case your page is referred in existing pages of Oracle applications you can skip this step. But if you want to access the page as a new Function then follow these steps.


Create Function as
ID: XX_SETUP
Name: SETUP
Function type(HTML tab) : SSW
URL: OA.jsp?page=/oracle/apps/ap/XXX/SetupPG&parameter1=xx&parameter1=xx


Attach the function to a Menu
Attach the menu to a Responsibility

Restart the server


After deployement you cannot see the page immediately on the server instance. This is because your Pages and class files would be cached in the middle tier. So you have to bounce the apache.

$COMMON_TOP/admin/scripts/adapcctl.sh stop
$COMMON_TOP/admin/scripts/adapcctl.sh start

After this process, clear the cache from the functional administrator responsibility and this step is optional.

Some times we may need to restart the whole middle tier to see the depolyed pages in the instance.
To Restart the instance use following command

Stop the instance
cd $INST_TOP/admin/scripts
adstpall.sh apps/apps

Start the instance
adstrtal.sh apps/apps