Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert

How do I know I'm ready for this? 

This is number 7 in a series of blogs on ABAP OO for workflow, so you it would be a really good idea to make sure you have worked through the first 6 blogs. The examples we'll use here continue on from those we used in the earlier blogs. Here's the list of the earlier blogs:

Which is better ABAP OO or BOR?

Clearly ABAP OO is far superior to BOR - much quicker for development, much more flexible, much less specialized - but if you are still asking this question now might be good time to go back and read the first blog "Why Use ABAP OO with Workflow?" h4. Why would you need to use BOR and ABAP OO together?  The main reason for using BOR and ABAP OO together is to access provided SAP business objects for the content. Although newer workflows are now being written using ABAP OO for Workflow - such as Leave Request/Cancellation, and HR Admin Services forms - much of the existing content was originally written using BOR and has not yet been converted to ABAP OO. Whether BOR content is ever converted to ABAP OO depends on the priorities of the specific development area so you should *NOT* wait for old content to be converted.  A secondary reason is because even though you are mainly working in ABAP OO you still want to raise events using a technique that does not yet support ABAP OO for Workflow. E.g. Status management events do not provide an ABAP OO option as yet (SAP NetWeaver 7.00 - July 2007).

How do you access a BOR object from an ABAP OO class?

The best approach is to access the BOR object as an attribute of your ABAP OO class. For our ZCL_PLANT example we have been using in the previous blogs, there is an older equivalent BOR object BUS0008. To link the BOR object to our ZCL_PLANT class we need to:

  1. Create a constant with a prefilled type for the BOR object
  2. Create an attribute for our BOR object
  3. Fill the attribute value at runtime with the key of the BOR instance
  4. Reference the BOR object in our workflows/tasks A constant is just an attribute of a class with the level "Constant" (instead of "Instance" or "Static").

The prefilled type can be created in a number of ways - you could use a type-pool or just use a direct entry type. A type-pool has the advantage of allowing you to collect all such prefilled types into one place, however for our example a direct entry type is adequate.

12 Comments