Here you go

Monday, December 29, 2014

How to Find Oracle Application User Password?


Finding EBS Application Passwords 



It is easy to 

Find Oracle EBS Application User Passwords  

in just 2 simple steps:



Step 1 - Create Following  Package:



CREATE OR REPLACE PACKAGE MY_PKG
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2;
END ;


CREATE OR REPLACE PACKAGE BODY MY_PKG
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2
   AS
      LANGUAGE JAVA
      NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
END ;



2 - Run Following Query :


SELECT usr.user_name,
       MY_PKG.decrypt
          ((SELECT (SELECT MY_PKG.decrypt
                              (fnd_web_sec.get_guest_username_pwd,
                               usertable.encrypted_foundation_password
                              )
                      FROM DUAL) AS apps_password
              FROM fnd_user usertable
             WHERE usertable.user_name =
                      (SELECT SUBSTR
                                  (fnd_web_sec.get_guest_username_pwd,
                                   1,
                                     INSTR
                                          (fnd_web_sec.get_guest_username_pwd,
                                           '/'
                                          )
                                   - 1
                                  )
                         FROM DUAL)),
           usr.encrypted_user_password
          ) PASSWORD
  FROM fnd_user usr
 WHERE usr.user_name = :USER_NAME;

Friday, December 19, 2014

Oracle EBS APIs and Their Uses / Uses of Oracle APIs


  1. API To Find Sales Order's Subtotal,discount,charges and Tax (OE_OE_TOTALS_SUMMARY.ORDER_TOTALS)
  2. API for Cancelling the Purchase Order (PO) Document (PO_DOCUMENT_CONTROL_PUB.CONTROL_DOCUMENT)
  3. API for Deleting the category assignment to an item (INV_ITEM_CATEGORY_PUB.DELETE_CATEGORY_ASSIGNMENT)
  4. API for Updating Category Assignment of an item (INV_ITEM_CATEGORY_PUB.UPDATE_CATEGORY_ASSIGNMENT)
  5. API to Book a sales order (OE_ORDER_PUB.PROCESS_ORDER )
  6. API to Cancel a Sales Order (OE_ORDER_PUB.PROCESS_ORDER)
  7. API to Cancel an Order Line (OE_ORDER_PUB.PROCESS_ORDER)
  8. API to Check Existence of an Internal Bank R12 (CE_BANK_PUB.CHECK_BANK_EXIST)
  9. API to Create Item Specific UOM Conversion (INV_CONVERT.CREATE_UOM_CONVERSION)
  10. API to Create a Customer Account for an existing Party TCA R12 (HZ_CUST_ACCOUNT_V2PUB.CREATE_CUST_ACCOUNT)
  11. API to Create a Customer Profile TCA R12 (HZ_CUSTOMER_PROFILE_V2PUB.CREATE_CUSTOMER_PROFILE)
  12. API to Create a Customer Site TCA R12 (HZ_CUST_ACCOUNT_SITE_V2PUB.CREATE_CUST_ACCT_SITE)
  13. API to Create a Customer Site Use TCA R12 (HZ_CUST_ACCOUNT_SITE_V2PUB.CREATE_CUST_SITE_USE)
  14. API to Create a Party Site TCA R12 (HZ_PARTY_SITE_V2PUB.CREATE_PARTY_SITE)
  15. API to Create a Party Site Use TCA R12 (HZ_PARTY_SITE_V2PUB.CREATE_PARTY_SITE_USE)
  16. API to Create a Phone Number (Contacts) TCA R12 (HZ_CONTACT_POINT_V2PUB.CREATE_CONTACT_POINT)
  17. API to Create an Internal Bank Account in R12 CE_BANK_PUB.CREATE_BANK_ACCT
  18. API to Create an Internal Bank Branch R12 (CE_BANK_PUB.CREATE_BANK_BRANCH)
  19. API to Delete a Sales Order (OE_ORDER_PUB.PROCESS_ORDER )
  20. API to Delete an Order Line (OE_ORDER_PUB.PROCESS_ORDER)
  21. API to End Date an Internal Bank Branch in R12 - CE_BANK_PUB.SET_BANK_BRANCH_END_DATE
  22. API to End Date an Internal Bank in R12 - CE_BANK_PUB.SET_BANK_END_DATE
  23. API to Update Customer Address in Oracle TCA R12 (HZ_LOCATION_V2PUB.UPDATE_LOCATION)
  24. API to Update Oracle Applications Password (fnd_user_pkg.updateuser)
  25. API to Update Purchase Order Document (PO) (PO_CHANGE_API1_S.UPDATE_PO)
  26. API to Update a Customer Account TCA R12 (HZ_CUST_ACCOUNT_V2PUB.UPDATE_CUST_ACCOUNT)
  27. API to Update an Internal Bank Branch R12 (CE_BANK_PUB.UPDATE_BANK_BRANCH)
  28. API to Update an Internal Bank in R12 (CE_BANK_PUB.UPDATE_BANK)
  29. API to apply hold on AP invoice in R12 (AP_HOLDS_PKG.INSERT_SINGLE_HOLD)
  30. API to cancel single AP invoice (AP_CANCEL_PKG.AP_CANCEL_SINGLE_INVOICE)
  31. API to confirm on Order Header Status (OE_HEADER_STATUS_PUB)
  32. API to confirm on Order Line Status (OE_LINE_STATUS_PUB)
  33. API to create Group in TCA R12 (HZ_PARTY_V2PUB.CREATE_GROUP)
  34. API to create Party and Customer Account in R12 (HZ_CUST_ACCOUNT_V2PUB.CREATE_CUST_ACCOUNT)
  35. API to create a Person Type Party and Customer Account TCA R12 (HZ_CUST_ACCOUNT_V2PUB.CREATE_CUST_ACCOUNT)
  36. API to create customer Addresses in TCA R12 (HZ_LOCATION_V2PUB.CREATE_LOCATION)
  37. API to find AP INVOICE Status (AP_INVOICES_PKG.GET_APPROVAL_STATUS)
  38. API to get combination id based on segment info (FND_FLEX_EXT.GET_COMBINATION_ID)
  39. API to get open sales order quantity in oracle apps (OE_LINE_UTIL.GET_OPEN_QUANTITY)
  40. API to get the concatenated segment values for a code combination id (FND_FLEX_EXT.GET_SEGS)
  41. API to get the formatted contact details of a Party in oracle apps R12 (HZ_FORMAT_PHONE_V2PUB.PHONE_DISPLAY)
  42. API to get the segment delimiter for the specified key flex field structure (FND_FLEX_EXT.GET_DELIMITER)
  43. API to populate loc_id HZ_LOCATIONS R12 (HZ_TAX_ASSIGNMENT_V2PUB. CREATE_LOC_ASSIGNMENT )
  44. API to populate the Descriptive element Value of an item ( inv_item_catalog_elem_pub.process_item_descr_elements)
  45. API to release hold on AP invoice in R12 (AP_HOLDS_PKG.RELEASE_SINGLE_HOLD)
  46. API to update AR Invoice Printing Details in R12 AR_INVOICE_SQL_FUNC_PUB
  47. API to update AR Receipt in oracle apps R12 - AR_RECEIPT_UPDATE_API_PUB (UNIDENTIFIED to UNAPPLIED)
  48. API to update a Customer Account Relationship TCA R12 (HZ_CUST_ACCOUNT_V2PUB.UPDATE_CUST_ACCT_RELATE)
  49. API to update a Customer Profile TCA R12 (HZ_CUSTOMER_PROFILE_V2PUB.UPDATE_CUSTOMER_PROFILE)
  50. API to update an Internal Bank Account in Oracle Apps R12 (CE_BANK_PUB.UPDATE_BANK_ACCT)
  51. AR: Reversal of Receipt through API (ar_receipt_api_pub.REVERSE)
  52. AR: Unapplication of a Credit Memo through API (ar_cm_api_pub.unapply_on_account)
  53. AR_INVOICE_API_PUB.create_single_invoice
  54. AR_RECEIPT_API_PUB - Script to Create and Apply on account a AR Receipt
  55. AR_RECEIPT_API_PUB.Apply_on_account ( Script to apply a receipt on account )
  56. AR_RECEIPT_API_PUB.CREATE_MISC - R12 - Create Miscellaneous Cash Receipt in Oracle Apps
  57. AR_RECEIPT_API_PUB.Unapply_on_account ( Script to unapply on account a Receipt in R12)
  58. Add New Line to Existing Order Using the API (OE_ORDER_PUB.PROCESS_ORDER)
  59. Ar_receipt_api_pub.Apply
  60. Ar_receipt_api_pub.Create_and_apply
  61. Ar_receipt_api_pub.Create_cash
  62. Ar_receipt_api_pub.Unapply
  63. Assign Delivery Details to a Delivery through API ( WSH_DELIVERY_DETAILS_PUB.DETAIL_TO_DELIVERY )
  64. Assigning Category set to Category via API in Oracle Apps (INV_ITEM_CATEGORY_PUB.CREATE_VALID_CATEGORY)
  65. Assigning category to an Item using API (INV_ITEM_CATEGORY_PUB.CREATE_CATEGORY_ASSIGNMENT)
  66. Autocreate Deliveries Through API WSH_DELIVERY_DETAILS_PUB.AUTOCREATE_DELIVERIES
  67. CASH MANAGEMENT API'S (CE_BANK_PUB) IN ORACLE APPS R12
  68. CE_BANK_PUB.CHECK_BRANCH_EXISTS - API to check existence of an Internal Bank Branch in R12
  69. CE_BANK_PUB.CREATE_BANK API to Create an Internal Bank in R12
  70. CE_BANK_PUB.UPDATE_BANK_BRANCH API to Update an Internal Bank Branch R12
  71. Create Credit Card in Oracle Payments using API (IBY_FNDCPT_SETUP_PUB.CREATE_CARD)
  72. Create Party of type Organization in Oracle TCA using API hz_party_v2pub.create_organization
  73. Create a Customer Account Relationship API HZ_CUST_ACCOUNT_V2PUB.CREATE_CUST_ACCT_RELATE
  74. Create and Release Pciking Batch via API (wsh_picking_batches_pub.create_batch and wsh_picking_batches_pub.Release_batch)
  75. Credit Memo Creation via API ( ar_credit_memo_api_pub.create_request )
  76. FND_PROGRAM : Add Concurrent Program to Request Group via API
  77. FND_PROGRAM : Delete Concurrent Program Definition via API
  78. FND_PROGRAM : Delete Concurrent Program Executable via API
  79. FND_PROGRAM : Delete Concurrent Program Parameter via API
  80. FND_PROGRAM : Register Concurrent Program parameters via API
  81. FND_PROGRAM : Register Concurrent Program via API
  82. FND_PROGRAM : Remove Concurrent Program from Request Group via API
  83. FND_PROGRAM : Create Concurrent Executable via API
  84. FND_REQUEST.SUBMIT_REQUEST in R12
  85. FND_USER_PKG.CREATEUSER ( Create Applications User via PLSQL)
  86. GET ONHAND QUANTITIES THROUGH API in Oracle Apps R12 (INV_QUANTITY_TREE_PUB.QUERY_QUANTITIES)
  87. Generation of a LOT number for an Inventory item via API in R12
  88. How to apply invoice in detail against the receipt through api (AR_RECEIPT_API_PUB.Apply_In_Detail)
  89. How to attach documents from backend? ( fnd_webattch.add_attachment )
  90. How to delete a attachment from backend (fnd_attached_documents2_pkg.delete_attachments)
  91. How to do UOM Conversions through api? ( inv_convert.inv_um_convert_new )
  92. How to get the Description of the Item based on Item catalog group using API (invicgds.inv_get_icg_desc)
  93. How to get timezone based on ZIP code? (HZ_TIMEZONE_PUB.GET_TIMEZONE_ID)
  94. How to set context and profile values from backend in R12 Oracle apps
  95. IBY_EXT_BANKACCT_PUB.CREATE_EXT_BANK – R12 – API to Create External Bank
  96. IBY_EXT_BANKACCT_PUB.CREATE_EXT_BANK_ACCT – R12 – API to Create External Bank Account
  97. IBY_EXT_BANKACCT_PUB.CREATE_EXT_BANK_BRANCH – R12 – API to Create External Bank Branch
  98. IMPORT EXTERNAL BANK ACCOUNTS R12 ORACLE APPS
  99. Item Categories Deletion through API in Oracle Apps (INV_ITEM_CATEGORY_PUB.DELETE_CATEGORY)
  100. Item Categories Updation through API in Oracle Apps (INV_ITEM_CATEGORY_PUB.UPDATE_CATEGORY)
  101. Item categories creation through API in Oracle Apps (INV_ITEM_CATEGORY_PUB.CREATE_CATEGORY)
  102. Item categories in oracle apps R12
  103. Item import based on Item template in R12 (insert script)
  104. OE_HOLDS_PUB.APPLY_HOLDS -- Apply Hold Script
  105. OE_HOLDS_PUB.RELEASE_HOLDS -- Release Holds Script
  106. OE_ORDER_PUB.GET_ORDER -- API to collect existing sales order data in R12
  107. OE_ORDER_PUB.PROCESS_ORDER ( Sample Script for R12)
  108. OE_ORDER_PUB.PROCESS_ORDER in Oracle Apps R12
  109. OE_ORDER_PUB.PROCESS_ORDER to Apply hold on a sales order
  110. OE_ORDER_PUB.PROCESS_ORDER to Release a hold on sales order in R12
  111. ORA-01403: no data found in Package AR_RECEIPT_API_PUB Procedure Apply
  112. Picking Batch Creation Through API ( wsh_picking_batches_pub.create_batch)
  113. Price List Import via API (QP_PRICE_LIST_PUB.PROCESS_PRICE_LIST) in R12
  114. Script to Submit Item Import (INCOIN) using FND_REQUEST in Oracle Apps R12
  115. Script to get the Quantity reserved against an sales order line in oracle apps R12 (INV_RESERVATION_PUB.QUERY_RESERVATION_OM_HDR_LINE)
  116. TRADING COMMUNITY ARCHITECTURE (TCA) API’S IN R12 ORACLE APPS
  117. Unassign Delivery Details from Delivery through API ( WSH_DELIVERY_DETAILS_PUB.DETAIL_TO_DELIVERY )
  118. Update Order Header Details Using the API (OE_ORDER_PUB.PROCESS_ORDER)
  119. hz_party_contact_v2pub.create_org_contact - API to create a Contact person for an organization in Oracle TCA
source:http://www.shareoracleapps.com/p/var-acctoctrue.html

Wednesday, October 22, 2014

How to Set Forms Path for Oracle Form Builder (Forms_Path)



If you are willing to compile Oracle Forms on your PC having windows, XP, 7 or 8 then you have add an environment variable named   "FORMS_PATH" and assign it a value where your forms, resources and plsql are available on your system.

In my case I have placed AU_TOP  to my D: drive.


Then value of environment variable will be:

D:\au\12.0.0\resource;D:\au\12.0.0\plsql;D:\au\12.0.0\forms\US


Navigation:
   Right Click on My Computer > Properties > Advance > Environment Variable.


Monday, July 21, 2014

Oracle Payroll : Error During Batch Transfer / Error During Batch Validation ( Fixed )

+---------------------------------------------------------------------------+
Human Resources: Version : 12.0.0

Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.

PAYLINK module: BEE Batch Process
+---------------------------------------------------------------------------+

Current system time is 21-JUL-2014 09:12:47

+---------------------------------------------------------------------------+


===============================================================================
Oracle Human Resources Generic Process
Started at             : 21-JUL-2014 09:10:41
Chunk Size             : 20
Threads                : 1
Logging Category       :
User Messaging         : N
Interlock              : N
Trace                  : N
RR Buffer Size         : 500
RRV Buffer Size        : 500
Bal Buffer Size        : 500
EE Buffer Size         : 500
Logging Area           :
Assignment ID for Start:
Assignment ID for End o:

-------------------------------------------------------------------------
PL/SQL Output
-------------------------------------------------------------------------
-------------------------------------------------------------------------
HR_6881_HRPROC_ORA_ERR
SQLERRMC ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "APPS.PY_ROLLBACK_PKG", line 3239
ORA-06512: at line 2

SQL_NO 4809
TABLE_NAME py_rollback_pkg.rollback_payroll_action
APP-PAY-06881: Error ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "APPS.PY_ROLLBACK_PKG", line 3239
ORA-06512: at line 2
 has occurred in table py_rollback_pkg.rollback_payroll_action at location 4809

Cause:        an oracle error has occurred.  The failure was reported on table py_rollback_pkg.rollback_payroll_action at location 4809 with the error text ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "APPS.PY_ROLLBACK_PKG", line 3239
ORA-06512: at line 2
.

Action:        Please contact your support representative.

+---------------------------------------------------------------------------+
Start of log messages from FND_FILE
+---------------------------------------------------------------------------+
+---------------------------------------------------------------------------+
End of log messages from FND_FILE
+---------------------------------------------------------------------------+


+---------------------------------------------------------------------------+
Executing request completion options...


Finished executing request completion options.
Concurrent program returned no reason for failure.

+---------------------------------------------------------------------------+
Concurrent request completed
Current system time is 21-JUL-2014 09:12:50

+---------------------------------------------------------------------------+


Possible Causes:


1 - Wrong Assignment Number Entered. ( Number Not Exits OR Terminated Employees )
Solution:
      Check Your Data.
      OR
      Try to load few data.


2 - Data Corruption
Solution:
      Log SR.




Thursday, July 10, 2014

Export Data To Excel Using C# / C Sharp


Export Data From Data Set / Data Table / Data Grid View to MS Excel:

You can export data from Data Set / Data Table / Data Grid View to MS Excel Using Following Function:


        public void ExportToExcel(string reportName, string parameter, string path, DataGridView dgv , string userName)
        {
            int i = 0;
            int j = 0;
            int col = 0;

            string folderPath = "";

         
            FolderBrowserDialog fbdExportFileLocation = new FolderBrowserDialog();
            if (fbdExportFileLocation.ShowDialog() == DialogResult.OK)
            {
                folderPath = fbdExportFileLocation.SelectedPath;
            }

            Excel.Application xlApp;
            Excel.Workbook xlWorkBook;
            Excel.Worksheet xlWorkSheet;
            object misValue = System.Reflection.Missing.Value;


            xlApp = new Excel.Application();
            xlWorkBook = xlApp.Workbooks.Add(misValue);
            xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);


            //  Report Name
            xlWorkSheet.Cells[1, 1] = reportName;

            //  Parameters
            xlWorkSheet.Cells[3, 1] = parameter;

            //
            xlWorkSheet.Cells[4, 1] = "User Name : " + userName;

            // Report Columns Heading
            for (col = 0; col <= dgv.ColumnCount - 1; col++)
            {

                xlWorkSheet.Cells[5, col + 1] = dgv.Columns[col].HeaderText.ToString().Replace('_',' ');
             
            }
         
            Excel.Range Rows = xlWorkSheet.get_Range("A1",  "A5");
            Rows.EntireRow.Font.Bold = true;

            Excel.Range Row1 = xlWorkSheet.get_Range("A1",  "A1");
            Row1.EntireRow.Font.Size = 16;

            for (i = 0; i <= dgv.RowCount - 1; i++)
            {
                for (j = 0; j <= dgv.ColumnCount - 1; j++)
                {
                    DataGridViewCell cell = dgv[j, i];
                    xlWorkSheet.Cells[i + 6, j + 1] = cell.Value;
                }

            }

            xlWorkBook.SaveAs(folderPath+"\\REPORT-"+reportName+".xls", Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue, Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
            xlWorkBook.Close(true, misValue, misValue);
            xlApp.Quit();

            releaseObject(xlWorkSheet);
            releaseObject(xlWorkBook);
            releaseObject(xlApp);

            MessageBox.Show("Excel file created, you can find the file on : " + folderPath + "\\REPORT-" + reportName + ".xls");
        }


Now you can convert code from Any Language to Other Language : Link

Oracle String Functions



Oracle String Functions


NameDescription
ASCII()Return numeric value of left-most character
BIN()Return a string containing binary representation of a number
BIT_LENGTH()Return length of argument in bits
CHAR_LENGTH()Return number of characters in argument
CHAR()Return the character for each integer passed
CHARACTER_LENGTH()Synonym for CHAR_LENGTH()
CONCAT_WS()Return concatenate with separator
CONCAT()Return concatenated string
ELT()Return string at index number
EXPORT_SET()Return a string such that for every bit set in the value bits, you get an on string and for every unset bit, you get an off string
FIELD()Return the index (position) of the first argument in the subsequent arguments
FIND_IN_SET()Return the index position of the first argument within the second argument
FORMAT()Return a number formatted to specified number of decimal places
HEX()Return a hexadecimal representation of a decimal or string value
INSERT()Insert a substring at the specified position up to the specified number of characters
INSTR()Return the index of the first occurrence of substring
LCASE()Synonym for LOWER()
LEFT()Return the leftmost number of characters as specified
LENGTH()Return the length of a string in bytes
LIKESimple pattern matching
LOAD_FILE()Load the named file
LOCATE()Return the position of the first occurrence of substring
LOWER()Return the argument in lowercase
LPAD()Return the string argument, left-padded with the specified string
LTRIM()Remove leading spaces
MAKE_SET()Return a set of comma-separated strings that have the corresponding bit in bits set
MATCHPerform full-text search
MID()Return a substring starting from the specified position
NOT LIKENegation of simple pattern matching
NOT REGEXPNegation of REGEXP
OCT()Return a string containing octal representation of a number
OCTET_LENGTH()Synonym for LENGTH()
ORD()Return character code for leftmost character of the argument
POSITION()Synonym for LOCATE()
QUOTE()Escape the argument for use in an SQL statement
REGEXPPattern matching using regular expressions
REPEAT()Repeat a string the specified number of times
REPLACE()Replace occurrences of a specified string
REVERSE()Reverse the characters in a string
RIGHT()Return the specified rightmost number of characters
RLIKESynonym for REGEXP
RPAD()Append string the specified number of times
RTRIM()Remove trailing spaces
SOUNDEX()Return a soundex string
SOUNDS LIKECompare sounds
SPACE()Return a string of the specified number of spaces
STRCMP()Compare two strings
SUBSTR()Return the substring as specified
SUBSTRING_INDEX()Return a substring from a string before the specified number of occurrences of the delimiter
SUBSTRING()Return the substring as specified
TRIM()Remove leading and trailing spaces
UCASE()Synonym for UPPER()
UNHEX()Return a string containing hex representation of a number
UPPER()Convert to uppercase

Reference : For Further Details

Thursday, June 12, 2014

How to find EBS Employee Type?



Query to find Person Type:



        SELECT
                PAPF.EMPLOYEE_NUMBER,
                PAPF.FULL_NAME,
                PPT.USER_PERSON_TYPE        PERSON_TYPE  
        FROM

                PER_PERSON_TYPE_USAGES_F    PTYPE,

                PER_PERSON_TYPES            PPT,

                PER_ALL_PEOPLE_F            PAPF

        WHERE
                PTYPE.PERSON_ID         = PAPF.PERSON_ID
        AND     PPT.PERSON_TYPE_ID      = PTYPE.PERSON_TYPE_ID
        AND     SYSDATE BETWEEN PTYPE.EFFECTIVE_START_DATE  AND PTYPE.EFFECTIVE_END_DATE
        AND     SYSDATE BETWEEN PAPF.EFFECTIVE_START_DATE   AND PAPF.EFFECTIVE_END_DATE      

Wednesday, May 28, 2014

Oracle Dependent Objects / Query to find Dependent Views , Functions, Procedures and Fast Formulas



How to find dependent objects in Oracle?


SELECT A.OWNER||'.'||A.NAME DEPENDENT_OBJECTS
FROM
    (
      SELECT
            *
      FROM
            DBA_DEPENDENCIES
    ) A
START WITH REFERENCED_NAME = :OBJECT_NAME
CONNECT BY  NOCYCLE ((REFERENCED_NAME = PRIOR NAME) AND (REFERENCED_OWNER = PRIOR OWNER))

Thursday, May 15, 2014

Denomination


Salary Breakup:

Denomination:

 


Use the following Query to find the Denomination:

You can change values in order to get your desired results.


SELECT
        TRUNC(SAL/1000)                                                        THOUSAND_NOTES,
        MOD(SAL,1000)                                                            REMANING_AFTER_THOUSAND,
        TRUNC(MOD(SAL,1000)/500)                                     FIVE_HUNDRED_NOTES,
        MOD(MOD(SAL,1000),500)                                         REMANING_AFTER_FIVE,
        TRUNC(MOD(MOD(SAL,1000),500)/100)                   HUNDRED_NOTES,
        MOD(MOD(MOD(SAL,1000),500),100)                       REMANING_AFTER_HUNDRED,    
        TRUNC(MOD(MOD(MOD(SAL,1000),500),100)/50)  FIFTY_NOTES,
        MOD(MOD(MOD(MOD(SAL,1000),500),100),50)      REMANING_AFTER_50
FROM
(
SELECT
    95780 SAL
FROM
    DUAL  
UNION ALL
SELECT
    95000 SAL
FROM
    DUAL  
UNION ALL
SELECT
    90080 SAL
FROM
    DUAL      
)                                  

Wednesday, May 7, 2014

Purge Element Batch Error Lines/ How to Register Procedure in Oracle ERP?


While uploading an element entry batch using Web ADI and getting few Error lines, you can use the following Procedure to remove lines which contains errors. So that you can transfer successful lines.


Oracle ERP Payroll Delete Error Lines From Element Batch Entry 

Step 1: Create Following Procedure

CREATE OR REPLACE PROCEDURE APPS.ERROR_BATCH_LINE_DELTE_GTM
    (
    ERRBUF          OUT    VARCHAR2,
    RETCODE       OUT    VARCHAR2,
    BATCH_ID_P  IN        NUMBER                                      
    ) IS

BEGIN

    DELETE FROM PAY_BATCH_LINES WHERE BATCH_LINE_STATUS='E' AND BATCH_ID=BATCH_ID_P;
 
    COMMIT;
   
END;


Step 2: Now Register Procedure to EBS to make it available for the user:

Application Developer > Concurrent > Executable


Application Developer > Concurrent > Program


Parameter Form:

Note that your procedure have 3 parameters:
1 - ERRBUF is output parameter used for System Error Buffer. (Do not assign any value to this parameter)
2 - RETCODE is output parameter used to return Error Code.  (Do not assign any value to this parameter)
3 - BATCH_ID_P is input parameter used to Delete the specified batch. (Assign a value to this parameter)

Create a LOV which show batch element names and return Batch Id. Then assign to Program.



Tuesday, May 6, 2014

Oracle Top Interview Questions


1-         What is Sub Query?

A sub query is a SQL query nested inside a larger query. A sub query may used in :
SELECT clause
FROM clause
WHERE clause

A sub query can be nested inside a SELECT, INSERT, UPDATE, or DELETE statement or inside another sub query.


2-         What are the various Oracle database objects?

TABLES
VIEWS
INDEXES
SYNONYMS
SEQUENCES
TABLESPACES


3-         What is Alias?

Alias is a temporary name provided to a column or table. It gets over after the execution of SQL statement.


4-        What is a view?

View is a virtual table which can be based on one or more tables. 


5-        What is a hot backup?

Hot Backup is basically taking a backup of the database while it is still up and running and database must be in archive log mode.
Benefit: The database is still available for use while the backup is occurring and you can recover the database to any point in time.

6-         What is a cold backup?

Cold Backup is basically taking a backup of the database while it is shut down and does not require being in archive log mode.
Benefit: It is typically easier to administer the backup and recovery process. In addition, since you are taking cold backups the database does not require being in archive log mode and thus there will be a slight performance gain as the database is not cutting archive logs to disk.


7-         Difference between TRUNCATE and DELETE for a table.

Both Truncate and delete commands can use to delete all data from a table. The difference between the two is that the truncate command is a DDL operation and just moves the high water mark and produces few rollback data. The delete command, on the other hand, is a DML operation, which will produce rollback data and thus take longer to complete.


8-        What are benefits of index?

It provides faster access to data blocks in a table.


9-         In a parent and child table relationship you want to drop parent and re-create it. How would you do this without affecting the children tables?
Steps:
1-     Disable the foreign key constraint to the parent.
2-     Drop the parent table.
3-     Re-create the parent table.
4-     Enable the foreign key constraint.


10-       What is the difference between $ORACLE_BASE and $ORACLE_HOME?

ORACLE_BASE is the root directory for oracle and ORACLE_HOME located beneath ORACLE_BASE is where the oracle products reside.


11-       How would you determine the time zone by using database query?

SELECT dbtimezone FROM DUAL;


12-       What is the difference between a FUNCTION, PROCEDURE and PACKAGE?

They are all named PL/SQL blocks.
Function must return a value. It can be called inside a query.
Procedure may or may not return value.
Package is the collection of functions, procedures, variables which can be logically grouped together.


13-       What is Snap Shot in Oracle Database?

Snapshots are read only copies of a master table located on a remote node and these are periodically refreshed to reflect changes made to the master table.



How to make XML Reports? (Create XML Reports / Create RTF Report )


How to develop XML Reports?


You can integrate and use these XML Reports in Oracle EBS.

Step 1: Write Query in Report Builder.



Step 2: Generate XML File.



Select File > Generete to > XML. It will ask you to save this XML file.



Step 3: Create a RTF File and Load XML File.
Open word and create new document with Rich Text Format.



Add-Ins > Data > Load XML Data







Step 4: Formatting XML Report.
If you want to insert all fields then follow this navigation: 
Add-Ins > Insert > All Fields.

If you want to insert a single field then follow this navigation: 
Add-Ins > Insert > Field.




Remove Spacing between lines.



After using basic word formatting:



Step 5: XML Report Preview.
You can export your xml report in following formats Excel, Rich Text Format (RTF), Power Point, PDF and HTML.



Sample Output in MS Excel:



Sample Output in MS Word: