Book Image

Oracle E-Business Suite R12 Core Development and Extension Cookbook

By : Andy Penver
Book Image

Oracle E-Business Suite R12 Core Development and Extension Cookbook

By: Andy Penver

Overview of this book

Oracle's suite of applications is used by many major businesses and public sector organizations throughout the world. The book will show you how to build different types of extensions with different toolsets with Oracle E-Business Suite R12. It will take you from start to finish with fully working examples. This book will show you how to extend Oracle E-Business Suite Release 12. You will learn highly desirable skills on how to extend the application and develop your expertise. The book will provide detailed information about why things have to be done in certain ways, and will take you through the process of how to get started, what tools are needed, how to develop working examples, and how to deploy them within the application. Learn how to extend Oracle E-Business Suite (EBS) Release 12. There are detailed examples to work through, such as how various components are configured and how we can extend standard functionality. The book focuses on core development and extension and each chapter will introduce a topic before going through working examples from start to finish. There are plenty of detailed screen shots throughout each chapter giving clear instructions of what we are doing and why. Each recipe will develop a solution that will utilize core components to that topic. The Oracle E-Business Suite R12 Core Development and Extension Cookbook focuses on starting an extension right from the beginning, to deploying it within E-Business Suite. At the end of each chapter the reader will have a good understanding of what they need to do for each area to take away, and start using it in practice. Each chapter will detail how to build an extension in the supported manner and also comes with complete fully tested code, and scripts that can be downloaded.
Table of Contents (12 chapters)
Oracle E-Business Suite R12 Core Development and Extension Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Reporting to the concurrent program output file


Now that we have written to the log file to view log information, we want to write more user-friendly information to the user. We will make this more formatted so that it provides useful information to the user about the processing that has taken place.

The tasks we are going to perform in this recipe are as follows:

  • Add a procedure to write to the output file

  • Add a cursor to get some data

  • Add code to fetch data and write to the output file

  • Run the concurrent program

  • View the concurrent program output file

Add a procedure to write to the output file

We are now going to add the code to the executable, which is our package called XXHREEBS. If you wish to view or copy the code then it can be found in the file XXHREEBS_1_6.pkb. You can compile the package body provided or use the following instructions to add the code manually.

How to do it...

To add a procedure to write to the output file perform the following steps:

  1. 1. Open SQL Developer and connect to the apps user.

  2. 2. Navigate to Packages and select the XXHREEBS package.

  3. 3. Now edit the package body.

  4. 4. Add a new procedure called write_output, shown as follows:

  5. 5. Compile the package body.

How it works...

We have now added a procedure to write messages to the concurrent program output file.

Add a cursor to get some data

We are now going to add a cursor to our procedure to get some data back so that it can be displayed in the output file.

How to do it...

To write a cursor to retrieve some data perform the following steps:

  1. 1. Edit the procedure First_Concurrent_Program and add the cursor as shown in the following image:

Note

Remember that the cursor is available in the download bundle in the XXHREEBS_1_6.pkb package.

How it works...

We have added a cursor that will return data at runtime. We want to format the data and display it in the output file.

Add code to fetch data and write to the output file

We are now going to add a cursor for loop to our procedure to get some data back, so that it can be written to the output file.

How to do it...

To add code to fetch data and write to the output file do the following:

  1. 1. Edit the First_Concurrent_Program procedure and add a cursor for loop to get the data. Make some calls to the write_output procedure to add the information to the output file as shown in the following image:

  2. 2. Compile the package body.

How it works...

For the employee record that we have entered in the person parameter we will fetch the record from the database and write the details to the output file.

Running the concurrent program

Now we want to run the concurrent program testing that the code we have just added writes messages to the log file.

How to do it...

To run the concurrent program to view the output file, perform the following:

  1. 1. Log in to Oracle with the XXEBS Extending e-Business Suite responsibility.

  2. 2. Navigate to Submit Requests and submit a single request.

  3. 3. Select the XXHR First Concurrent Program concurrent program and leave the Run Date parameter set to the default date (which is the current date).

  4. 4. Select Vision Corporation from the list of values for the Organization parameter and then click OK.

  5. 5. Select an employee record from the list of values for the Person parameter and then click OK.

  6. 6. Click on the Submit button and when prompted to submit a new request select No and the form will close down.

  7. 7. Navigate to View Requests and click on the Find button (to find all requests).

  8. 8. You should see that the concurrent program we just submitted has completed successfully. (If it is still Pending then click the refresh button until the status is Completed.)

How it works...

We have run the concurrent program to test the code that we added to write to the output file. We can now view the output to ensure that the layout is as expected.

View the concurrent program output file

Now we want to view the output file to see the messages we have written to it.

How to do it...

To open the output file to test our changes do the following:

  1. 1. Click on the View Output button and a browser window will open.

  2. 2. You will see that the messages we put into the First_Concurrent_Program package have been written to the output file as shown in the following image:

How it works...

As you can see we have generated formatted data that we have written to the output file.