You are on page 1of 31
Getting Started with Business Object Builder eXpert Summary Having to create business applications using the Business Object Builder (BOB) tool, you will soon come across the limitations of the tool. This tutorial introduces you into the core principles of the eXpert tool, so that you can continue working on your business objects using Business Object Builder eXpert (BOBX). Level of complexity: Intermediate Time required for completion: 45 min. Author: Thea Hillenbrand Company: SAP AG Created on May 20, 2014 Ey Getting Started with - (Title Via Document Properties) TABLE OF CONTENTS BEFORE YOU START.. Objectives..niinnnns Prerequisites ‘Systems, releases, and authorizations Knowledge NAVIGATIGATING THE BO. Business Object Browser. Business Object Detail Browse? -ccnnnnnn Result. CREATE A BO vinnnssnnnnennnnnnnnnnnnnnn Start the creation wizard Propose Repository Name: Create Persistent Structure wunnnnmnnnnnne Generate Data Dictionary Elements. Generate the business object Test the BO. LT CREATE QUERIES... Create SELECTALL QUEFY nnnnnnnnnnnninnnn Create SELECT_BY_ELEMENTS Query. Generate the BO ReSUlt ssnnnnnenr CREATE SUBNODE ReSUIt nnn CREATE AN ACTION... Navigate to the implementation class RESUIt rnnmnnenrnnnnsnnnnesvnnnnsenn UTILITIES. Propose Repository NaM€S wnnnnnnnnnnnsvvnn Generate DDIC Object: Constants Interface CHECK svmmnseemn Check and Generate. SUMMARY nnsnnsnnnnnnsnnnnesennnnsenn ANNEX 9 4 30 Getting Started with - (Title Via Document Properties) BEFORE YOU START ‘The transaction BOB is a comfortable tool for enhancing and creating Business Objects but has many limitations, To bridge the gap to the availability of our Eclipse tool in SAP Business Suite EHP7 SP4, we offer the transaction BOBX (Business Object Builder eXpert). This tutorial describes the basic principles of the new tool, So that you are able to work with it. The tool, being less convenient as BOB, offers all features needed to create complex applications. The feature set is the same that we target with our Eclipse tool - so that you will be able to use both tools alternatingly. Objectives By the end of this Getting Started, you will ‘+ Understand the basic principles of the tool ‘© Be able to create or modify business objects ‘* Use the functions to find model inconsistencies The tutorial uses the same example as in the Getting Started with Business Object Framework — but focuses (on the tool specific characteristics. We recommend working through this tutorial first to get an understanding of the BOPF entities and concepts. Z_SALES_QUOTE pear AU) aa) The business object we will create is a sales quote and consists of the ROOT node with minimal header information, like QUOTE_ID, and the ITEM node with position data like PRODUCT_ID and quantity information. On the ROOT node we will see an action to change the status of the sales quote to being published, Creating these basic entities you will learn to work with the tool and apply the functions to create consistent models. Prerequisites In order to be able to perform the Getting Started, the following prerequisites have to be fulfilled Getting Started with - (Title Via Document Properties) Systems, releases, and authorizations ‘+ BOBX is part of the Business Suite Foundation Layer and, therefore, included in the following SAP Business Suite releases: = SAP Business Suite EHP6, all SP — SAP Business Suite EHP7, all SP ‘+ To implement this example, your SAP user requires the developer authorization profile (S_DEVELOP authorization object) Knowledge '» Basic knowledge in ABAP OO ‘© Experience with DDIC tools ‘+ Experience with some of the BOB tutorials. Getting Started with - (Title Via Document Properties) NAVIGATIGATING THE BO In this step you will become acquainted with the business object browser and the navigation possibilities within a business object offered by BOBX Business Object Browser Launching the transaction BOBX shows you the business object browser. O68 Business Object Browser Description Gi Transportable Business Objects » CiBusness Objects (37) » GiDependent Objects (5) + GUHOME Busness Objects » Ci Busness Objects (110) » Gibependent objects (6) » GlEnhancement Objects (4) + Gi Loc! Business Objects » Ci Busness Objects (1612) Dependent Objects (13) » GlEnhancement Objects (40) It shows three main folders: ‘+ Transportable Business Objects — which are assigned to a transportable and deliverable package ‘+ Home Business Objects — which are transportable within a company + Local Business Objects — which cannot be transported to another system Each folder can consist of the three categories: ‘+ Business Objects — which are self-contained objects + Dependent Objects — which are reusable entities living only within a business object, like IBOBF/ATTACHMENT_FOLDER ‘+ Enhancement Objects = which enhance business objects created in a cifferent layer With this tool you can create new Business or Dependent Objects, and open any business object using the toolbar functions. Business Object Processing Framework You can also browse through the objects by opening the different categories in double clicking, Getting Started with - (Title Via Document Properties) Business Object Processing Framework Oe @ Busnes Object Browser Description + Gi Transportable Business Objects - + EABusness Objects (37) Ss + @ /BOBF/CONF_INVALIDATE_ALL + © /BOBF/CONF_LIBRARY BOPF Library + @ /e0BF/CONF_MODEL ‘BOPF Configuration + @ /B08F/DEMO_ATTACHMENT_FOLDER Attachment Folder + @ /808F/DEMO_CUSTOMER ‘Customer (Demo) + © /B08F/DEMO_PRODUCT Product (Demo) + @ /808F/DEMO_SALES_ORDER Sales Order (Demo) + @ /BOBF/EPM_BUSINESS PARTNER _Bushness Partner (B« + @ /B08F/EPM_PRODUCT ‘BOPF EPM Product + @ /BOBF/EPM_SALES_INVOICE PM: Sales Invoice f + @ /B085/EPM_SALES_ORDER Sales Order (BOP ¢ © /B08F/NON_HOME_TEST_OBJECT BO for testing with + © /BOBF/TOOL_CONTRACT_CHECK _BOPF Contract Com) + @ /BOFU/ADMIN_DATA_CHECK ‘Admin Data Check + @ /Boru/ALERT ‘Alert (Netweaver A + @ /BOFU/BASIS_APPLICATION_LOG Application Log(BAL + @ /BOFU/80_FOR_TESTING_BFI ‘BO_FOR_TESTING | » @ /BOFU/BUSINESSPARTNER BusnessPartner (BU 2 namiiniauier naniMurere ns a Browsing the abet Double clicking an object, opens it in the Business Object Detail Browser. In the beginning you will get the following information message wo This message appears when an object has been created with our internal editor. Not all attribute ‘combinations possible in the internal tool will be offered in BOBX or Eclipse, Some of them are not meaningful, but the developer could have configured them. As we do not want the user to corrupt these settings implicitly, we do not offer the change mode for these objects. Currently we are working on a check 30 that BOS fiting to the restrictions of BOBX can be modified with BOBX or Eclipse. Fg & tnormaton message jet canna be changed wi BOBX one Eotpse to Anyway, we continue with the selected BO /BOBF/EPM_SALES_QUOTE in the Business Object Detail Browser. This BO is the template for the BO we will create in the next paragraph. Getting Started with - (Title Via Document Properties) Business Object Detail Browser Either you used the toolbar function Open or the double click in the browser to open a BO in the business ‘Object Detail Browser, the tool enables you to browse the entities of a BO and to edit it Display Business Object /BOBF/EPM_SALES_QUOTE, Active Version Os” #988 ‘usnes Ojo att ona. = Aanivon c | _ (B jpowrjesw sles quore "ei Sls uate ot Cinede stueure + @ root ales Quote Root Hea BUSES Object (aoa Sans COTE Active Veron + Ora eae tee eel Pa Saks Quote 80 (60°F) @ rnoouer ‘tie Category [rat sed = +O response PH SHE QUOTE RARE ssn en Onc ns Athorston eh eS TEE PTR » Clade Saments » Glconsstency croup Busnes object Settings Constants incerice (0857 5 core ¢ lax canged (Semnmmc — [oz.04.2014 17:03:01 Asrtatve Data (Oval Mode) Last changed (semamac— [o2.04. 2014 17-05-01) ‘The left hand side displays the elements of the BO, The right hand side contains an editor for each element, By double clicking you can open the editor for any element displayed in the object browser. But let's focus on the object browser on the left hand side fist. Business Object Detail Browser TBOBF/EPH_SALES QUOTE EBM: Sales Quote 80 (BOPF) ‘Einode Structure > @ ROOT Sales Quote Root (Header) Node > @ rem EDM: Sales Quote Item Node + & proouct ~ @ RESPONSE EPM: Sales Quote Responses Node @ BUSINESS PARTNER » CiNode Elements » Ciconsistency Group The first folder displays the composition tree of the BO, hence the data model of the BO. The sales quote has a ROOT node with the ITEM and RESPONSE node as composition. In the ROOT node we have a cross BO association to the BUSINESS_PARTNER and in the ITEM node one to the PRODUCT. Nodes, representing the node of another BO are marked by a different leon. So you can distinguish them easily. ‘Note: inner BO associations beside the composition relationship are not visible in the node structure tree, With the toggle button Display <-> Change you can switch to the edit mode. If this one is open, the right mouse menu presents you the features available for each element lke for example the creation of a subnode, Getting Started with - (Title Via Document Properties) Maintain Business Object /BOBF/EPM_SALES_QUOTE, Active Version oa 8H Description + @ /BOBF/EPM_SALES_QUOTE PM: Sales Quote BO (BOPF) Delete Node Delegated Node Expand Subtree Business Object Representation Node Details Helo Fg & Toggle Dspiay/Gnange mode and Features avala for nodes In the second folder Node Elements, you manage the elements describing the business logic of your object, ‘The structure nodes are presented in an alphabetical order and each of them contains the elements you can create on node level. Busness Object Detal Browser Descrpton + @ /BOBF/EPM_SALES QUOTE EPM: Sales Quote BO (BOPF) » GiNode structure , ie BUSINESS_PARTNER Qrem EPM: Sales Quote Item Node + @ proouct + @ RESPONSE EPM: Sales Quote Responses Node > @ Root Sales Quote Root (Header) Node » Cistatic Properties » GlAssociations » CiDeterminations » Civaications + EVactions » @accerT EPM: Action to Accept a Sales Quote » @ cance EPM: Action to Cancel a Sales Quote » @ CREATE_SALES_ORDER » @ PUBLISH EPM: Action to Publish a Sales Quote » @REECT EPM: Action to Reject a Sales Quote Giaueres Glatemative keys Ci authorization Objects Ga authorzation Field Mapping » Ciconsistency Group In this example we opened the ROOT node with a double click and the action folder to get an overview on the assigned actions. Each entity can be opened via double click in the editor on the right hand side. Again, the right mouse menu offers you the features available for an entity. Last but not least you can access the Consistency Group for your business object, if your BO needs one. The current example does not have any group assigned, Getting Started with - (Title Via Document Properties) Note: you have to work with consistency groups if you want that a validation prevents that an inconsistent BO instance can be saved. We do not use this feature in our example. Result We have now seen how to navigate a BO. In the next chapter we are going to create a business object to demonstrate how the tool works. Whereas the navigation possibilities in BOB, BOBX and Eclipse are more or less the same, the tool behavior is special to each tool. Nevertheless, all the tools work on the same meta data, so that you can continue with the Eclipse tool as soon as it is available in your system, CREATE ABO In this chapter we will create the SALES_QUOTE business object with a root node and the two queries supported by the framework. At the end of the chapter we will have done all manual steps necessary to get a ‘working business object. This is what we get after having run the BO creation wizard in the transaction BOB or the one in the Eclipse tool Start the creation wizard Display Business Object /BOBF/EPM_SALES_QUOTE, Active Version [ke «saa Busnes Object Detal Browser Description, + [@ /e0Br/epM SALES QUOTE ‘EDM: Sales Quote BO (BOPF) > GiNode Structure » CiNode Elements » Diconsistency Group Press the create icon in the toolbar of the business object browser or of the business object detail browser. In the following popup you have to enter the business object name. wx) Fg 11 Ener tusness ones name The default object category is Business Object. But you can also define dependent objects with BOBX, which is not possible with BOB. This is one of the additional features which you may use to structure your application, Getting Started with - (Title Via Document Properties) [z sales quote ‘BOBX Test to create a sales quote BO Fig 12 re posan toca Sper After having confirmed the popup, the business object header and the ROOT node are created. Maintain Business Object Z_SALES_QUOTE, Active Version Os” sean Busnes onc Deal rows [ne Tet to create as avte 80 + Dhconsstency crue Object Catzgay [snes Process Objet * leasness Objet has Astoezaton checks Busnes Oe Settings Fg 19. Business Oneot header and ROOT node BOB users will certainly miss the name proposals, especially for the ROOT node entities but also for the Constants Interface ‘Busnes Object Detal Browser Pg 14° ROOT ne 10 Getting Started with - (Title Via Document Properties) Propose Repository Names ‘The naming proposal can be created with the function Propose Repository Names in the menu Extras. (& Business Object Edt Goto tities [Extrs] Envronment System Help Generate Dictionary Elements Generate Constant Interface On the following popup you can specify the details. You can just accept the default. It does not harm if you marked too many check boxes, but the necessary ones are included in the selection, CAssocation Cass Name Parameter Soucture Name ‘Acton Query \Query Cass Name Cleuery structure Name Akeratwve Key (Date Type Name {ata Table Type Name Determnation Vakiaton [Zetarmnaton Cass Name ZiValdaton Cass Name x) Fg 16: Dera o propose epastory names pop Corresponding to our actual definition, itis important that the following check boxes are marked: ‘+ Constants Interface Name Combined Structure Name Combined Table Type Name Data Structure Name Database Table Name. Use the namespace or prefix feature of this function. This supports you in a consistent naming. In case of you are using the prefix, be aware. that the data dictionary names have certain restrictions. No underscore in 1 Getting Started with - (Title Via Document Properties) the second position for example. A two character prefix without underscore suffices the restrictions. Our naming proposal adds automatically an underscore after the prefix. Confirm the popup with Enter to get the following proposals on BO header and root node level Busnes Object Business Object ‘[Esutes quote T Actwe version Descrption BOBX Test to create a sales quote 60 Object Category Business Process Object ’ ‘Business Object has Authorization checks Busness Object Settings Constants interface _‘([21F_SQ 2 SALES QUOTE ¢ Node Node Name [Root Description Node Settings Node Type ‘Standard Node + CiTransient Node Data Structure Transient Structure Combined Structure Combined Table Type Implementation Node Cass Data Access, Database Table We have now created all the names for the objects we need in the BO configuration Create Persistent Structure 12 Getting Started with - (Title Via Document Properties) Inthe next step we are going to define the persistent structure in the data dictionary. Double click the ROOT node to open iin the editor. Double click on the data structure name. The system guides you through a cascade of popups — save BO, assignment to package and transport request ~ you know from other development objects. Confirm them accordingly, Finally the data dictionary tool is opened and you can define the data structure for your persistency. Please note that in older SPs the data elements used in the example do not yet exist. Use your own ones or use the predefined type feature to enter the types directly. Dictionary: Change Structure S> PB st gh gk BO A terarchyDispay Append Structure... GEEGISSES (CRETE rates roe | 1/2 ‘Typing Method a ‘Data Type Length Dec... : [ekoore 2 1D ‘Types /BOBE/EPM SQ ID CHAR 10 OF QUOTE STATUS Types /BOBE/EPM_SQ_STATUS CHAR 2 of IT + Assign an enhancement category, available in the Extras menu of the data dictionary and activate the definition. You have to confirm again the package assignment and transportation popups. Return to the BO editor by pressing F3. Generate Data Dictionary Elements Back in the BO editor we will generate the dictionary objects which are derived from the data structure definition, You find the function Generate Dictionary Elements in the Extras menu of the 8O Detail Browser. ( Busnes Object Edt Goto utittes [Extigs] Environment System Heb @ | =) JB © C__Brovose Repostory Names Maintain Business Object Z_S, —ceqerate Constant interface Ose? #68 8H Busness Object Detal Browser Des... Oz SHEE QUOTE meer a —_—_—_. FA Ninde Chrarhire rg 20° Gane fctonay emits Details can be specified on the following popup. But the defaults work in the straight forward case. So you can just confirm them. As defauit the generated objects are active in the data dictionary. Thus you can start ‘working with them immediately. In case of generation problems (e.g. using reserved names for components of the persistent data structure) the object is not activated. You can access the activation log in the data dictionary to find the root cause for the activation problems, ‘The second default is that already generated objects are not regenerated 13 Getting Started with - (Title Via Document Properties) ‘Note: Normally you do not need to select the function ‘Allow overwrite of existing dictionary objects’. The generated objects are using the include technology so that changes on the data structure apply automatically to the generated objects. Nevertheless in the beginning of a project, you may change your naming conventions and change the name ofthe data structure. In this case the feature to regenerate is useful ‘Alow overwrite of exsting dictionary objects Enhancement category [58 SARSAEEA (CRSSCESAREL. =? Node (Data Structure (¥\Combined Data Structure (¥\Combined Table Type ()Non-Unique sorted by Key (W\Database Table (Node Category on Database (viDatabase Index (Parent) (Parameter Data Structure Alternative Key (Wikey Table Type ‘The system confirms the success or failure of the generation and activation by the following popup. So you get feedback of what the function has generated ee Message | Desorpt. Element Name {@ Database table 25Q_D_ROOT has been actvated Node — ROOT {@ Database table 26Q_D ROOT has been created Node ROOT @ Structure ZSQ_.S ROOT hasbeen actwated Node ROOT @ Structure Z6Q_S_ROOT has been created Node ROOT {@ Table type Z25Q_T_ROOT has been actated Node ROOT @ Table type Z5Q_T_ROOT has been created Node ROOT Generate the business object The last step before testing is the generation of the business object. But note that BOBX stores the data always in an active version. All model changes are immediately active. The activelinactive handling as you 14 Getting Started with - (Title Via Document Properties) know it from workbench objects is only available in the Eclipse tool, The generation button in BOBX executes a consistency check of the model and regenerates the Constants Interface. Up to now we didn't work wth the Constants interface, but if you start implementing your ABAP classes for actions for example you will need it oss 9] ‘snes objec: Deal Howser Fig 22 Generate usness Obec! The function displays a protocol. | Message | Descrption | Bement Name 1B Business object has been adjusted; see ist of changes Busness Object Version Interface ZIF_SQ_Z_SALES_QUOTE_C was generated successfuly Business Object Version 24 Feecoecc ote generator Test the BO Now you can test the sales quote by pressing the test icon in the toolbar. ‘The function opens the BO Test Environment! (transaction BOBT) in a separate window. Create new instances and save them 15 Getting Started with - (Title Via Document Properties) Business Object Builder: Test =.) (EER > |8).) (Ee) ‘Z.SALES_QUOTE > ROOT B quote_w Quore status 1000 [al Fg 26, Create new instances in tne test to But you cannot select existing instances except if you know the internal key(GUID). Business Object Builder: Test [saes_quoTe SCs) 4) » @ RooT 9 27: Ony the query by key sported Result With this step we have created a working BO. But to achieve the same result as the creation wizard in BOB we have to create two queries, CREATE QUERIES ‘There are two types of queries which are provided by the framework out of the box. The SELECT_ALL query, which just selects all instances of the BO and the SELECT_BY_ELEMENTS query selecting the instances by using all elements of a node as selection parameter. In the next two chapters we will define them, Create SELECT_ALL Query Open the Node Elements Folder and the ROOT node. Select the Create Query function in the right mouse menu, either on the ROOT entry or an the Query folder. 16 Getting Started with - (Title Via Document Properties) Business Object Detal Browser Des... + @ Z SALES_QUOTE BOBX T + Gi Node Structure + @ ROOT + EB Node elements + @ ROOT » Cistatic Properties Ga Assocations avetermnations Gi vaidations ‘Fg. 26- Create auery This opens the Query Editor. Enter SELECT_ALL as query name and press enter. The screen is reduced to the relevant input fields, It is recommended to enter a description for documentation purposes. 9 29 SEL yates Create SELECT_BY_ELEMENTS Query Create anew query using the right mouse menu. On the following screen enter the query name ‘SELECT_BY_ELEMENTS. For this query you need to define the fiter structure. To enable all node attributes as selection parameters, use the combined data structure of the ROOT node. You do not have to provide an implementation ~ the query is supported by the framework 7 Getting Started with - (Title Via Document Properties) Pg sor SELECT BY ELEMENTS quay straits use te comin data site of he ROOT node Generate the BO You can generate the BO again. The Constants Interface is updated according to the BO definition {i @ Business object consistent. i @ Interface ZIF_SQ_Z_SALES_QUOTE_C was generated successfuly | Fg 31. Generation proto Test BO Restart transaction BOBT to test the queries. We created a BO step by step manually and achieved the same result as with the BO creation wizard in the transaction BOB or in Eclipse. We learned how the tool works: there is no implicit generation or convenience function. After creating an element you have to use the Propose Repository Name function to generate a consistent naming and the Generate Dictionary Elements function to generate the derived DDIC artifacts. The only convenience the tool offers is the Generate function, executing a consistency check and adapting the Constants Interface to the new definition. 18 Getting Started with - (Title Via Document Properties) CREATE SUBNODE In this chapter we will create the subnode ITEM to the ROOT node. You will see that the most important utilities are again: Propose Repository Names, Generate DDIC Elements, and the Generate button. Select the node which should be the parent of the subnode, so in this example select the ROOT node in the Business Object Detail Browser and open the right mouse menu. The menu contains the Create Subnode function. In the transaction BOB, you can only create Standard Nodes. BOBX offers more node types. Beside the standard node you can embed dependent objects (Delegated Node) and create cross BO associations (Business Object Representation Node). We are not going to describe these node types. This will be subject of further tutorials So select the Standard Node function in the menu. Busness Object Detal Browser Description sess be > @ Z SALES_QUOTE BOBX Test to create a > GNode Structure Fy sss The subnode editor opens, enter the node name ITEM. Use the Propose Repository Names in the Extras menu, to get naming proposals for all necessary artifacts. The names for some DDIC artifacts — e.g. database tables - require that the there is no underscore fon the second or third position of the name. Thus we enter a prefix to avoid error messages. The artifacts we need are already checked. You can just accept the defaults, The feature does not overwrite existing names. ‘Therefor you do not have to care for having marked too many check boxes The check boxes Data Structure Name (transient) and Node Class Name are not marked by default. You only have to check them if you have to deal with transient data in the first case or in the second case if you 19 Getting Started with - [Title Vie Document Properties) need a class to set dynamically properties, like the mandatory or read only attribute fer a field. As these are optional features, they are not marked by defautt, | Business Object | (Asodation (Constants Interface Name Associaton Cass Name Parameter Structure Name: [Breton Cass Nome Paramater Structure Name: (Query as eam DiQuery stucture tame ‘Atemative Ker (wibata Type Hare (Data Table Type taene [Deternnation Cass tare © Vakdatn Cass Hare 38 Nocossa7y ree anions ‘After having confirmed the popup, the proposed names are displayed in the node editor 20 Getting Started with - [Title Vie Document Properties) The only artifact you have to maintain manually is the Data Structure. Select it via double click and after ‘some popups conceming data loss and transportation you will navigate to the DDIC where you can define the data structure, 9.37: Dotno me ear statue are pooe in he DOC In our example we are using quantities, so we have also to care for establishing a relationship between the ‘quantity and the currency field in the DDIC. This is standard DDIC behavior. 21 ‘Getting Started with - (Title Via Documer Properties) SF VOB Bt RAGA Hewcydecy Aopentsouctue,. ‘scare fume ide Short Descipien __[EOELCDero Ss Gate Res After having activated the DDIC definition, return to the BO tool using the F3 button. We can generate the ‘derived DDIC artifacts in using the function Generate Data Dictionary Elements in the Extras menu, Again {you can just accept the defaults in the following popup. Fa 38- Generate Pa Deana Bloat The genesration lag gives you sn overview ef what has been done during generation. You can verify, that ‘the artifacts forthe ROOT node have not been touched. Only those for the newly created ITEM node have been created and successfully activated, 2 ‘Getting Started with - (Title Via Documer Properties) {@ Database index 25_0_ITEM has been acthated (@ Database index Z5Q_D_ITEM has been created Database table 25Q_D_ITEM has been activated '@ Database table 25Q_D_ITEM has been created @ Structure 259_D_ROOT akeady exsts ‘@ Structure 750_$_ITEM has been acthated @ Structure 25Q_S_ITEM has been created ‘Structure 26Q_$_ROOT akeady exists '@ Table type Z25Q_T_ITEM has been actnated ‘@ Table type ZSQ_T_ITEM has been created \@ Table type Z5Q_T_ROOT abeady exists PEPEEEL ELGG geggediaade] ‘Generate the 8 with the Generate Button. You are done now creating the subnode. Press the Test button ‘or F@ and the test tool opens in.a separate window. Create and change yaur items. Result ‘You have created a BO with a subnode which is much mere comfortable using BOB, The goal vas to show you the mechanics of the BOBX tool, so that you can use it, when you come across the limitations of BOB. In the next chapter we will ereate an action, to shew the relationship io the class builder (CREATE AN ACTION ln this chapter we will create an action an the ROOT node. Again the most important utilities are: Propose Repository Names, Generate Data Dictionary Elements, and the Generate button, ‘Open the Business Object Detail Browser for the Sales Quote BO. Switch to the edit mode. Elements ‘sefining the behavior of a BO like actions, determinations and validations are displayed in the Node Element subtree. Open this subtree. In the right mouse menu on the ROOT node you will find the function to éreate actions. Select this function Os? #68 Busness Quject Detall Browser Descrption Z_SALES_QUOTE BOBX Test to create a + ClNode Structure + CNode Elements » @ 1TH YCicers Siete Grete Asocston Where-Used List Expand Subtree Details Hep ____srrte Akerative Key 2 Getting Started with - [Title Vie Document Properties) ‘On the next screen, enter the name of the action and the cardinality, For performance reasons you should always enable the business logic for mass data processing, Therefor select the cardinality Muttiple Node Instances Os? #6a0 Fig 42 Erte acto | To get a consistent naming aerass your application, use the function Propose Repositery Names in the Extras menu. The necessary elements for an action are aiready selected. Actions may have parameters in ‘2ddition to the selected node ids. As this element is optional, the check box for proposing the parameter structure name is not selected by default. Again only names for new entities are proposed independent of the selection on the screen, So you cannot overuarite by mistake already working element names 24 Getting Started with - [Title Vie Document Properties) TParameter Stuckure Name Not icemned souctse Name {icomiined Table Type tame Data Structure Name: (bate Structure Narn (transit) Ciguery Chis tame INage Cass Mame Query Soucture Name oacbace Table tome ‘Abemative Key ibaa Type tame ogteemmnaton Coss Name F¥akdaton Cass Mare “a: See eweee arte propose me atin cs mame ‘Confirm the proposal. — Aides Read 8 wee Nodes |" node Catepory Assgnmant |” Property Change Trager | ‘Acton Name PuRLISa Desciption ] | Acton Settings: Node ROOT — ‘Acton Category [ObjectSpectc Action ‘Acton Cardinaty ‘Mutiple Node Instances. . change mode [Becisie Wete Mode * [Execute Action only € it can be executed for all NodelDs 28 Getting Started with - [Title Vie Document Properties) ‘Generate the business object. The protece! shows that the constants interface has been regenerated. Message | Description | Bement. Name (B® Busnes abject has been adjusted; see ist of changes ‘Business Object Version @ Interface ZIF_SQ_Z_SALES_QUOTE_C was generated successfuly Business Object Version Pog 48 Gowraten Protec Navigate to the implementation class The last step Is to implement the action. Double click the class name and navigate to the implementation. After some popups concerning warnings and transport attributes, enter the implementation in the class editor. The following code shows how you can set the quote status te published. met#on /bobf/if_frw_action-ex BAIR Ly_root THRE REF TO Zeq_s_reot. DATA Lt_changed_fields Tyre /bokf/t_frw_name. para ls_key wees /bobf/s_irw_key quote_status - 'P', "Publ _node_attribute-raot-quote_status LOR AT it_key INTO 1s_key. io_modi fy->upaare( ERFORTING iv_node = 2if_sq.z_d_sales_quote_c. iv_key = 1s_key-key is data = Ir_root it changed fields = 1t changed fields » ENDLOOE ‘Note! ABAP 7.40 offers @ mare coneize Syntax, ‘You wil find this example using Jhe new syntax in she ANNEX, ‘Adapt the code to your objects (constants interface, combined structure) end activate the class, Test he:aetion wih the BOPF test ool 2087. Result ‘We have re-implemented the seope of the Getting started with Business Object Processing Framework tutorial, The standard practice in BOBX is: + create an element via right mause menu in the 80 Detail Browser * define the name of the element + use the utilties in the Extras menu 26 Getting Started with - [Title Vie Document Properties) Inthe fellowing chapters we document the utlities you come across when working ‘with BOBX, UTILITIES Propose Repository Names The function Propose Repository Names in the Extras menu supports you in using a consistent naming in ‘your apalication. In smaller projects this is not so impertant, but in large projects it helps to Keep on overview ‘ofthe artfacts, And finally the develaper has less to type. Fitts Hoxton Horn Cameco Rane Cuma cre tome a ae Ears cara = ee (2bed Tite Tipe hae eee (a carer my (Data Structure Name (transient) 1 Qwery Class Marre: ‘(Mode Cass name Query Structure Name Se |Mamivetey ide Type tore (2owea Tab pte Determnabon | Wakdation ] (Boeemeaten Co are vaste stoma vin) A popup shows all object types for which names are possibly necessary. The object types are grouped by BO elements. The mandatory object types for each element are already marked. Nodes need for example the definition of a data structure, a database table name, a structure for the runtime types (combined structure including keys, persistent and transient structure) and the respective table type. Whereas associations far example da nat need any further attributes if they are modelled. So there is nothing marked by default ‘You can use this function at any time you create a new element in the BO. You do not have to care for the marked check boxes as the function dees not overwrite existing names. So you can focus en the attributes of the element you just created In the top of the popup you can define a namespace or @ prefic for the naming proposal. Take care not to violate BDIC naming conventions if you need a name propasal for DDIC objects — avoid underscores. at the ‘setond and third position by choasing an appropriate prefix. 7 Getting Started with - [Title Vie Document Properties) ‘Generate DIC Objects ‘The function Generate DDIC Objects in the Extras menu generates all ODIC objects you need for working ‘with the BO. Generaton Control [iActwate generated dicbonary objects [Alove overwrite of existing dictionary objects Enhancement category Node Assocation (oata structure: )Parameter Data Structure (WiCombined Data Structure (combined Table Type ‘Action ClWan-Unique sorted by Key Parameter Data Structure (“Database Table (|Nade Category on Database Quy ‘Database Index (Parent) Parameter Data Structure Diexcensr Alberative Key key Table Type ‘The function can be parameterized on a popup. Necessary objects are already marked by default Its proposed to activate the DDIC objects. Normally there is na need for reworking the generated objects. ‘Objects which are generated are not overwritten by default. As the generated objects are working with the include technique, there is normally no need for regeneration. Gut in the beginning cf modeling you may ‘want to change the name of the persistent structure for example. In this case you Should actively trigger the regeneration by marking the checkbox Last but not least you ean specify the enhancement eategory for the DDIC ebjects. ‘Constants Interface ‘The constants interfate contains the constants derived from the model which you need to use the BOPF APIS. If you want to read data. you have to specify the BO-name, the node naine and the association you ‘want to follow. It may happen that you need only selected data, so you may want to specify the elements to be selected. For all these entities you will find constants in the interface. ‘The constants interface is assigned at the BO level, so you need only te know one for the complete BO. This interface is implicitly genersted at esch time you setivate the BO — elther in Eclipse or in BOBX. 8 Getting Started with - [Title Vie Document Properties) ‘The regeneration of the constants interface can be triggered explicitly in the Extras menu. This function is useful after you changed a database object: e.g. added a new field in the persistent structure. The activation lof the DIC object does not trigger the regeneration of the constants interface, ‘Check This function checks the consistency of the model, For example you vill be warned ifthe implementation of an action is missing, ifthe mandatory DDIC objects are inactive or ifthe trigger condition for a determination is missing. Some of the incensistencies lead to a dump during runtime like a missing implementation class for an action, Some of the inconsistencies lead to a semantically incorrect behavior ke validations wich are hot executes when the triggers are not maintained. exp hep baoptan ame So £05 MeOMAETE peTERINAT el ceveten BEDPLETEPETEBOLATIN Gmit enn te meter) Pater $967~ ROTATE PETEMRATI 1 Caaence 2020 4 URLS ohn FURS ha rans ieee anororumsat (g tanatate eso @ tere S06 eeNETE PETER. (6a Le pert et nana re tee re 13 bwterrano GDMPLETE DeTGOT TION we ented OAs eas ats eG Deermaon 190T-REOAETE DETERNDATIN ih tuner ect ad est et all fy oe tay earns tet-Recenene penn The inconsistencies are displayed In the message area of the tool. Double click on a message to navigate to the errer lecation ‘Note: Inconsistencies do not prevent the BO of being executed. During the development phase it may be useful for example not to tagger 4 determination as it is not yet ready. For testing purpases you may add or remove a trigger to compare the results. But we advise fo run the Check function before releasing a BO for productive usage. ‘Check and Generate ‘Generation in BOBX executes the consistency check and generates the constants interface. ‘Note: In the ABAP workbench you are used to the functions activate and generate. Our backend tools (BOB and BOBX) do not support inactive versions, The Eclipse too! supports this ABAP Workbench feature. If your team is working with the Eclipse tool and BOBX in parallel, BOBX displays inactive objects. But you cannot Switch to the edit mede, You have to activate the BO in Ecligse before continuing with BOBX, ‘SUMMARY We have seen how to proceed with BOBX to create and madify business objects, BOBX is less convenient as BOB as the steps have ta be executed explicitly. On the other hand you can use the complete feature set ‘of BOPF to define your BO. ‘The mast important functions are: Propose Repository Names, Generate Data Dictionary Elements, Check and Check and Generate. This applies for all elements in the BOPF model. Now discover new features not offered by BOB like the definition of altemative keys, the embedding of dependent objects or modelled ‘associations, The features will be described in further tutorials using the Eclipse tool, Only if BOBX differs too much, these features will alsa be described in dedicated BOBX tutorials 2 Getting Started with - [Title Vie Document Properties) ANNEX Find here the implementation of the action to set the status of the sales quote to the status ‘published’ in the new concise ABAP syntax. This syntax ean be used with ABAP 7.40 METHOD /bobf/if_trw_action-exeeute. DATA( ot) = NEW zeq ¢ raot( ) ly_root-pquote_status - 'P'. "7 LOOP AT it key INTO DATA(1e key). to_madify-supdate( EXPORTING iv_nede - iv_key - is data - it changed fields ya>a0_node-root WaALUE #( 4 zif_sq_2_seles_quote_c=>sc_node_sttril ste-root-quote_status } ) ). ENDLOOP. ENDMETHOD. 30 WWwW.Sap.com eat 60. Mangere ‘St Roden Sewi psc nserom men ‘plone putin omen nmr nye ce SRI aN as ea Hinsiduinnte Stee sae or ‘etched mona ‘etree ten an a eae ae eerie srceirare Sos hao, Deeneeem atime dene ae Pace Ipabthasitthmntiost rom ecripeny eminent partner rer erosion hcpSens cme teen ee SpiSterumiatmmaatnare terns

You might also like