Friday, 28 February 2014

Oracle E-Business Suite





Oracle Corporation's E-Business Suite (also known as Applications/Apps or EB-Suite/EBS) consists of a collection of enterprise resource planning (ERP), customer relationship management (CRM), and supply-chain management (SCM) computer applications either developed or acquired by Oracle. The software utilizes Oracle's core Oracle relational database management system technology. The E-Business Suite contains several product lines often known by short acronyms.
Significant technologies incorporated into the applications include the Oracle database technologies, (engines for RDBMS, PL/SQL, Java, .NET, HTML and XML), the "technology stack" (Oracle Forms Server, Oracle Reports Server, Apache Web Server, Oracle Discoverer,Jinitiator and Sun's Java).

Products included in the suite include:
  • Accounts payable (AP)
  • Accounts Receivables (AR)
  • General Ledger
  • Order Management (OM)
  • Oracle CRM
  • Oracle Financials
  • Oracle HRMS
  • Oracle Mobile Supply Chain Applications
  • Oracle Order Management
  • Oracle Procurement
  • Oracle Property Manager
  • Oracle Project Portfolio Management
  • Oracle Quotes
  • Oracle Transportation Management
  • Oracle Warehouse Management Systems
  • Oracle Inventory Management (INV)
  • Oracle Enterprise Asset Management
  • Shipping Execution (WSH)
Each product comprises several modules, each separately licensed.

Oracle Corporation's Supply Chain Managements (SCM) domain within the Oracle E-Business Suite contains business suites for:
  • Advanced procurement
  • Value-chain execution
  • Product lifecycle management
  • Asset lifecycle management
  • Manufacturing, value-chain planning
  • Order fulfillment



Reference : Wikipedia 

How To Turn Off Low-Level Diagnostic Logging

Problems :
Oracle APPS getting slowly? There's a sentence shows "Low-level Diagnostic Logging is turned on. This may temporarily reduce performance"? How can this be disabled / turned off?

Solution :


Disable diagnostic logging with the following steps:

1. Login as a user with System Administrator responsibility and then navigate to:  Profile > System.

Set the following profile option at the User level:

FND: Debug Log Enabled = No




2. Logout of the application. You may also want to clear the browser's cache.

3. Login again and confirm that the message no longer appears.


Cheers ^_^


reference : Oracle Support (Doc ID 1326490.1)



Close Production Batch Oracle EBS (Calling API)

DECLARE
   CURSOR c1
   IS
      SELECT batch_id, SYSDATE - 1 actual_cmplt_date,
             SYSDATE - 1 batch_close_date
        FROM gme_batch_header
       WHERE batch_status = 3;

   l_batch_header_rec         gme_batch_header%ROWTYPE;
   x_batch_header_rec         gme_batch_header%ROWTYPE;
   x_message_count            NUMBER                        := 0;
   x_message_list             VARCHAR2 (4000)               := NULL;
   x_return_status            VARCHAR2 (1)                  := 'U';
   l_msg_index_out            NUMBER                        := 0;
   mtl_line_exc               EXCEPTION;
   l_exception_material_tbl   gme_common_pvt.exceptions_tab;
BEGIN
   FOR r1 IN c1
   LOOP
      fnd_global.apps_initialize (user_id           => 1114,
                                  resp_id           => 23326,
                                  resp_appl_id      => 552
                                 );
      l_batch_header_rec.batch_id := r1.batch_id;
      l_batch_header_rec.batch_close_date := r1.batch_close_date;
      gme_api_pub.close_batch
                      (p_api_version                 => 2.0,
                       p_validation_level            => apps.gme_common_pvt.g_max_errors,
                       p_init_msg_list               => apps.fnd_api.g_true,
                       p_commit                      => apps.fnd_api.g_false,
                       x_message_count               => x_message_count,
                       x_message_list                => x_message_list,
                       x_return_status               => x_return_status,
                       p_batch_header_rec            => l_batch_header_rec,
                       x_batch_header_rec            => x_batch_header_rec,
                       p_org_code                    => NULL
                      );
      COMMIT;
      DBMS_OUTPUT.put_line (x_return_status);

      IF x_return_status = fnd_api.g_ret_sts_success
      THEN
         COMMIT;
      ELSE
         IF x_message_count = 1
         THEN
            RAISE mtl_line_exc;
         ELSE
            FOR j IN 1 .. x_message_count
            LOOP
               fnd_msg_pub.get (p_msg_index          => j,
                                p_encoded            => 'F',
                                p_data               => x_message_list,
                                p_msg_index_out      => l_msg_index_out
                               );
               RAISE mtl_line_exc;
               DBMS_OUTPUT.put_line (x_message_list);
            END LOOP;
         END IF;
      END IF;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (x_return_status);
      DBMS_OUTPUT.put_line (x_message_list);

END;

Complete Production Batch Oracle EBS (Calling API)

DECLARE
   CURSOR c1
   IS
   
      SELECT batch_id, sysdate -1 actual_cmplt_date, sysdate-1 batch_close_date
        FROM gme_batch_header
       WHERE batch_status = 2;

   l_batch_header_rec   gme_batch_header%ROWTYPE;
   x_batch_header_rec   gme_batch_header%ROWTYPE;
   x_message_count      NUMBER                     := 0;
   x_message_list       VARCHAR2 (4000)            := NULL;
   x_return_status      VARCHAR2 (1)               := 'U';
   l_msg_index_out            NUMBER                           := 0;
   mtl_line_exc               EXCEPTION;
   l_exception_material_tbl gme_common_pvt.exceptions_tab;
BEGIN
   FOR r1 IN c1
   LOOP
      fnd_global.apps_initialize (user_id           => 1114,
                                  resp_id           => 23326,
                                  resp_appl_id      => 552
                                 );
      l_batch_header_rec.batch_id := r1.batch_id;
      l_batch_header_rec.actual_cmplt_date:=r1.actual_cmplt_date; 
      --l_batch_header_rec.batch_close_date:=r1.batch_close_date;
      
      gme_api_pub.complete_batch (p_api_version=> 2.0,
                                p_validation_level      => APPS.GME_COMMON_PVT.G_MAX_ERRORS,
                                p_init_msg_list         => APPS.FND_API.G_TRUE,
                                p_commit                => APPS.FND_API.G_FALSE,
                                x_message_count         => x_message_count,
                                x_message_list          => x_message_list,
                                x_return_status         => x_return_status,
                                p_batch_header_rec      => l_batch_header_rec,
                                p_org_code              => NULL,
                                P_IGNORE_EXCEPTION       => FND_API.G_TRUE,
                                P_VALIDATE_FLEXFIELDS    => FND_API.G_FALSE,
                                x_batch_header_rec      => x_batch_header_rec
                                ,x_exception_material_tbl=>l_exception_material_tbl
                               );
      COMMIT;
      DBMS_OUTPUT.put_line (x_return_status);

      IF x_return_status = fnd_api.g_ret_sts_success
      THEN
         COMMIT;
      ELSE
         IF x_message_count = 1
         THEN
            RAISE mtl_line_exc;
         ELSE
            FOR j IN 1 .. x_message_count
            LOOP
               fnd_msg_pub.get (p_msg_index          => j,
                                p_encoded            => 'F',
                                p_data               => x_message_list,
                                p_msg_index_out      => l_msg_index_out
                               );
               RAISE mtl_line_exc;
               DBMS_OUTPUT.put_line (x_message_list);
            END LOOP;
         END IF;
      END IF;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (x_return_status);
      DBMS_OUTPUT.put_line (x_message_list);

END;

Revert WIP Production Batch Oracle EBS (Calling API)

DECLARE
   CURSOR c1
   IS
   
      SELECT batch_id, actual_cmplt_date, batch_close_date
        FROM gme_batch_header
       WHERE batch_status = 3;

   l_batch_header_rec   gme_batch_header%ROWTYPE;
   x_batch_header_rec   gme_batch_header%ROWTYPE;
   x_message_count      NUMBER                     := 0;
   x_message_list       VARCHAR2 (4000)            := NULL;
   x_return_status      VARCHAR2 (1)               := 'U';
   l_msg_index_out            NUMBER                           := 0;
   mtl_line_exc               EXCEPTION;
BEGIN
   FOR r1 IN c1
   LOOP
      fnd_global.apps_initialize (user_id           => 1114,
                                  resp_id           => 23326,
                                  resp_appl_id      => 552
                                 );
      l_batch_header_rec.batch_id := r1.batch_id;
      gme_api_pub.revert_batch (p_validation_level      => APPS.GME_COMMON_PVT.G_MAX_ERRORS,
                                p_init_msg_list         => APPS.FND_API.G_TRUE,
                                p_commit                => APPS.FND_API.G_FALSE,
                                x_message_count         => x_message_count,
                                x_message_list          => x_message_list,
                                x_return_status         => x_return_status,
                                p_batch_header_rec      => l_batch_header_rec,
                                p_org_code              => NULL,
                                x_batch_header_rec      => x_batch_header_rec
                               );
      COMMIT;
      DBMS_OUTPUT.put_line (x_return_status);

      IF x_return_status = fnd_api.g_ret_sts_success
      THEN
         COMMIT;
      ELSE
         IF x_message_count = 1
         THEN
            RAISE mtl_line_exc;
         ELSE
            FOR j IN 1 .. x_message_count
            LOOP
               fnd_msg_pub.get (p_msg_index          => j,
                                p_encoded            => 'F',
                                p_data               => x_message_list,
                                p_msg_index_out      => l_msg_index_out
                               );
               RAISE mtl_line_exc;
               DBMS_OUTPUT.put_line (x_message_list);
            END LOOP;
         END IF;
      END IF;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (x_return_status);
      DBMS_OUTPUT.put_line (x_message_list);

END;

Thursday, 27 February 2014

Re-open Production Batch Oracle EBS (Calling API)

DECLARE
   CURSOR c1
   IS
      SELECT batch_id, actual_cmplt_date, batch_close_date
        FROM gme_batch_header
       WHERE batch_status = 4;

   l_batch_header_rec   gme_batch_header%ROWTYPE;
   x_batch_header_rec   gme_batch_header%ROWTYPE;
   x_message_count      NUMBER                     := 0;
   x_message_list       VARCHAR2 (4000)            := NULL;
   x_return_status      VARCHAR2 (1)               := 'U';
   l_msg_index_out      NUMBER                           := 0;
   mtl_line_exc         EXCEPTION;
BEGIN
   FOR r1 IN c1
   LOOP
      fnd_global.apps_initialize (user_id           => 1114,
                                  resp_id           => 23326,
                                  resp_appl_id      => 552
                                 );
      l_batch_header_rec.batch_id := r1.batch_id;
      gme_api_pub.reopen_batch (p_commit                => 'TRUE',
                                x_message_count         => x_message_count,
                                x_message_list          => x_message_list,
                                x_return_status         => x_return_status,
                                p_batch_header_rec      => l_batch_header_rec,
                                p_org_code              => NULL,
                                x_batch_header_rec      => x_batch_header_rec
                               );
      COMMIT;
      DBMS_OUTPUT.put_line (x_return_status);

      IF x_return_status = fnd_api.g_ret_sts_success
      THEN
         COMMIT;
      ELSE
         IF x_message_count = 1
         THEN
            RAISE mtl_line_exc;
         ELSE
            FOR j IN 1 .. x_message_count
            LOOP
               fnd_msg_pub.get (p_msg_index          => j,
                                p_encoded            => 'F',
                                p_data               => x_message_list,
                                p_msg_index_out      => l_msg_index_out
                               );
               RAISE mtl_line_exc;
               DBMS_OUTPUT.put_line (x_message_list);
            END LOOP;
         END IF;
      END IF;
   END LOOP;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (x_return_status);
      DBMS_OUTPUT.put_line (x_message_list);
END;

Wednesday, 26 February 2014

Terminate Employee Oracle EBS (Calling API)

Employee data could be terminated from back end using oracle HRMS API (HR_EX_EMPLOYEE_API.ACTUAL_TERMINATION_EMP).

Declare
CURSOR c_emp_cur
      IS
         SELECT ppos.period_of_service_id, ppos.object_version_number,
                papf.person_type_id, yte.termination_date end_date, yte.ID
           FROM per_all_people_f papf,
                per_periods_of_service ppos,
                ynppo_temp_employee yte
          WHERE papf.person_id = ppos.person_id
            AND SYSDATE BETWEEN papf.effective_start_date
                            AND papf.effective_end_date
            AND SYSDATE BETWEEN ppos.date_start
                            AND COALESCE (ppos.projected_termination_date,
                                          actual_termination_date,
                                          SYSDATE
                                         )
            AND yte.employee_code = papf.employee_number
            AND yte.flag = 'T'
            AND yte.status IS NULL;

      l_validate                       BOOLEAN        := FALSE;
      l_period_of_service_id           NUMBER;
      l_object_version_number          NUMBER;
      l_actual_notice_period_date      DATE;
      l_effective_date                 DATE;
      l_supervisor_warning             BOOLEAN;
      l_event_warning                  BOOLEAN;
      l_interview_warning              BOOLEAN;
      l_review_warning                 BOOLEAN;
      l_recruiter_warning              BOOLEAN;
      l_asg_future_changes_warning     BOOLEAN;
      l_f_asg_future_changes_warning   BOOLEAN;
      l_pay_proposal_warning           BOOLEAN;
      l_dod_warning                    BOOLEAN;
      l_final_process_date             DATE;
      l_org_now_no_manager_warning     BOOLEAN;
      l_entries_changed_warning        VARCHAR2 (255);
      l_f_entries_changed_warning      VARCHAR2 (255);
      l_alu_change_warning             VARCHAR2 (255);
      l_person_type_id                 NUMBER;
      l_last_std_process_date_out      DATE;
   BEGIN
      FOR c_emp_rec IN c_emp_cur
      LOOP
         l_period_of_service_id := c_emp_rec.period_of_service_id;
         l_object_version_number := c_emp_rec.object_version_number;
         l_actual_notice_period_date := c_emp_rec.end_date;
         l_effective_date := c_emp_rec.end_date;
         l_person_type_id := c_emp_rec.person_type_id;

         BEGIN
            hr_ex_employee_api.actual_termination_emp
               (p_validate                        => l_validate,
                p_effective_date                  => l_effective_date,
                p_period_of_service_id            => l_period_of_service_id,
                p_object_version_number           => l_object_version_number,
                p_actual_termination_date         => l_actual_notice_period_date,
                p_last_standard_process_date      => l_actual_notice_period_date,
                --p_person_type_id => l_person_type_id,
                --,p_leaving_reason => 'RESS'
                p_last_std_process_date_out       => l_last_std_process_date_out,
                p_supervisor_warning              => l_supervisor_warning,
                p_event_warning                   => l_event_warning,
                p_interview_warning               => l_interview_warning,
                p_review_warning                  => l_review_warning,
                p_recruiter_warning               => l_recruiter_warning,
                p_asg_future_changes_warning      => l_asg_future_changes_warning,
                p_entries_changed_warning         => l_entries_changed_warning,
                p_pay_proposal_warning            => l_pay_proposal_warning,
                p_dod_warning                     => l_dod_warning,
                p_alu_change_warning              => l_alu_change_warning
               );

            UPDATE ynppo_temp_employee
               SET status = 'Terminated'
             WHERE ID = c_emp_rec.ID;
         
         EXCEPTION
            WHEN OTHERS
            THEN
               UPDATE ynppo_temp_employee
                  SET status = 'Not Terminated'
                WHERE ID = c_emp_rec.ID;
                dbms_output.put_line(SQLERRM);
         END;
      END LOOP;
   END;



The YNPPO_TEMP_EMPLOYEE is staging table to store employee data which will be terminated using API.