Showing posts with label OAF. Show all posts
Showing posts with label OAF. Show all posts

Friday, September 04, 2020

DBC file path for J Developer

In the previous version of EBS (11.1....) , DBC file used to store in $FND_TOP/secure path under

"apps/apps_st/appl/fnd/12.0.0/secure."


Whereas in R12 version , location of DBC file changed to $FND_SECURE, this can be found under

"/appsDEV/inst/apps/DEV_rdcdxerpap01/appl/fnd/12.0.0/secure" Location

Thursday, September 26, 2019

OAF Page Deployment in EBS R12 Server



OAF Page Deployment in R12

File deployment in OAF follows MVC framework as

·       Model: Entity Objects (EO), View Objects (VO), Application Module (AM), View Links (VL), Association Objects (AO)
·       View (MDS i.e. needs to deploy these files in DB server): Page (PG), Regions (RN)
·       Controller: All CO files

Types of files available in OAF from source code point of view: .java, .xml

Application server only recognizes .class file i.e. compiled version of .java files
.XML files -> (MDS) Metadata files

From Local directory, we have to move .class + .xml files to Application server at $JAVA_TOP

Location of files in OAF development

Source Code location
Compiled file location
$JDEV_USER_HOME/myclasses (.java, .xml files)
$JDEV_USER_HOME/myprojects (.class, .xml files)

$JDEV_USER_HOME: Environment variable set for JDeveloper to work.

Steps for deployment:

1.       Copy all the files from local directory to application Server in $JAVA_TOP.
Echo $JAVA_TOP in putty, get the path and open in Server (Winscp path).
2.       Keep the $JDEV_USER_HOME/myclasses folder at left side in winscp and $JAVA_TOP at right side.




3.       Please ensure all the dependent files are kept in sync to migrate in Server.
4.       Copy your folder from Local to JAVA_TOP in Binary Format.



5.       Keep all the xxxPG.xml files in MDS layer i.e. DB Server then only these files will be read reason being View Layer is part of MDS files.
6.       To Achieve above step 5, Go to jdevbin/oaext/bin folder in Jdeveloper Folder directory. Open Command Prompt (CMD) and navigate this whole path in CMD like below.



7.       Give a command ‘Import’ from this location Enter and copy the text from the Field: Example1 in Notepad. Purpose of this command is to deploy your View Component i.e. page.xml in MDS i.e. Database.




8.       Copy the Example1 text and replace with your structure like below.

Example1: import d:\jdeveloper\jdev\myprojects\pages\mypage.xml -rootdir d:\jdeveloper\jdev\myprojects -userId 1 -rootPackage /oracle/apps/ak -username jdr -password jdr -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host =incq027bc.idc.oracle.com)(port = 1521)))(connect_data = (sid = des9i2)))" -jdk13


Import C:\A_Shobhit\Donaldson\Development\Development\OAF\p9879989_R12_GENERIC\jdevhome\jdev\myclasses\xyz\oracle\apps\fnd\webui\EmployeeInfoPG.xml -rootdir C:\A_Shobhit\Donaldson\Development\Development\OAF\p9879989_R12_GENERIC\jdevhome\jdev\myclasses -username apps -password apps -dbconnection "(description = (address_list = (address = (community = tcp.world)(protocol = tcp)(host = rdcdxerpdb01.donaldson.com)(port = 1521)))(connect_data = (sid = dev55)))"

Change Your instance specific information, like -rootdir, remove userid 1 -rootpackage, username, password, host and Sid.
Copy this import command and run in CMD again.

This will import your structure.



Importing file "C:\A_Shobhit\Donaldson\Development\Development\OAF\p9879989_R12_GENERIC\jdevhome\jdev\myclasses\xyz\oracle\apps\fnd\webui\EmployeeInfoPG.xml" as "/xyz/oracle/apps/fnd/webui/EmployeeInfoPG".

Import command should deploy View component i.e. Page/Region in MDS or Database.

9.       Let’s verify this in DB tables if import command worked successfully or not.

Jdr_paths, jdr_components, jdr_attributes

SELECT * FROM jdr_paths where path_name ='EmployeeInfoPG';--- Hold information about Page and top Level   
                                                                                                                          structure

SELECT * FROM jdr_components where comp_docid=179149; -- Holds info about all the component in page

Select * from jdr_attributes where att_comp_docid=179149; -- Hold info about the attribute of each component.



10.    Now it’s time to register the OAF file in Oracle Application

 Login in Oracle Apps à Application Developer responsibilityà Applicationà Function

Provide function and User Function name any relevant value.






Select “SSWA jsp function” as Type in Property Tab.







Get the OAF Page URL by running Page from Jdeveloper or its the same string generated in Step 8 above and deployed in DB. “/xyz/oracle/apps/fnd/webui/EmployeeInfoPG”, Suffix it with OA.jsp?page=

OA.jsp?page=/xyz/oracle/apps/fnd/webui/EmployeeInfoPG and provide in Web HTML Tab in HTML Call.



11.   Once Function is created, its time to attach in Menu as usual oracle apps Steps. For testing created one Test menu.


12.   Assign This Menu/Function to Responsibility and Access your New OAF Page.

Tuesday, September 17, 2019

Oracle Business Event Code Example

Hi All,
Recently i had a requirement where client had to get rid of one of the repeated activity for assigning Newly created item to any Ship from Warehouse (Organization) to enable it for Sale.

For example ,

Customer XYZ is asking new product from OU "XYZ_OU".

Steps involved here is to Create New SKU (Item segment) and assign to organization from where we have to ship the inventory following by creating a Sales order and then follow the shipping process.

2nd step i.e. Assigning Item to organization was Automated using Business Event.

So whenever any Item is used in any sales order line and that item is not assigned to Ship from Warehouse at line level, we have to automatically Assign item whenever order is booked.

Code to achieve this functionality




CREATE OR REPLACE function APPS.XXZYX_ITEM_ASSIGN_ACCT_ORG(
                                            p_subscription_guid_in          IN RAW,
                                            p_event_in_out               IN apps.wf_event_t)
   RETURN VARCHAR2
     IS
   pvg_oe_header               VARCHAR2 (25)  := 'HEADER_ID';
   pvg_oe_line                 VARCHAR2 (25)   := 'LINE_ID';
   pvg_event_key               VARCHAR2 (50);
   pvg_parameter_list          apps.wf_parameter_list_t;
   pvg_user_id_num             fnd_user.user_id%TYPE := apps.fnd_global.user_id;
   pvg_login_id_num            NUMBER             := apps.fnd_global.login_id;
   pvg_resp_id_num             NUMBER              := apps.fnd_global.resp_id;
   pvg_resp_appl_id_num        NUMBER         := apps.fnd_global.resp_appl_id;
   lv_oe_header_id             apps.oe_order_headers_all.headeR_id%type;
   lv_org_id                    NUMBER;
   lv_ord_num                   VARCHAR2(100);
   lv_flag                     VARCHAR2(10);
 
   l_getEventName             varchar2(1000);
   l_getEventKey                varchar2(1000);
 
   l_param_name     VARCHAR2(100);
   l_param_value       varchar2(100);
 
 -------------Item Assignment API----------

        g_user_id             fnd_user.user_id%TYPE :=NULL;
        l_appl_id             fnd_application.application_id%TYPE;
        l_resp_id             fnd_responsibility_tl.responsibility_id%TYPE;
        l_api_version   NUMBER := 1.0;
        l_init_msg_list       VARCHAR2(2) := fnd_api.g_false;
        l_commit       VARCHAR2(2) := FND_API.G_FALSE;
        x_message_list        error_handler.error_tbl_type;
        x_return_status   VARCHAR2(2);
        x_msg_count       NUMBER := 0;
 
   BEGIN
   pvg_parameter_list := p_event_in_out.getparameterlist ();

   l_getEventName := p_event_in_out.getEventName ();
   l_getEventKey :=p_event_in_out.getEventKey ();

    IF pvg_parameter_list IS NOT NULL
      THEN
         FOR i IN pvg_parameter_list.FIRST .. pvg_parameter_list.LAST
         LOOP
       
          IF wf_event.getvalueforparameter ('LINE_ID', pvg_parameter_list) IS NULL
           THEN
            --if the line id is null, then this event was fired from header level, insert the record into event table
            IF (pvg_parameter_list (i).getname () = pvg_oe_header)
            THEN
               lv_oe_header_id :=
                               TO_NUMBER (pvg_parameter_list (i).getvalue ());
            end if;

         
     BEGIN

        fnd_global.apps_initialize (USER_ID, RESP_ID, RESP_APPL_ID);

for i in
        (select inventory_item_id from
        oe_order_lines_all
        where header_id=lv_oe_header_id)
        loop

        EGO_ITEM_PUB.ASSIGN_ITEM_TO_ORG(
                   P_API_VERSION          => l_api_version
                ,  P_INIT_MSG_LIST        => l_init_msg_list
                ,  P_COMMIT               => l_commit
                ,  P_INVENTORY_ITEM_ID    => i.inventory_item_id
                ,  p_organization_id      => 163-----Ship from warehouse ID
                ,  X_RETURN_STATUS        => x_return_status
                ,  X_MSG_COUNT            => x_msg_count
            );
        DBMS_OUTPUT.PUT_LINE('Status: '||x_return_status);
        IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
          DBMS_OUTPUT.PUT_LINE('Error Messages :');
          Error_Handler.GET_MESSAGE_LIST(x_message_list=>x_message_list);
            FOR j IN 1..x_message_list.COUNT LOOP
              DBMS_OUTPUT.PUT_LINE(x_message_list(j).message_text);
            END LOOP;
        END IF;
      end loop;
EXCEPTION
        WHEN OTHERS THEN
          dbms_output.put_line('Exception Occured :');
          DBMS_OUTPUT.PUT_LINE(SQLCODE ||':'||SQLERRM);
END;


           --
            l_param_name := pvg_parameter_list (i).getname;
            l_param_value := pvg_parameter_list (i).getvalue;

            --
            INSERT INTO xx_be_debug_log_tmp
                        (text
                        )
                 VALUES (l_param_name || '  :   ' || l_param_value);

            COMMIT;
         END IF;
         --
         END LOOP;
      END IF;

      COMMIT;
      RETURN 'SUCCESS';
   EXCEPTION
   WHEN OTHERS
   THEN
      RETURN 'SUCCESS';
   
   END;
/


Then This function needs to be add as Subscription on Sales order booking event i.e.

 oracle.apps.ont.oip.statuschange.update.

Once Subscription is done properly, Test your case.

Monday, June 18, 2018

Enable OAF Pages for Personalization

Enable OAF Pages for Personalization


Profile Name
Profile Value
FND: Diagnostics
Yes
Personalize Self-Service Defn
Yes
FND: Personalization Region Link Enabled
Yes / Minimal
Disable Self-Service Personal
No

Meanings:

1. FND: Diagnostics
Setting the FND: Diagnostics (FND_DIAGNOSTICS) profile option to “Yes” will enable the diagnostics global button to be rendered on the screen.

2. Personalize Self-Service Defn
Set the value to Yes to allow ‘Personalize’ link to appear at the right top of the OAF page.

3. FND: Personalization Region Link Enabled
It renders the “Personalize  Region” links above each  region in a page. Each link  takes you first to the Choose Personalization Context page, then to the Page Hierarchy Personalization page with focus on the region node from which  you selected the “Personalize  Region” link.

Two Options
Set the value to Yes to display all the personalization links above each OAF page region.
Set the value to Minimal to display key regional links.

4. Disable Self-Service Personal
Set the value to No will enable all OAF personalizations on all pages at all levels (Function, Site, Responsibility, User)

Thursday, February 01, 2018

Initial Setup in JDeveloper for OAF Development

Initial Setup in JDeveloper for OAF Development


If you want to do some OAF Development in JDeveloper for the first time, you will need to do the following things.
1] Download JDeveloper Patch
Based on your instance release level, check out the version of JDeveloper to use using below link.
You can identify the OA Framework version in your instance by activating diagnostics and click the “About This Page” from any OAF page. Click the “Technology Components” tab. The OA Framework version in the top row of the table can then be matched to the JDeveloper Patch.
Download the JDeveloper Patch.
2] Extract the JDeveloper patch in a directory say D:\DevSuiteHome_1\jdev
The patch actually contains below three directories
  • jdevbin – Includes an extended version of the Oracle JDeveloper 10executable and OA Framework class libraries.
  • jdevhome – Includes the OA Framework Toolbox Tutorial source and developer working area.
  • jdevdoc – Contains documentation.
3] Define an environment variable
Define an environment variable JDEV_USER_HOME for your local machine. This has to be set to jdevhome\jdev directory. In above example it has to be D:\DevSuiteHome_1\jdev\jdevhome\jdev.
My Computer  Properties  Advanced tab  Environment Variables  New
Variable: JDEV_USER_HOME
Value: D:\DevSuiteHome_1\jdev\jdevhome\jdev
4] Extract Tutorial.zip
Extract D:\DevSuiteHome_1\jdev \jdevbin\Tutorial.zip into D:\DevSuiteHome_1\jdev \jdevhome.
It will create following directories
D:\DevSuiteHome_1\jdev \jdevhome\jdev\myhtml
D:\DevSuiteHome_1\jdev \jdevhome\jdev\myprojects
5] Get the DBC file
Obtain the FND database connection (.dbc) file from the system administrator who installed the OA Framework database where you want to do your development.
For the instance to use, you can get the .dbc file from $FND_SECURE and put it in <JDEV_USER_HOME>\dbc_files\secure i.e. D:\DevSuiteHome_1\jdev\jdevhome\jdev \dbc_files\secure
6] Creating a Desktop Shortcut to JDeveloper
To facilitate launching JDeveloper, create a desktop shortcut to jdevbin\jdev\bin\jdevw.exe.
7] Configuring the Environment Encoding of JDeveloper
Confirm the environment encoding of your JDeveloper if it is appropriately set.
Go to Tools – Preferences – Environment – Encoding
If Encoding is not set to “UTF-8”, set it to “UTF-8”.
The initial setup is now complete!….Now you are ready to develop your first OAF page. For more information you can refer OAF Developer’s Guide

Friday, September 25, 2015

GENERAL NAMING CONVENTION IN OAF

GENERAL NAMING CONVENTION IN OAF



File Name length:-
File names are limited to 30.3 characters for OA Extension XML files (50.java for Java files).

Object Name length (regions, items, and so on):–

           For performance reasons, object names (internal ID’s) are limited to 30 characters.
           Common abbreviations are acceptable to keep names as short as possible.
          Acceptable abbreviations can be instantly understood by a third party consultant.
          Object names in pages must be unique in the entire page.
          Most names follow Java naming convention (mixed case).

Naming Standards for a Page:- The page name should convey the object it Presents.
            Page name ends with PG:- <object name>PG
            For ex:-    EmpSearchPG,  EmployeePG,  SupplierPG

Naming Standards for a Region:- The region name should convey the object it Presents.
            Region name ends with RN:- <object name>RN
            For ex:-   MainRN,  EmpSearchRN,PoHeaderRN

Naming Standards for an Object:-
                        EmpName,,,SearchEmpName,,ResultsEmpName

Naming Standards for an Entity Object:- The EO should be named for the objects stored in its 
                                                                     underlying entity.
            Entity Object name ends with EO:- <EntityName>EO
            For ex:-  EmployeeEO,    SupplierEO,   PurchaseOrderHeaderEO.

 Naming Standards for an Entity Association Object:-The AO name should convey the relationship between a parent and its child entities.

            Entity Association name ends with AO:-<parent>TO<child>AO
            For ex:- PoHeaderToLinesAO,   SupplierToSitesAO, DepartmentToEmployeeAO

Naming Standards for a View Object:-The VO name should convey the nature of  the query.
View Object name ends with VO:- <Descriptive Name>VO
For ex:-  EmployeeVO,  SupplierVO, PurchaseOrderVO.

Naming Standards for a View Link:- The VL name should convey the relationship
 between the master and detail VOs.
View Link name ends with VL:- <Master>To<Detail>VL

For ex:- EmployeeToDepartmenstVL,    PoHeaderToLinesVL

 Naming Standards for an Application Module:- The AM name should convey the purpose of the                                                                                     UI  module it services.

Application Module name ends with AM:-  <ModuleName>AM

For ex:-HelloWorldAM,   EmployeesAM,  SupplierAM.

Clear BNE Cache for WebADI Changes

It Sometime happens that WebAdi Changes doesn't reflect once migrated in controlled instances. Here are the quick steps(Generally perfor...