Here you go

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