Total Pageviews

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

Thursday, 22 August 2024

OAF Instance Bounce

 

4. Generate customall.jar using adcnjar
cd $AD_TOP/bin
adcgnjar
Enter password apps.
-------------------------------------
5. Bounce OACore by connectin to weblogic server.
cd $ADMIN_SCRIPTS_HOME
admanagedsrvctl.sh stop oacore_server1

webglogic password - welcome1

admanagedsrvctl.sh start oacore_server1

 

Wednesday, 31 May 2023

EBS : OAF : Make text field BOLD in Oracle Apps

 How to make text field value bold in OAF Page


1) Go to Field and select item type as "Raw Text"

2) Put below below in Text Box.

<font face="Helvetica" color="red" size="4pt" weight="bold"><b>Learn and gain experience from Tech hards BLOG</b></font>



3) Below is the Output




Sunday, 25 December 2022

OAF : IExpense Page Controller Extension Personalization setup

Page: GeneralInformationPG

Customization List

a)      Employee Grade added along with Employee Name

b)     NoteTOApprover Field:- Made Read-Only 


Personalization Setup

1)         Controller Class :- HeaderCO

Navigation:-

a)      Click on Personalize link from the Page -> Select “Complete view” in Personalization Structure-> Click on Personalize “pencil” as shown below





 

a)      Enter the Extended Controller Name at site level as shown below and click on Apply Button

Controller Class:-

Original Definition :- oracle.apps.ap.oie.webui.HeaderCO

Site level :- oracle.apps.ap.oie.webui.XXExtHeaderCO

 







Sunday, 6 November 2022

OAF : How to find DBC File ( Oracle Apps)

 How to locate correct DBC file

 Navigate to System Administrator -> Concurrent -> Requests, Click on "Submit a New Request" and submit 

   "Generate concurrent processing environment information" CP and let it complete. 

   Click on "View Output" button and locate "FND_SECURE" environment variable to find dbc file.

   DBC file can be found in $FND_SECURE directory or $FND_SECURE/<SID> directory with name <SID>.dbc



--------------------------------------------------------------------------------------------------------------------------------

How to get the DBC file for a particular instance

#Oracle Apps #OAF

OAF : Important Code

 How to retrieve Current row value

ü using Row Reference

           //Getting selected Emp Id-----------------------------------

            OAApplicationModule am= pageContext.getApplicationModule(webBean);

            OAViewObject vo3 = (OAViewObject)am.findViewObject("DataEntryVO1");

           //Get Row Refrence

            String rowReference =    pageContext.getParameter(EVENT_SOURCE_ROW_REFERENCE);          

          //Get current Row using Row Reference   

             OARow currRow = (OARow)am.findRowByRef(rowReference);                 

           //Get attribute value from current row

            String lv_emp_id = (String)currRow.getAttribute("EmpId").toString();

          

           throw new OAException(" Selected Emp id is : !!!"+lv_emp_id  ,OAException.CONFIRMATION);

           // end-----------------------------------

ü using VO.currentRecord

               vo3.last(); --retrieving last row       

              String lv_emp_id =vo3.currRow().getAttribute("EmpId").toString();

                    

ü  using OAMessageStyle Bean

        //CustomerNameTxt  

        OAMessageStyledTextBean CustomerNameTxt =

            (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("CustomerNameTxt");

        System.out.println("CustomerNameTxt" +

                           CustomerNameTxt.getValue(pageContext));


How to Button/fields value using PageContext.getParameter

   (pageContext.getParameter("CreatePage")!=null)     


How to print Message

System.out.println("Process Request Starts****");

 pageContext.writeDiagnostics(this,  "Unable to get DeliveryId" + e.getMessage().toString(),  6);

How to use Link button 

Create an item  and  change the following property

 

Item Style

Link

Destination URI

Link of the calling page

OA.jsp?page=/pk/oracle/apps/fnd/dataentry/server/EntryPG

Passing Parameter

OA.jsp?page=/xxmj/oracle/apps/ibe/customer/delivery/webui/CustDeliveryDetailsPG&retainAM=Y&DeliveryId={@DeliveryNumber}

 

OA.jsp?page=/xxmj/oracle/apps/ibe/customer/reports/webui/DeliveryReportPG&retainAM=Y&DeliveryId={@DeliveryNumber}&ProgramShortName={@DynamicUrl}&OrderNum={@OrderNumber}

 

Target Frame

_blank

Note:- It will Open the Target Page in New Window Page

   

How to use ComparetoIgnore method

        if ("Order Confirmation".compareToIgnoreCase(pageContext.getParameter("ProgramShortName").toString()) ==

            0) {

            System.out.println("Order Confirmation is chsen to be run");

            //Run Order Confirmation Report

            getOutput(pageContext, webBean, "XXMOMRPT55555OAF");

        }

 

How to use Date Format and get Current date

                SimpleDateFormat format =

            new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S");

        oracle.jbo.domain.Date convertDate =

            am3.getOADBTransaction().getCurrentDBDate();

        java.util.Date date = null;

        try {

            date = format.parse(convertDate.toString());

        } catch (ParseException e) {

            // TODO

        }

        SimpleDateFormat formatDate =

            new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

        String convStr = formatDate.format(date);

        System.out.println(convStr);

 

        //2015/03/13 00:00:00

        SimpleDateFormat formatDate2 =

            new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");

        String currentDate = formatDate.format(date);

        System.out.println(currentDate);


OAF : Migration Scripts

 ----------------------------------------------Export command from unix---------------------------

java oracle.jrad.tools.xml.exporter.XMLExporter /oracle/apps/per/perimage/webui/PerImgViewPG -rootdir $JAVA_TOP -username apps -password apps -dbconnection "(description = (address_list= (address= (community = tcp.world)(protocol=tcp) (host=192.168.1.35) (port = 1523))) (connect_data=(sid=TEST)))"

----------------------------------------------Import command from unix----------------------------

java oracle.jrad.tools.xml.importer.XMLImporter $JAVA_TOP/pk/oracle/apps/fnd/insertdemo/webui/InsertPG.xml -username apps -password apps -dbconnection "(DESCRIPTION = (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.35) (PORT=1523)) (CONNECT_DATA=(SID=TEST)))" -rootdir $JAVA_TOP


-------------------------------------------------IMPORT COMMAND from desktop-----------

C:\A_OA\jdevhome\jdev\myprojects\pk\oracle\apps\fnd\insertdemo\webui\InsertPG.xml -rootdir C:\A_OA\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.35)(PORT =1523)))(CONNECT_DATA = (SERVER = DEDICATED) (SID =TEST)))"

-----------------------------scripts to check file uploaded or not----------------------------

DECLARE

BEGIN

jdr_utils.printDocument('/pk/oracle/apps/fnd/insertdemo/webui/InsertPG',1000);

EXCEPTION

WHEN OTHERS THEN

DBMS_OUTPUT.PUT_LINE(SQLERRM);

END;


Thursday, 25 March 2021

OAF : How to add Attachment Link in OAF Page through Personlization : Oracle APPS


How to create Attachment link through OAF Personalization

 

OAF Page for Customization = /oracle/apps/per/selfservice/extrainfotype/webui/EitPG

 

1)      Define Entity

a)      Go to Applciation Developer



a)      Enter Entity Data

Table := XX_PER_ARREAR_UPLOAD_STG

Entity Id := PERSON_ID

Entity Name := PERSON_ID

Prompt := PERSON_ID

Application := Human Resources





 

1)     2)   OAF Personalization to create Attachment Link

a)      a) Add Attachment Link Attribute

b) Entity mapping





c) Entity Primary Key mapping with VO Attribute


d) Fields added as shown below






------------------------------------------------------------------------------------------------------------------

Below Steps need to perform at Database

 

1)

CREATE TABLE XX_PER_ARREAR_UPLOAD_STG

(PERSON_ID NUMBER,

MEDIA_ID VARCHAR2(100),

FILE_NAME VARCHAR2(240),

message varcha2(2000)

);


6) 2) Create Procedures :- XX_PER_ARREAR_FILE_UPLOAD
3) 3) Check correct oracle directory and define in procedure 
8) 4) Run the Scripts to upload file



dPProcedure :- XX_PER_ARREAR_FILE_UPLOAD


CREATE OR REPLACE PROCEDURE XX_PER_ARREAR_FILE_UPLOAD
(P_EMP_NO VARCHAR2)
IS
 l_rowid                  ROWID;
   l_attached_document_id   NUMBER;
   l_document_id            NUMBER;
   l_media_id               NUMBER;
   l_category_id            NUMBER;
   l_pk1_value              fnd_attached_documents.pk1_value%TYPE ;
----<Primary Key information that uniquely identifies the product (such as the product_ID)>;
   l_description            fnd_documents_tl.description%TYPE := 'Arrear Attachment';
   l_filename               VARCHAR2 (240)                    := p_emp_no||'.xls';
   --l_file_path              VARCHAR2 (240)                          := 'test';
             ---'SALE_INVOICE_PATH'; --Server Directory Path for upload files
   l_seq_num                NUMBER;
   l_blob_data              BLOB;
   l_blob                   BLOB;
   l_bfile                  BFILE;
   l_byte                   NUMBER;
   l_fnd_user_id            NUMBER;
   l_short_datatype_id      NUMBER;
   x_blob                   BLOB;   
   fils                     BFILE;
   blob_length              INTEGER;
   l_entity_name            VARCHAR2 (100)                    := 'PERSON_ID';
   l_oracle_directory varchar2(100):= 'ECX_UTL_LOG_DIR_OBJ';
   l_content_type varchar2(100):= 'application/vnd.ms-excel';
                                 --application/vnd.ms-excel--application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
                                                           --- <entity_name>;
   l_category_name          VARCHAR2 (100)                      := 'Miscellaneous';--XX_ARREAR_FILE_UPLOAD';
                                                           --<category_name>;
l_message varchar2(2000);                                                           
BEGIN

  bEGIN
  select DISTINCT PERSON_ID INTO l_pk1_value from per_all_people_f
   where employee_number =P_EMP_NO;
  END;
  insert into  XX_PER_ARREAR_UPLOAD_STG (person_id) values(l_pk1_value);
  
  --fnd_global.apps_initialize (<userid>, <applid>,<appluserid>);
   SELECT fnd_documents_s.NEXTVAL
     INTO l_document_id
     FROM DUAL;

   SELECT fnd_attached_documents_s.NEXTVAL
     INTO l_attached_document_id
     FROM DUAL;

   SELECT NVL (MAX (seq_num), 0) + 10
     INTO l_seq_num
     FROM fnd_attached_documents
    WHERE pk1_value = l_pk1_value AND entity_name = l_entity_name;

-- Select User_id
   SELECT user_id
     INTO l_fnd_user_id
     FROM apps.fnd_user
    WHERE user_name = 'TECHHARDS';                        -- <user_name>;

-- Get Data type id for Short Text types of attachments
   SELECT datatype_id
     INTO l_short_datatype_id
     FROM apps.fnd_document_datatypes
    WHERE NAME = 'FILE';

-- Select Category id for Attachments
   --FATEMP
   SELECT category_id
     INTO l_category_id
     FROM apps.fnd_document_categories_vl
    WHERE user_name = l_category_name;

-- Select nexvalues of document id, attached document id and
-- l_media_id
   SELECT apps.fnd_documents_s.NEXTVAL, apps.fnd_attached_documents_s.NEXTVAL
--apps.fnd_documents_long_text_s.NEXTVAL
   INTO   l_document_id, l_attached_document_id
--l_media_id
   FROM   DUAL;

   SELECT MAX (file_id) + 1
     INTO l_media_id
     FROM fnd_lobs;

   fils := BFILENAME (l_oracle_directory, l_filename);
   --dbms_output.put_line('fils:'||fils);
-- Obtain the size of the blob file
   DBMS_LOB.fileopen (fils, DBMS_LOB.file_readonly);
   blob_length := DBMS_LOB.getlength (fils);
   DBMS_LOB.fileclose (fils);
  

-- Insert a new record into the table containing the
-- filename you have specified and a LOB LOCATOR.
-- Return the LOB LOCATOR and assign it to x_blob.
   INSERT INTO fnd_lobs
               (file_id, file_name, file_content_type, upload_date,
                expiration_date, program_name, program_tag, file_data,
                LANGUAGE, oracle_charset, file_format
               )
        VALUES (l_media_id, l_filename, /*'text/plain',*/ l_content_type,
                                                        --'application/pdf',--
                                                                            SYSDATE,
                NULL, 'FNDATTCH', NULL, EMPTY_BLOB ()
                ,'US', /*'UTF8'*/
                                /* 'AR8MSWIN1256' */ 'WE8MSWIN1252',--'AR8ISO8859P6',
                                 'binary'
                                                                    /*'text'*/
               )
     RETURNING file_data
          INTO x_blob;

-- Load the file into the database as a BLOB
   DBMS_LOB.OPEN (fils, DBMS_LOB.lob_readonly);
   DBMS_LOB.OPEN (x_blob, DBMS_LOB.lob_readwrite);
   DBMS_LOB.loadfromfile (x_blob, fils, blob_length);
-- Close handles to blob and file
   DBMS_LOB.CLOSE (x_blob);
   DBMS_LOB.CLOSE (fils);
   DBMS_OUTPUT.put_line ('FND_LOBS File Id Created is ' || l_media_id);
   COMMIT;
-- This package allows user to share file across multiple orgs or restrict to single org
   fnd_documents_pkg.insert_row
      (x_rowid                  => l_rowid,
       x_document_id            => l_document_id,
       x_creation_date          => SYSDATE,
       x_created_by             => l_fnd_user_id,
                                               -- fnd_profile.value('USER_ID')
       x_last_update_date       => SYSDATE,
       x_last_updated_by        => l_fnd_user_id,
                                               -- fnd_profile.value('USER_ID')
       x_last_update_login      => -1,
       x_datatype_id            => l_short_datatype_id,                -- FILE
       x_security_id            => NULL,
          --<security ID defined in your Attchments, Usaully SOB ID/ORG_ID..>,
       x_publish_flag           => /*'N'*/ 'Y',
              --This flag allow the file to share across multiple organization
       x_category_id            => l_category_id,
       x_security_type          => /*1*/ 4,
       x_usage_type             => /*'S'*/ 'O',
       x_language               => 'US',
       x_description            => l_filename,           
       x_file_name              => l_filename,
       x_media_id               => l_media_id
      );
     COMMIT;

     fnd_attached_documents_pkg.insert_row
      (x_rowid                         => l_rowid,
       x_attached_document_id          => l_attached_document_id,
       x_document_id                   => l_document_id,
       x_creation_date                 => SYSDATE,
       x_created_by                    => l_fnd_user_id,
                                               --fnd_profile.VALUE('USER_ID'),
       x_last_update_date              => SYSDATE,
       x_last_updated_by               => l_fnd_user_id,
                                               --fnd_profile.VALUE('USER_ID'),
       x_last_update_login             => -1,
       x_seq_num                       => l_seq_num,
       x_entity_name                   => l_entity_name,
       x_column1                       => NULL,
       x_pk1_value                     => l_pk1_value,
       x_pk2_value                     => NULL,
       x_pk3_value                     => NULL,
       x_pk4_value                     => NULL,
       x_pk5_value                     => NULL,
       x_automatically_added_flag      => 'N',
       x_datatype_id                   => 6,
       x_category_id                   => l_category_id,
       x_security_type                 => /*1*/ 4,
       x_security_id                   => NULL,
          --<security ID defined in your Attchmentsssss, SOB ID/ORG_ID..>,
       x_publish_flag                  => 'Y',
       x_language                      => 'US',
       x_description                   => l_filename,         --l_description,
       x_file_name                     => l_filename,
       x_media_id                      => l_media_id
      );

      update XX_PER_ARREAR_UPLOAD_STG
   set media_id = l_media_id,
   file_name = l_filename,
   message='SUCCESSFUL'
   where person_id =l_pk1_value;    
   COMMIT;
   DBMS_OUTPUT.put_line ('MEDIA ID CREATED IS ' || l_media_id);
Exception when others then
l_message := SQLERRM;
update XX_PER_ARREAR_UPLOAD_STG
     set media_id = l_media_id,
     file_name = l_filename,message = l_message
     where person_id =l_pk1_value;  
    END;

--=========================================================================
   # OAF , # OAF Personalization , # Add Attachment Link through Personalization , # Oracle Apps , # EBS

Friday, 18 December 2020

OAF: Page Navigation (Oracle Apps)

How to navigate between pages in OAF

1) 

pageContext.setForwardURL("OA.jsp?page=/oracle/apps/fnd/framework/toolbox/tutorial/webui/SupplierPG",

null,

KEEP_MENU_CONTEXT,

null,

null,

true, // Retain AM

OAWebBeanConstants.ADD_BREAD_CRUMB_YES,

OAWebBeanConstants.IGNORE_MESSAGES);


-----------------------------------------------------------------------------------------------------------------------------

#Oracle Apps , # OAF

OAF : How to Add days in input date

 OAF : How to Add days in input date

import java.text.SimpleDateFormat;

import java.util.Calendar;

import java.text.ParseException;

public class Example{

   public static void main(String args[]){

        String oldDate = "2017-01-29"; 

               System.out.println("Date before Addition: "+oldDate);

               SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

               Calendar c = Calendar.getInstance();

               try{

                  c.setTime(sdf.parse(oldDate));

               }catch(ParseException e){

                  e.printStackTrace();

                }

               //Incrementing the date by 1 day

               c.add(Calendar.DAY_OF_MONTH, 1); 

               String newDate = sdf.format(c.getTime()); 

               System.out.println("Date Incremented by One: "+newDate);

   }

}


FUSION: Purchasing Query

  1) ---------CPA to PO Amount---------- select poh.segment1, (select sum(nvl(cpol.quantity,1)* cpol.unit_price) from po_headers_all cpoh,po...