You are on page 1of 108
Julia Bender Marko Degenkolb Thomas Frambach Christian Guenther Simon Hoeg Heike Leopold Hans-Dieter Loew Martin Luenzmann Ulrich Miller Stefan-Claudius Mueller Harish Rama Rao ERP. FPM Cookbook Version 2.1 August 26, 2008 ‘We are still working on this document to improve it, Please check from time to time for a ‘newer version on the FPM WIKI page: htps://wiki pal sop.corp:8443/isplay/FPM/Home Please send feedback to: Dick Becker (0022554) FPM Cookbook Table of Contents: 1 Introduction 1.1 Support. 1.2 Prerequisites .. 1.2.1 Development Skills 6 1.2.2 System Requirements....c..rssneninninnnnienatinnnnnensneeiee 6 1.2.3 Important Expressions and Terms. 6 2 Creating Simple FPM Applications 2.1 Providing UI Building Blocks. 2.2 Creating Very Simple Applications. 2.2.4 Creating a Simple OIF Application. 2.2.2 Creating a Simple GAF Application 12 2.2.3 Creating a Simple Header (OIF and GAF) 13 2.3 What an FPM Based Application can Cont 2.3.1 Configuration of the Toolbar. 2.8.1.1 General Information 2.3.1.2 01F Toolbar 2.8.1.3 GAF Toolbar. 2.8.2 Configuration of the Header 2.8.3 Configuration of the Primary Help. jure Statically During Design 2.4 FPM Events.. 2.4.1 Raising Standard Events. 23 2.4.2 Triggering Application Specific Events. 23 2.4.3 Reacting to Framework Events ..... 2.4.3.1 WDDOINIT 2.4.3.2 WODOBEFOREACTION. 2.4.3.3 Action handler (ONACTION...) 2.4.3.4 |F_FPM_Ul_BUILDING_BLOCK~FLUSH...css:csssnsesmmntnnstneesosn osnennennaenneeeie BS 2.4.3.5 |F_FPM_UI_BUILDING_BLOCK~NEEDS_CONFIRMATION 25 2.4.3.6 F_FPM_UI_BUILDING_BLOCK~PROCESS_EVENT....cnsssnsenneoe sonnnnnenanenseee 85 2.4.3.7 F_FPM_U|_BUILDING_BLOCK~AFTER FAILED EVENT 26 2.4.3.8 F_FPM_U|_BUILDING_BLOCK~PROCESS_BEFORE_OUTPUT .sssansnenstnntnnennse 28 2.4.4 Triggering a Data-loss Popup. 28 2.5 Initial Screen. 27 2.6 Confirmation Screen 2.8.4 Confirmation Screen in OIF esse 2.6.2 Confirmation Screen in GAF. 2.7 Using FPM Message Manager. FPM Cookbook 3 FPM Generic UI Bi 3.1 Form UIBB 3.1.1 Configuring a Form . senennnnnnnesnnenn D2 3.1.1.1 Add a Group to a Form 34 3.1.1.2 Configure a Group ... 3.1.1.3 Configure Fields. 3.1.4.4 Using Melting GroUups...srsnsrnnsenntsen nnennienntiennesnnie vennsenn 3.1.1.5 Using Button Rows 39, 3.1.2 Configuration to run a FORM GUIBB. 3.2 List UIBI 3.2.4 General at 3.2.2 Implementing a feeder class. vntenieenennnneniee sevens All 3.2.3 Creating a configuration. at 3.2.3.2 The toolbar . 42 3.2.3.3 The settings 43 3.2.4 FPM eventing and the GUIBB list... 43 3.3 Tabbed UIBB. 3.3.1 General 3.3.2 Creating an Application That Contains a Tabbed UIBB..nernseeern 3.3.3 Changing the Tabbed UIBB Dynamically at Runtime 4 Using Advanced FPM Features. 4.1 Variants. 4.2 Substeps in a GAF Roadmap. 48 4.3 Using Application Parameters. 49 4.4 Dynamic Adjustments. 4.4.1 Adjusting the Toolbar Using the CNR API 50 4.4.1.1 General Information wenn 4.4.1.2 OIF Specific Parameters. 4.4.1.3 GAF Specific Parameters. see so 4.4.2 Changing the IDR at Runtime. 54 4.4.2.1 Header Area... 4.4.2.2 Ticket Area 4.4.2.3 Items Area... 4.5 Sharing Data Across Different User Interface Building Blocks. 55 4.5.1 Using a Shared Data Component. 55 4.8.2 Other Options 56 4.6 Using an Application Specific Configuration Controller 4.6.1 Event Cancellation. 4.6.2 Selecting a Variant. 4.6.3 Adjustment of Events. 4.6.4 Read the Configuration at Runtime... FPM Cookbook 4.8.5 Change the Configuration at Runtime, 58 4.7 Using an Application Controller . 4.8 Handling of Transaction: 4.9 Navigation API. 4.9.1 How to Access the Navigation APIs... sesnnnnn 4.9.1. Interface IF_FPM_NAVIGATION (Runtime class CL_FPM_ NAVIGATION) 66 4.9.1.2 Integration: Navigation in the Eventloop .. 4.9.1.3 Interface IF_FPM_NAVIGATE_TO. 4.10 Navigation Customizing 4.10.1 Creating a New Launchpad 70 4.10.2 General Settings. n 4.10.3 Source Parameter. seeennnnnnneTl 4.10.4 Parameter Mapping. 72 4.10.5 Copy a Whole Launchpad ..... ssennnnnnnn TR 4.10.6 Copy Applications From one Launchpad to Anothor Launchpad 73 4.10.7. Searching Over all Launchpad of a Client. ssemnnnnseeTS 4.10.8 Display a SAP Delivered Launchpad if a Customer Version Exists 73 4.10.9 Transport 74 5 FPM for Experts. 5.1 Handling of Application Specific Popups. 5.2 Skipping the Initial Screen 5.3 Work-Protect Mod: 5.4 Transient UIBBs and Resource Manager Interface. 5.4.1 Setting the Transient Flag . 5.4.2 Using the IF_FPM_RESOURCE_ MANAGER to Veto the Release Decision 83 5.5 Application Specific Commit 5.6 Suspend & Resume. 5.7 Embedding an FPM.. 5.8 Detailed FPM Message Manager Documentation. 5.8.1 Message Area. 5.8.2 Message Manager Interface. 5.8.3 API Method Documentation 5.8.3.1 Public Methods 5.8.3.2 Description of the Parameters: 5.8.3.3 Notes 5.8.4 Additional Functionality Oftered by FPM Message Manager... 5.8.5 FAQ on the Message Manager 5.9 Link to Configurat n Editor in FPM Application .. FPM Cookbook 5.10 Detailed Description of Feeder Classe: 5.10.1 Detailed Description of Interface IF_FPM_GUIBB_FORM..... 5.10.2 Detailed Description of Interface IF_FPM_GUIBB_LIST...... 106 108 108 FPM Cookbook 1 Introduction FPM (Floorplan Manager) for Web Dynpro ABAP is a framework to configure Uls (user interfaces) based on the OIF (Object Instance Floorplan) or the GAF (Guided Activity Floorplan). The following cookbook provides you with easy to use instructions on how to use the FPM. Chapter 2 describes the basic functionality of FPM. This allows you to create simple FPM applications. Chapter 3 describes the standard FPM UI Building Blocks Chapter 4 describes more advanced FPM functionality, including the dynamic behavior of the header area which is called the IDR (Identification Region), the dynamic behavior of the toolbar, the data sharing between different views and event handling Chapter 5 collects all expert functionality of FPM which is helpful on occasion, but not needed for most of the applications. 1.1 Support The CSS component for FPM is BC-WD-CMP-FPM (Floorplanmanager Web Dynpro ABAP). 1.2 Prerequisites 1.2.1. Development Skills Knowledge of ABAP OO and Web Dynpro for ABAP 1.2.2 System Requirements This document describes FPM as itis available with SAP_ABA 7.01 and SAP_ABA7.11 1.2.3 Important Expressions and Terms + User Interface Building Block (UIBB) From an FPM point of view those are the visual parts on the overall screen that come from the application. Technically spoken itis aWD ABAP window (in other words an intertace-view). Furthermore it is necessary that the WD ABAP component to which the window belongs implements ‘the WD ABAP interface Interface IF_FPM_UI_BUILDING_BLOCK. The content of a UIBB can be chosen freely by the applications. The technical key for a UIBB consists of the name of the WD. ABAP component, the name of the WD ABAP window and optionally a configuration ID for that WD ABAP component (i. e. the name, type and id of such an configuration). FPM Cookbook 2 Creating Simple FPM Applications 2.1 Providing UI Building Blocks The main task of FPM is to connect the subscreens provided by the applications. As FPM is a framework for WD ABAP based applications, these subscreens are WD ABAP Interface Views. In FPM these subscreens. are called UIBB or User Interface Building Blocks. In order to communicate with the FPM Framework, it is mandatory that the WD component{s) providing the UIBBs implement(s) at least the WD Interface IF_FPM_UI_BUILDING_BLOCK (see screenshot) FPM Cookbook eae aco soa] Soe — We, Senos er = ona one Brow This interface ensures that the application can take part in the FPM event loop; it consists of the following methods: FLUSH This method can be used to transport data from your UIBB to a central data model. Itis the first method to be called for each UIBB visible in the application. NEEDS_CONFIRMATION With this method a UIBB can trigger a data-loss popup before the event processing is continued PROCESS_EVENT Within this method the UIBBs should do all event processing AFTER FAILED EVENT This method is called after an event has failed. PROCESS BEFORE OUTPUT This method is called for all UIBBs which will be visible after the event processing is finished 2.2 Creating Very Simple Applications To start with, create a Web Dynpro application with the following set of parameters: On GAF Component FPM_OIF COMPONENT | FPM_GAF_COMPONENT Interface View FPM_WINDOW Plug Name DEFAULT FPM Cookbook If you have not already done so, you need to create your UIBBs (User Interface Building Blocks). The WD. component that you create will need to implement at least the IF_FPM_UI_BUILDING_BLOCK WD interface. Only when this is implemented FPM will know that the Interface views from this component are Participating in the final view composition. For more information on UIBBs see chapter 2.3. As the next step, you have to create a configuration for your application. To do this, call the FPM Configuration Editor for your new application (the easiest way is to call it out of SE80, see screensho!). Zeerectecconmcer 2 Scope 1 Becca Bec 1 coven se ‘The FPM Configuration Editor is a Web Dynpro application itself and will start in a browser: Editor for the Web Dynpro ABAP Application Configuration | Which application do you wont te configure? Antec None: ZBI agent To create an application configuration, enter a configuration name and press the Create button (Configuration names are globall You can not use the same configuration name for different applications). An application configuration is simply a composition of different component configurations. An FPM application is composed of a number of different Web Dynpro components; however most of them are created dynamically at runtime. There are only 2 components which are always present: a floorplan specific component (FPM_GAF COMPONENT for GAF and FPM_OIF_COMPONENT for OIF) and a component for the Header Area (FPM_IDR_COMPONENT). So, the main task in configuring an FPM application is the Configuration of these two components. FPM Cookbook After you have created the application configuration, the screen looks more or less like the following screenshot: Application Configuration Z_DEMOL Nevsiaten] | [Desi] | [Test] sennaes | Brueture | AoncatenParanctes ‘Assignment of Component Configurations comeneet Use ompercet Ipeentaton Configuration +R USAGE FY JOR COMPONENT FPu.px_powronen In the hierarchical table the basic component structure of any FPM application is cisplayed — the main component is FPM_OIF_COMPONENT for an OIF (or FPM_GAF_COMPONENT for a GAF). This component uses a 2™' component, which is FPM_IDR_COMPONENT. In order to create component configurations you have to enter the name in the Configuration column of this table, mark the line and press Go to Component Configuration For very basic applications there is no need to configure the header. Therefore simply create a configuration for the main component. This configuration is now specific to each floorplan, 2.2.1 Creating a Simple OIF Application After you have created the configuration for component FPM_OIF_COMPONENT your screen should look more or less like this: Component Configuration Z_DEMO3_OIF ae (be) RASA] [De] ew Conenntsts Fe e veer ETT Application titte ‘ “unseen Tz] (aasreareeme] feecir —_ Sa (Bena [caer —— © Osa vt cme £5640 nee Dilan ves ree ‘ey SCREEN) (ko Connguraten ems > Totes FPM Cookbook On this screen your component configuration is displayed within the FPM Configuration Editor. On the left- hand side there is the Navigation Area to hierarchically display the configured entities. In the middle of the soreen the Preview Area is displayed. In the Action Area on the right-hand side the different entities of a floorplan can be added, e.g. toolbar buttons, main views or UIBBs. To edit the attributes of an element, e.g. a toolbar button, you have two options. Either you select the appropriate element on the left-hand side within the Hierarchy or you select the element directly within the Preview Area the attributes can then be edited in the lower-middle part of the FPM Configuration Editor. For a simple application you will need one variant, one main view and one subview. Those entities are provided automatically by the FPM Configuration Ecitor (with default IDs and names). For each view that you want to have in your application you have to create a main view (the name you provide here will be displayed as the name of the tab). Note: The Id has to follow the guidelines for creating ids (like no spaces, no special characters except underscore etc.) The OIF allows you to use subviews for complex applications. These will be rendered as links within each tab. Therefore each OIF application must have at least one subview for each main view. Provided that you only specify one subview there will be no subview rendering at runtime and therefore the name and id of the subview are irrelevant. If you specify more than one subview for a main view then the subview name will be displayed as the link text. During design-time the subviews always will be visible so that you can see what you have configured inside the FPM Configuration Ecitor. Finally, you have to add the UI Building Blocks (UIBB) to each subview. The FPM Configuration Editor automatically provides you with a default UIBB. An application must have at least one UIBB for each subview, but you can add as many UIBBs as you like to each subview. These UIBBs will be rendered one beneath the other. When specifying a UIBB, you must enter a component and view for the field, where the component is the name of the Web Dynpro component implementing IF_FPM_UI_BUILDING_BLOCK and the view is the name of the interface view containing the view to be displayed The UIBB here is simply the interface view that has been defined in your application. The interface view of your application is the smallest unit of application UI that can be configured. By assigning the interface view as a UIBB you are in effect composing how your application content area will look when the application runs within FPM. The component name should be the name of your application component. The view should be the name of your interface view. For a simple application, you can leave the default values for the rest of the fields When configuration of a simple OIF with 2 main views is complete, it should look lke this: FPM Cookbook ues CB) Create 220 (a) IB Amnbutes UE SCREEN ao 2.2.2 Creating a Simple GAF Application Unlike an OIF the GAF is composed of several roadmap steps and the UIBBs will be assigned to those ‘steps. One roadmap step may contain one or more UIBBS. ‘A simple configuration for the component FPM_GAF_COMPONENT could look like this: (a a) | (RR) | ewe Grenson mea “Application tte ct mane »— —__3}_ _——_5)}__—}- +} 4s) oe easoees ota vsometnn omen Peer Snin oR] Peete Tie aaa 90 6) Corgnotnne MOA SOK OT 7 O vee we) ate! > Chm nse + ean bene en ————— Tea BB Aes UBB W_FRST STEP em] » se tonnes » hehe > Cate ee L Li In the above example four main steps are declared. You have to populate valid data for the following entities: hye it FPM Cookbook + VARIANT: Is already provided by the FPM Configuration Editor. An application must have at least one variant + MAINSTEP: Enter qualifiers for the id and name. The entity name will be shown at runtime beneath the corresponding main step. + MAINSTEP_UIBB: Enter the values for Component and View as depicted above via the red arrows. If you make a very simple GAF application, all views will belong to a single WD component. Therefore the component in all entries for MAINSTEP_UIBB will be the same. In the field View put the name of the WD interface-view (not the name of the WD view itself. 2.2.3 Creating a Simple Header (OIF and GAF) ‘Save your configuration, go back to the application configuration and now create a simple configuration for the FPM_IDR_COMPONENT, just as you did for FPM_OIF_COMPONENT for an OIF (or FPM_GAF_COMPONENT for a GAF). That could look like this’ ear a Survey about airlines and their meals aR ent | ~ Gcompearcrtet MESS > AmtuwsoRBasie Fr Acoewnvs Eaareaaaa) —venwcrttn Enter values for your application title and tooltip as displayed above. This is the basic data you have to provide when creating an IDR. Within an OIF you have the possibility to add an extended IDR (via button ‘Add IDR Extended’) ~ in a GAF this area won't be displayed at all. Save the configuration and go back to the application configuration. The first very simple application is finished now. Press the button “test” and see how it works. 2.3 What an FPM Based Application can Configure Statically During Design Time 2.3.1 Configuration of the Toolbar 2.3.1.1 General Information Within the FPM Toolbar the application can configure the use of standard buttons/button-choices, self- configured buttons/button-choices and navigation menu bars. The attribute “Duplicate toolbar” can be directly linked to the toolbar nade within the Configuration Editor Hierarchy. This can be set in such a way that the toolbar is duplicated on the very bottom of the screen (see screenshot). FPM Cookbook Component Configuration Z_DEMO1_OIF a (ra |G] | vw sent ETT Application title ‘ ftancoun (aion (anew oD = oo haere eo One of the features of FPM is that the toolbar is automatically built-up according to the current Ul-Guidetines. This means that the available standard buttons (like edit, print, check, ...) just have to be made visible via the configuration and they are placed automatically in the correct sequence within the toolbar (see next screenshot below). For a few standard buttons itis possible to set the label and a tooltip because these texts are application-specitic (e.g. ‘next object’, there the ‘object’ should be replaced by the name of the object's type). To add a Ul-Element to the toolbar press the button ‘Add Toolbar Element’ in the Action Area on the right hand side. The following dialog will be displayed: (Semen ca [EE] [erty oe [ ) ) (etre its) RT (ST [Sete [ob (SHT HA) en net npr ‘You can choose between various kinds of Ul-Elements: ‘Standard button or button choices can be defined. Each of those standard buttons is connected to a certain FPM-Event (the edit button has o.g. the FPM-Event cl_fpm_event=>gc_event_edit). The connection to those FPM-Events is hard-coded and cannot be changed. Some of those events are handled by the FPM (Navigation events, Save) but, for most events, the FPM only ensures that all affected UIBBs are informed. Any event processing has to be done by the applications themselves. This means, for example, that although the FPM offers a print button, there is no print support in FPM. This button is only offered to ensure that i's rendered according to the Ul Guidelines. Any print functionality has to be implemented by the applications. hye FPM Cookbook ‘The CLOSE button is a special case. Basically itis made available for every FPM application and is not configurable at all - that’s why nothing happens when you select i. If you want to hide this button for some reason ~ e.g, your application is executed within an iView on a portal page, please refer to chapters 4.3 and 4.4.1, Regarding the availability of the CLOSE button please also have a look into CSN note #1234843, ‘There are certain standard buttons which can be made available as button-choices as well (print, print preview, send and new). Please note, if both are marked as visible (the print button as well as the print button-choice), then only the button is rendered within the toolbar! ve TS “Application title sar) vw (epwen [cco] 190 6) (sues Vise eh SPS MPD =O vat vee > Eh ere wide Suton: Chee Crem [Bae] veo (Bae By creating a button-choice you can define several menu items with certain properties. For those entries there are no predefined FPM Event IDs within the FPM. Instead you have to define your own event name in the column Event ID. This event will be raised by the FPM when this menu entry is presse nye FPM Cookbook ome TE “Application tiie 2 cenieton Sra =I ——e Ba woe = 9 7 O vesart att ‘coucurent Nave: ZEST FERS. COWEL seni SCORN GI cnfointene LIL es sc © Atributes ButonChoice: Assign ors Seaanerniee (o) ttt ‘ene rate tee eet: Finally every floorplan includes Other Functions. Here you can define application-speciic buttons/button- ‘choices/separators. You can define the sequence of those elements can be defined using the attribute "Sequence Index’. You should also set a separate FPM Eventld, The attribute ‘Element ID’ is only relevant, if you want to change the properties of a Ul-Element dynamically during runtime. venee Saat “Application title Seem) ssnsoue (ins) am] | (aarow EES (ssn) (ase — tw (aa) (ates = AtnbutesButon Stan Worn rm uae ost cnet Steno i i senete hye ib FPM Cookbook To configure the navigation menu bars, you can add the Ul-Elements called ‘You can also’ and ‘Related Links’, In order to fill these menu bars, you need to configure a report launchpad. You access this Configuration by entering the ‘Role’ and ‘Instance’ from the report launchpad customizing as attributes. = vee rT) (aaraeae cea] ty O sere vi 9 Baten nw Hen = 2.3.1.2 OIF Toolbar Application title tee ps | ps 9) vow (DR TEST. FERS WO Pe ‘compton Name ZTEST Fans. coRP Seas] = Atibutes You ean Aso rt tit ah ET ro enc al In every variant of the OIF, there is one toolbar only. This toolbar contains more standard buttons than the toolbar in GAF. Adcitionally, we have — beside the Other Functions — two more options to create application- specific buttons. These are the Activation Function and the Alternate Function. ‘Avery popular example for an Activation Function is the SAVE button. As this button is frequently used by applications the FPM Configuration Editor automatically adds this button to your configuration by default so you can configure it directly. If you don't need this button at al, select the button and you can easily delete it via the attributes area. Application title ts uf ue 1p ‘Yew OR TEST AS IPE Ceustnene ZTEST PRS. CONF (eae) (Gamae oes ‘= Atmibutes ActivationFunctions: Saws ifr! us [ee Mab, ie] sauce Even 1 Frets FLEA “ete: 1 hye FPM Cookbook Events which are raised from the OIF toolbar: Button Event which is raised ‘Activation Function section solf-defined via configuration ‘Alternate Activation section self-defined via configuration Check -ge_event_check Close -gc_event_close Delete Object -g¢_event_delete_current_object Edit -ge_event_edit Load Draft -ge_event load draft New |_fpm_« -gc_event_new Next Object cl_fpm_event=>ge_event_next_object Other function section self-defined via configuration Previous Object .ge_event_previous_object Print -g¢_event_print Print Proview -g¢_event_print_preview Read Only -gc_event_read_only Redo cl_fpm_event=>ge_ event redo Refresh cl_fpm_event=sgc event refresh Save As cl_fpm_event=>go_event_save_as Save Draft -gc_event_save_draft ‘Send .9¢_event_send Stan Over cl fpm_event=>ge event start over Undo cl_tpm_event=>ge_event_undo Button-Choice Event which is raised ‘Send self-defined via configuration Print solf-defined via configuration Print Proview self-defined via configuration New self-defined via configuration 2.3.1.3 GAF Toolbar Within the GAF, every main step below a variant has its own toolbar and every substep below a substep variant has its own toolbar: FPM Cookbook Ee Element [I O veriant: orion (1) Buen wroon =O) Subston Variant Sutetes Vor Sencar + Sie ieee Ba Substep: Suncten 4 » Bi rensepe wares 2 as This ensures that the tooloar configuration can be exactly defined for each step. There are some special elements: + The FINISH button can only be defined within a main step toolbar. if this button is pressed, the roadmap will be executed sequentially, this means the FPM tries to automatically navigate to the next step as many times as possible. If an error occurs in a certain screen then the process will be stopped at this screen. Otherwise, the FPM will take the user to the last step of the roadmap (before the confirmation screen) ‘+ After creating the button ‘Exit to Mainstep’, the attributes label’ and ‘tooltip’ can be defined (only within substep toolbars). This button will take the user from a substep back to its main step. ‘© One ‘Final Action’ can be configured per variant. This final action defines a special label and FPMEventld for the Next-Step button on the last step before the confirmation screen. a = moan ia a + Oven temic) Eh Mi > Ehnenaey matey 2 © _Aambutes FinalAcion a) Events which are raised from the GAF toolbar: Button Event which is raised (Other function section self-defined via configuration Close cl_fpm_event=>ge_event_close FPM Cookbook Exit to main step ‘cl_fpm_event=>g¢_event_exit_to_main_step if no final action is defined: cl_fpm_event=>ge_event_next_step with defined final action: the selt-contigured event in the final Next step, action node and the next step event are raised Previous step .ge_event previous step ‘Save Draft >go_event_save_draft 2.3.2 Configuration of the Header ‘The header also known as Identification Region (IDR) consists of the following three areas: Header area, ticket area, and items area. This is illustrated below: Demo of features of the Floomplan Manager | Uses lame Lich ity Login Date, Sth oy 2008 Login The 162322, ‘avatend checuncauters Laer apr tea Ne Taal) fae _ tea tensarea iar icant aaron | Only the header and the ticket area can be configured statically. If you would like to add/change things in the items area you need to do so dynamically (it's possible to add label/value pairs, label/navigation link pairs and label/icon pairs). To do this, please refer to chapter 4.4.2. Note that the ticket area is only available for OIF based applications. The IDR configuration is a separate configuration entity. You reach it either by navigating from the applicatiion configuration or from the floorplan configuration as depicted below: wet] ‘ak naro or cag tertigrationo he 1DR ‘As mentioned eatlier, the header area and the ticket area can be configured statically, as depicted below: nen FPM Cookbook Component Configuration FPM_TUTORIAL_MESSAGE_IDR E (coarse) RTT] | [RERER] | vow: campmor Tutorial for Message Handling sue hearse 0 eonpurintarte i O Attnbutes IDR Basic Fret rete alpen aa OrOR Edda Tune SsageToné Tein ott: 2.3.3 Configuration of the Primary Help The primary help of a floorplan application is always displayed above the Content Area when the Quick Help of the screen is switched on. If you right-click with your mouse, a context menu opens. Select the menu entry Display Quick Help’ and the help mode is activated: Toolbar configuration [as [Ee] Reason] et) [Retest] | [rensierdataktoya] [Sat verktow This fs @ UIBuiking Bleck | User Stings Het Toolbar configuration (Raex] This is @ Ui Bulldng Bleck To configure this help text inside your application configuration, press the button ‘Add Explanation’ in the ‘Action Area on the right hand side. An explanation can be defined for each subview and step/substep FPM Cookbook To configure an explanation you have two alternatives. You can enter a text of your own (type String) or you can enter a document object which has to be created in the backend (type DOKU_OBW). To create a ‘document object, use transaction SE61. Choose ‘General Text’ as the document class. Now you can create these objects and use them within your application configuration. Afterwards it will be displayed within the primary help. Document Maintenance: Initial Screen Warket] [6 Autozone |] Document Class feneral text Bb Language English B [oon EE | Wane jacrioN ] B dspiay | [BP change _] @Local Oetvia RFC Destination. 2.4 FPM Events ‘As with standard Web Dynpro ABAP, a user interaction is reflected by a Web Dynpro action. However, in case this interaction is not only local to single component but (potentially) affects other parts or components in the application it needs to be transferred to an FPM event (see chapter 2.4.1 + 2.4.2), nye tt FPM Cookbook This FPM event passes a FPM phase model (also called “event loop”) which is integrated into the WD phase model. Within the FPM event loop all involved components can participate in the processing of the event (See chapter 2.4.3) It the FPM event results in another screen assembly (e.g. navigation to another screen in the guided activity floorplan or the selection of another view/subview in the object instance floorplan this is handled by the FPM itself (e.g. there is no need for the application to fire plugs or similar) 2.4.1 Raising Standard Events Normally, most of the standard user interactions in a floorplan based application are triggered from the generic part of the floorplan (e.g. previous/next in GAF, or view switches in OIF). For these interactions the FPM automatically initiates the FPM event loop. Furthermore, since these “standard events” are "known" by the FPM thoy can in most cases be handled generically. Additionally, the application can react to those events as described in chapter 2.4.3. However, there might be scenarios where a standard event needs to be triggered from within an application specific Ul building block as well: e.g. automatically leaving (i.e. by-passing) the intial screen in case all necessary startup parameters have already been provided as URL parameters. Generally, each FPM event is represented at runtime by an instance of the class CL_FPM_EVENT. This class encapsulates all information which is needed to execute this event, including the ID and additional parameters. Triggering the FPM event loop for a concrete event normally requires two steps: 1. Create an instance of cl._#2é_EVENT with the appropriate attributes. For all the standard event IDs, there are constants available in 1r_PeM_consTANTS. 2. Raise the event by calling the method 1#_FPM~RATSE_EVENT and passing on the instance of cr MEV For those cases where the event does not need any additional parameters other than the event-id itself, the FPM offers an adcitional method RA1SE_EVENT_BY_rD which makes the first step obsolete. In this case, raising an FPM event typically happens as follows: data lo_fpm type ref to if_tpm lo_fpm = cl_fpm_factory->get_inst Lo_fpm->raise_event_by_id( IF_SPM_CONSTANTS@>6¢_EVENT-LEAVE_INITIAL SCREEN ) An example of an event with parameters is given in the next chapter. NOTE: Since at the point the event is raised, it is unknown whether the event can be executed successfully fF not, do not enter any coding after the call to RATSS_EVENT (_B¥_ID]! 2.4.2 Triggering Application Specific Events In order to raise an application specific event you should follow the same rules as described in the previous chapter. The only difference is that the FPM — since it does not know the semantics of the event — does not perform any specific actions for this event. However, the processing of the event is identical. This means that all involved components participate in the event loop in the same way as with ‘standard events’ (see chapter 2.4.3), ‘An example of triggering an application specific event including event parameters: data ype ref to ype ref id = 'DELEZE_AIRPO RI" FPM Cookbook Le_event->mo_event_data->if_fpm_pazameter~set_value( ivkey = 'ATRPORT_1D" iv_value = lv_airport_id dy. nstance( ) le_fpm = ¢l_fpm_factory=>ge. Lo_fpm->raise_event( ic_event = lo_event } NOTE: Since at the point the event is raised it is unknown whether the event can be executed successfully or not, do not enter any coding after the call to RATSE_EVENT{_BY ID)! 2.4.3 Reacting to Framework Events The FPM event loop is integrated into the Web Dynpro phase model: vss | | use, som He woe ce ee ee — [rescence TI [_satorearnee TT err sraarary rer, ‘The following chapters describe the methods an UI building block inherits when you implement the interface If _PPM_UT_BUTLING_BLOCK and certain key Web Dynpro methods. For a description of the interfaces TF_PPM_SHARED_DATA, IF_PPM_WORK_PROTECTION, IF_PPM_RESOURCE_MANAGER, and TF_FPM_TRANSACTION please refer to the corresponding chapters. hye FPM Cookbook 2.4.3.1 WDDOINIT This standard Web Dynpro method is called exactly once in the lifetime of a Web Dynpro component by the Web Dynpro runtime. This method should be used to generally intialize your component: e.g. initialize attributes, create helper classes, etc. Where a U! building block needs to call methods on the TF_FPM interface more than once, the CL_FPM_FACTORY class can be queried once in i2D0TNTT and the retrieved TF_FPM instance can be kept as component attribute for easier access: method WoDOIN cl_fpm_ factory instance( } 2.4.3.2 WDDOBEFOREACTION This standard Web Dynpro method is called by the Web Dynpro runtime on all visible UI building blocks when the end-user triggers a round trip. According to the Web Dynpro programming guideline, generic validations should be handled in this method; e.g. check that all mandatory fields are filled. 2.4.3.3 Action handler (ONACTION...) If the end-user triggered a request from within your UI building block (e.g. application-specific button) the registered Web Dynpro action handler is called, ‘You then have two options: If the user interaction does not have any (side) effects on other Ul building blocks and there is no need for FPM features like data-loss popups, you can handle the action locally in your Ul building block using standard Web Dynpro programming; e.g. selection of another radio-button leads to different enabledidisabled settings of other controls on the same view. However, forall actions with potential (side) effects on other Ul building blocks, you must raise an FPM event (see chapters 2.4.1 and 2.4.2) 2.4.3.4 IF_FPM_UI_BUILDING_BLOCK-FLUSH This is the first method called after the FPM event loop has started. In this method the UI building block needs to transport all modified data from the views to other components the UI building block wants to communicate with later on. Normally this data transport is done completely automatically using the Web Dynpro context mapping. Therefore, you will only need to do a specific implementation of this method if you are not using these automatic mechanisms. 2.4.3.5 IF_FPM_UI_BUILDING_BLOCK-NEEDS_CONFIRMATION In this method the Ul building block can request that the subsequent event processing be blocked and ask the end-user for confirmation. This confirmation is rendered in a popup. Depending on the action of the end- User in the popup, the event loop continues or is cancelled. For more details please see chapter 2.4.4, 2.4.3.6 IF_FPM_UI_BUILDING_BLOCK-PROCESS_EVENT In this method the UI building block needs to: check for local consistency * do the actual event processing The “local check’ is needed to inform the end-user about potential input errors as soon as possible: according to the UX guideline, checks should be performed on an ongoing basis, as long as they are not too FPM Cookbook performance-intensive. E.g. when switching from one view to another view in an Object-Instance floorplan, the UI building block which is left should check for local consistency. However, this does not exempt the application from performing a complete check (including performance critical checks) before saving. This must be handled in the method IF_PPM_TRANSACTION_CHECK_BEFORE_SAVE, Besides the consistency check this method contains the actual processing of the event. For this the current event can be identified through the attributes mv_event _id and Mo_BvENT_DATA on the passed on event instance io_evenz. Depending on whether the event could be processed successfully or not the exporting parameter EV_RETURN must be filed with either 1°_PeM_CONSTANTS~GC_EVENT_RESULI-OK or F_¥PM_CONS __EVENT_RESULT-PATLED AN Atypical implementation of PROCESS_EVENT is shown below: TF de_event~>mv_event_is_validatin: abap_true. no local checks and report messages if needed ENDIF CASE io_event->mv_event_id. MEN XYZ Handle event and fill BV_RETURN accordingly with a value from _¥PM_CONSTANTS-GC_EVENT_RESULT ENDCASE If the event processing requires further user interaction (e.g. ask for further data in a popup) the event processing can be deferred by returning EV_RETURN = IF_PPM_CONSTANTS~GC_BVENT_RESULT DEI For details see chapter 4.1 2.4.3.7 IF_FPM_UI_BUILDING_BLOCK-AFTER_FAILED_EVENT This method is called by the FPM if an event could not be processed successfully. In this case the Ul building block needs to take care that its Ul is reverted to the state before the user interaction Example: The changed lead selection in a table triggers the display of the details of the new line in another Ul building block. Now the event could fail the UI building block for the details contains unsaved data for the previously selected table line. Since after the (failed) event the detail form still contains the details of the original table line, the lead selection must be reverted to the original table line as well. Ifthe P2oce'ss_svEN' method of the current UI building block has been processed successfully but the event processing failed due to a problem in another UI building block, the actual event processing needs to be reverted as well. This situation is indicated by the parameter 1v_kEVERt 2.4.3.8 IF_FPM_UI_BUILDING_BLOCK-PROCESS_BEFORE_OUTPUT The last method on the UI building block to be called is the interface PROCESS_BEFORE_O typically the data which needs to be displayed is read from the model 2.4.4 Triggering a Data-loss Popup ‘As described in the previous chapter each UI building block can request a data-loss popup during the FPM event loop. To achieve this, simply return the pre-defined instance of the class CL_FPM_CONFTRNATTON_REQUEST: METHOD nee! confizmation e0_confismation request = ENDIF spm_confirmation FPM Cookbook The display of other confirmation popups can be achieved by creating your own instance of the class ‘PM_CONF IRMATION_1 which e.g. contains an application specific text. For more sophisticated popups (e.g. containing own screens) see chapter 4.1. 2.5 Initial Screen The optional Initial Screen is composed of UI Building Blocks as in every other screen within an OIF Subview or a GAF Roadmap main step or suibstep, The configuration is done within the Configuration Editor of the Floorplan. ‘Component Configuration Z_DEMO1_OIF se Cae ee) (Ee Ge Application title © amen ame) [nssrsnereer tne 9) (saemoase] el = tne @) mene] B ptnbutee VEE NT core ® wees come TL sou i You have to add an initial screen to your application (via Add -> Initial Screen) and add one or more UIBBs. It you don't add an initial screen the application starts immediately with the View Switch (OIF) or the 1" roadmap step (GAF), ‘Additionally you can configure the toolbar of the Initial Screen the same way as described in Error! Reference source not found... However there is a Start-Button in the toolbar which is mandatory and therefore can't be configured. When this button is pressed, the event IF_ FPM_CONSTANTS=>GC_EVENT- LEAVE_INITIAL_SCREEN is raised and the initial screen is lef. If you want to omit the initial screen from your application, you can raise the LEAVE_INITAL_SCREEN event within your application specitic coding: fpn instance( ) EVENT-LEAVE_INITIAL_S: FPM Cookbook 2.6 Confirmation Screen 2.6.1 Confirmation Screen in OIF In OIF the confirmation screen is only displayed when the object currently processed in the application has been deleted. After an object has been deleted the confirmation screen is displayed in place of the normal view switch. Therefore if your application doesn't have such delete-functionality you don't need a confirmation screen. ‘Aconfirmation screen is configured by adding a confirmation screen (via Add -> Confirmation Screen) within the Configuration Editor of the Floorplan. As aifferent variants might have different confirmation screens you have to specify the configuration screen for each variant you need. Component Configuration Z_DEMO1_OIF , ea a | eee Application title 18 ¢) a a © G vat tet = 5 cone soneney [Buse cue one IB sues UBE CONF_SCREEN! rE] mere * EBB a The confirmation screen in OIF can be accessed via standard button DELETE_OBJECT (see Error! Reference source not found.), which raises the Event IF_ FPM_CONSTANTS=>GC_EVENT- DELETE_CURRENT_OBJECT or within your application coding: data pm le_fpm = Lo_fpm->raise_event_by_{ wpe ref to if_fpm pm_factory=>get_instance( Gi FPM_CONSTANTS=>GC_EVENT-DELETS_CURRENT_OBJECT } 2.6.2 Confirmation Screen in GAF In most cases GAF applications will have a last step that confirms the action to be performed, the so called confirmation step. The purpose of this step is to inform the user that the action he executed has been finished successfully. The configuration of the FPM_GAF_ COMPONENT explicitly supports such a use case. It your application needs a confirmation step you have to add it to your application (via Add -> Confirmation Soren) FPM Cookbook Component Configuration Z_DEMO2_GAF a (Sa er | a | we. eet — evan Saat Application titfe ea) SER] eet SE cso a) TB ambues UBB UBS_2 en) commet* en) covert 1 catgoentie Geet 2.7 Using FPM Message Manager In order to guarantee consistent and guideline-compliant message handling, FPM provides its own Message Manager which should be used instead of the generic WebDynpro Message Manager. How to use the message manager. 1. Declare an attribute of the component globally (say MR_MESSAGE_MANAGER) referring to an object of type IF_FPM_MESSAGE_MANAGER 2. Inthe WDDOINIT method of your component controller, create a handle to the FPM Message Manager which is a read only attribute in the IF_FPM interface. Method WODOINIT. "Get the handie to the IE_FPM interface. wd_this->MR_FPM = Ch_FPM_FACTORY=>GRT_INSTANCE( } nd_this->MR_MESSAGE_MANAGER = w6_this->MR_PPM->MO_MBSSAGH_MANAGER. endnethod 3. Use the message manager reference to report messages, raise exceptions or to clear messages. Some examples are provided below. Example: T100 based message. This example is taken for the demo applications and can be found in the WD component FPM_HELLOSFLIGHT_OIF_DEMO in the APB_FPM_DEMO package. neu FPM Cookbook (CALL METHOD WD_TETS~>MR_NESSAGE_MANAGER->REPORT_T100_MESSACE EXPORTING Tv_MSGID = 'RPB_FPM_DEMO" IV_MSGNO 009 10_CoMPONENT we_this IV_SEVERITY if fpm message_manager=>GC_SEVERITY_ERROR Iv_LIFETIME if fpm_message_manager=>CC_LIFE_VISIBILITY_AUTOMATIC IV_PARAMETER_1 iviearrid_string O_ELEMENT jo_el_sflight_selection IV_ATTRISUTE_NAME, (CARRID™. The T100 message is shown below: @ @ ‘The parameter &1 will be replaced by the actual flight name in the message. This is how it will be rendered in the message area. nye FPM Cookbook 3 FPM Generic UI Building Blocks In order to facilitate application development, the FPM offers some generic UI Building Blocks which can be Used to build applications without the need of WebDynpro programming. FPM then does all Ul rendering and thereby assuring UI guideline compliance. The WD ABAP Floorplan manager is up to now a framework which composes application-specific views (UIBBs) to form an application. This ensures homogeneous high-level application structuring and interaction behavior. However, as the UIBBs which typically comprise the major part of the screen are built using WD. ABAP free-style there are stil a lot of opportunities for innomogeneous layout and interaction design. Furthermore, for customers the Ul enhancement options depend on the individual decisions taken by the developer of the UIBB. Generic UI Building Blocks (GUIBB) now address this issues. GUIBBs are UIBBs that are delivered centrally, where the application only provides the data and a layout configuration. The rendering is done by the GUIBB. Generic UI Building Blocks provide a comprehensive way of creating or changing User Interface Compositions such as form and list components, without requiring changes to the underlying application code base and thereby offering a concept for modification free customer UI enhancements. K FPM Genenc GUIBB I Freesiyle UIBB -eeder cass Application 3+4 Block Diagramm of an FPM based application using GUIBBs and Freestyle UIBBs. The grey boxes show the FPM framework, the green boxes are application specife. The composition (configuration) of those building blocks takes place in a designer-application where all the necessary field atributes, positioning and layout properties are assigned. Necessary application specific information will be supplied by the application itself via a Feeder class. Those feeder implementations are based on a predefined interface definition providing all necessary methods and corresponding signatures in order to standardize the communication between the application and the GUIBB. This communication will embrace + application definition (e.g. data definition, structure or table definitions and the technical aspects) ‘* possible default layout information and the corresponding field dependencies ‘© the (optional) action definition based on metadata ‘the action/event handling and data forwarding to the underlying Application Model Currently there are 2 GUIBBs available, the form and the list. These cover the most important use cases, Feeder Interface FPM Cookbook The Interfaces (IF_FPM_GUIBB_FORM and IF_FPM_GUIBB_LIST) which have to be implemented by all GUIBBs are similar and consist of the same set of methods: GET_DEFINITION provides the information about the fieldcatalog (ist of fields/columns to be displayed) and the actions which can be processed by the feeder GET_DATA provides the data to be displayed within the form or list PROCESS_EVENT reacts to user events (e.g. check displayed data, save it...) GET_PARAMETER LIST defines the set of parameters that the feeder can use. INITIALIZE receives the configured set parameters the feeder defined in GET_PARAMETER_LIST CHECK_CONFIG is used only at design-time if feeder-specific checks of the configuration are necessary FLUSH receives the values the user changed and informs other involved UIBBs GET_DEFAULT_CONFIG is used only at design-time as a starting-point for configuration Only GET_DEFINITION and GET_DATA are mandatory for simple applications. All other methods are optional and need only empty implementations. 3.1 Form UIBB The form UIBB (FPM_FORM_UIBB) provides all functionality needed for forms that comply to the UX guidelines: 344 Forms can be structured by groups ‘There are 3 types of groups available (Full width 1 column, full width 2 columns and half width 1 column) Each group can have a group title ‘A group consists of fields with labels, melting groups and button rows A field can be displayed as a text view, text edit, input field, drop down list box, checkbox, radio button group, link to ur, link to action Actions can be assigned to fields Fields and buttons (including button choices and toggle buttons) can be displayed within melting groups Buttons, button choices and toggle buttons can be displayed within button rows The attributes of the Ul controls relating to the fields and actions can be configured and also changed at runtime (f.¢, dynamically hiding a field and its label) Configuring a Form Create a Configuration for WebDynpro Component FPM_FORM_UIBB with the FPM Configuration Editor FPM Cookbook dot 6005 ere [aoa [a 203 |peeatce (00:25, 201 | sage os, 2002 ay 1.2001 ‘a coworaneoouse Bconomsntnece Fie Ede Van Feetee Take tab) OO i) al | Dare Pere O] Bis SG a en component de you wart to connigure? ‘componert toms: [FAMLFoRMLIEE | canregenen oc * [zit eocwecok ‘When you create a new configuration you are asked to enter the feeder class in a popup. There is an inputhelp assigned to ths field which shows only these classes which have implemented the interface IF_FPM_GUIBB_FORM. (Sites forthe, Web. Dyonm Anan. Component. Contin rrat erased (Cae a] | [eR TE a) ‘emer me (WFO UES ] vein + [SES eR B he 1 FPM Cookbook ‘When you have entered the class you want to use for this GUIBB, press the button “Edit Parameters”. You class within method GET_PARAMETER LIST. If the list is empty, you will will get all the parameters for ‘get a message that no parameters exist. {BpPieace marta fee paranstrs, Feeder Parameters Table Row (SY TABU a Feeder Claes: (GL FPMGG_FORM FLI Demo GUE: Selecta Flaht (simele) When you say "OK" the system calls the method get_default_Contfg for the entered feederclass. If the method is implemented and a context was created you will get a preconfigured form. Otherwise you will get an emply form and have to create it from scratch! [Gee O- 2if|) en Smee GI RR rrr 3.1.1.1 Add a Group to a Form ‘seaee J he FPM Cookbook ‘When you press the button “Add Group” a new group will be created in the context underneath the existing ‘one. The group gets selected and you can see the attributes for the group and set them. You can also ‘change the sequence here. ‘The Group Type is an important attribute for the group. Currently you can select between 3 group types (Full width 1 column, full width 2 columns and half width 1 column). nye a FPM Cookbook 3.1.1.2 Configure a Group Mark the group you want to configure in the hierarchy tree on the left and press “Configure Group”. ‘A popup will open where you can see the available fields on the left side and the displayed fields on the right hand side. FPM Cookbook In case your feeder class supports the special group functionality you can select subsets of the available fields using the dropdown listbox in the upper left comer. 3.1.1.3 Configure Fields After you added fields to a form you can change the attributes of each of the fields by selecting the field in the hierarchy on the lett side. Component Configuration ZTEST_COOKBOOK ox a ew Ge ed reales faeal = = yi eae ~ Ore ae a 3 Gres ‘%_Nuvbates Cheont County Below the preview you now can maintain the attributes of the field. The most important attribute is the display type by which you decide ifthe field is rendered as text view, drop down list box, checkbox, ete. Depending on the display type there are further attributes specific to that display type. Additionally you can assign an FPM Event ID to the fields (only if you use an appropriate display type — f.. there is no event triggered by a text view, so it makes no sense to assign an FPM event). This causes the system to raise an FPM Event whenever the default action of this Ul element is triggered (/.e. when a new Dropdown Listbox entry is selected, ...) 3.1.1.4. Using Melting Groups Melting groups are groups of UI elements used within a group in the place of a single field. You add a melting group the same way you add a field via the "Configure Group" button. After adding the melting group you can configure it by pressing the button “Configure Melting Group” FPM Cookbook ‘A popup will be shown where you see the available fields on the left and the displayed fields on the right hand side. Additionally you can add different Button types. Nesting of Melting groups is not allowed, therefore you can't add a melting group within an melting group. FPM Cookbook 3.1.1.5 Using Button Rows You can add a Button Row to a group in the same way as you added a field using the “Configure Group” button. After you added the button row you can configure it by selecting it in the left hand side hierarchy and pressing “Configure Button Row”: = Freres ‘On the configuration popup you can add single actions or button choices. For single actions, decide if they are rendered as Button or Toggle Buttons. If you have added a Button Choice Element, assign the actions after closing the popup as attributes of the Button Choice. he FPM Cookbook (SI RSET 3.1.2 Configuration to run a FORM GUIBB. Configuration for OIFGAF needs to be created. 1. within Component FPM_OIF_COMPONENT/ FPM_GAF_COMPONENT a configuration with the FPM Configuration Editor 2. Within the configuration one UIBB + COMPONENT: FPM_FORM_UIBB ‘= VIEW: FORM_WINDOW ‘+ Configuration Name: the name of the configuration for the formflst(this needs to be the configuration for the Component Usage and not the application Configuration) ‘UIBES (1), cos Ne: FOU spews FORM HDC Cont nee: Fra. peo FoR FLSA Fa fecal (Gennes) (H Atpibutes LIE FORM WINDOW ree [Ge] comport: + FWFORALLEG Vows * a Covigaséon Ne: FPMGB-DEMG FORWFLI_] —Conigrobn Te. Gen Conf. ar Sanerce ee 1 Neeexctretenea neo FPM Cookbook Within the FPM Configuration Ecitor itis possible to call the configuration for the GUIBB itself by pressing the button “Configure UIBB". A new window will open and you can directly change/create/display the configuration you have entered. 3.2 ist UIBB 3.2.1 General The list UIBB (WD component FPM_LIST_UIBB) allows to create dynamic lists in an easy and fast way that comply to the UX guidelines. Here is a rough overview of the functionality: + Choose at design time the rows to be displayed from a field catalog provided by a feeder class. + The list may contain a toolbar with various elements and actions assigned to it + Change properties of single cells, complete columns or toolbar elements during runtime, ‘+ Raise FPM events from cells or toolbar elements. ‘+ Activate Sorting and Filtering functionality if needed, + Make use of various value helps, such as ABAP dictionary or OVS. 3.2.2 Implementing a feeder class First step in creating a list UIBB is to write a feeder class. The feeder class is a common ABAP class that implements at least the interface IF_FPM_GUIBB_LIST (if you need extended functionality you might also consider to implement IF_FPM_GUIBB_LIST_EXT). A general description ofthe available methods where already given at the beginning in chapter 3.1. Here are some notes that are relevant for the GUIBB lis: * Method get_definition(): Use this method in order to provide a field catalog. This field catalog defines the set of possible columns. Later in the configuration editor you may choose which columns actually are displayed. The table may also contain a toolbar. If you want define elements for the toolbar, e. g. such as buttons, dropdown list boxes, input fields etc. you will have to define actions. Use this method in order to define a list of action definitions. Later in the configuration editor you may choose elements for the toolbar out of the set of actions thal you provided here, + Ficldusage and actionusage: The field- and actionusages are structures filed by the feeder during method get _data(). They are used to control the following properties of columns (fieldusage) and toolbar elements (action usage): Visibility, read-only, mandatory and enabled. For the columns there is one thing to be aware of: Itis possible to assign those attributes eather to single cells or to whole columns (with the exception of visibility, which only can be applied to whole columns). If you want to set those altributes for the whole column just use the corresponding fields in the structure field_usage. If you would lke to set those attributes for single colls you have to do the following steps: Create a new column for the table. That is to say add a field to the field catalog in the method get definition(). Now mark this column as a technical column so that itis not visible at runtime by setting the field technical_field to °X. This column contains the property of the cells. Now in the method get_defintion() adjust the field description accordingly. For example you have a column A and you want to set the property read_only for single cells in that column. For this reason you created a technical column B. Now in the field description set field read_only ref = B. 3.2.3 Creating a configuration Creating and changing a configuration for the list is quite similar to the FPM GUIBB form. Therefore for the basic steps please refer to the detailed chapter on how to create a form configuration (3.1.1.1.).Replace all occurencies of FPM_FORM_UIBB with FPM_LIST_UIBB, There are some special configuration properties that only apply to the FPM GUIBB list 3.2.3.1.1 The Attributes FPM Cookbook You get access to the attributes as depicted below: Component Configuration FPMGB_DEMO_LIST_MASTER_GUIBB Costin option FPNGE M0 LST MASTER CETAR, ga] ee wa (Eevee [Fa Reese) [Geter Tt Saipan] (eeeslciess) 7 — ehuereanaliomm » Elcanrciet * [lean one = [hoor cnneten ae + Dlswnr covert + Blcan tent + can oeprese st + DBlemnre creer + Elan seatere + omnrDernn sea _ eaetnitn © Aanbutes List Fight Comectons Che) fore toe CE we AAS + DBcanr Dts neseecen sameeren [on ae [see] + lena cen overt (ouescm wis Tiere + Floss Cert Click at the first row in the hierarchy at the left side to see the attributes. Here comes the description of the attributes: Feeder class: The feeder class is read-only here, because it was already chosen when the configuration had been created. Text: Set here a text for the caption header of the list. Lead Selection Action Assignment: Assign here a freely chosen FPM event ID to the lead selection. During runtime if a lead selection happens an FPM event is raised with the ID that is assigned here. It there is no event ID assigned here, the generic event ID IF_FPM_GUIBB_LIST=>GC_FPM_EVENT_ON_LEAD_SEL for this purpose will be taken. 3.2.3.2 The toolbar Press the button “Configure Toolbar” in order to get to a popup where you may configure the toolbar, as depicted below: nea FPM Cookbook ‘Avalle Feeder Actions Chosen Feeder Actions BE Peder act AcionTes, Fi Pesieractin etn Tent Dilev tree U1 = Bien Cre CHFETRESH tres Maer Tate oan = SSepmior co Senter Sema OW LEIS MASTER - rae coun san crecs SAW COLLIN Show Coures ro Con | [etrenoveacins| | a= sso seperar apres DistieGCfErake Ohne pee Fas © a Fide Testrical Fed Womas [EB erence seomence EE] On the left side all available actions are listed (that are the actions given from the feeder class in method get_definition via parameter action_list). From that set youl may choose actions to be displayed in the toolbar. Furthermore you may assign them an action text and a display type. 3.2.3.3 The settings * Column count: Determines the amount of columns that are displayed at runtime. ‘© Row count: Determines the amount of rows that are displayed at runtime. ‘Selection Event: Just as the WD table the GUIBB list allows two kind of selections at runtime: Lead selection (done with left mouse button and selects ane single row) and normal selection (done with right mouse button and selects one or multiple rows). With this drop down list box it is possible to determine what kind of selection should cause an FPM event. The defaults, that only a lead selection causes a FPM event. Selection Mode: Determines whether it shall be possible to select multiple lines. ‘+ Selection behaviour: Determines whether currently selected rows will be unselected or not when a new selection takes place. 3.2.4 FPM eventing and the GUIBB list ‘As the GUIBE lists just a usual FPM UIBB it takes part on each FPM eventloop (when itis visible of coure). Furthermore the GUIBB list may raise FPM events itself. There are three sources from where those events are raised: ‘Cell events: The columns may contain fields that have a display type that are capable of raising an event. Such a display type is for example the button. All cell-based events have the FPM event ID IF_FPM_GUIBB_LIST=>GC_GUIBB_LIST_ON CELL ACTION. The corresponding row and column are added the to FPM event as the event parameters. IF_FPM_GUIBB_LIST=>GC_EVENT_PAR_ROW and, IF_FPM_GUIBB_LIST=>GC_EVENT_PAR_COLUMN_NAME. + Toolbar events: Almost each toolbar element is capable of throwing an FPM event. In that case, the event ID is the action ID (that was defined by the feeder class in method get_definition). Some toolbar elements may contain specific values (i €. user inputs) of interest, such as the toggle button, the input field and the drop down list box. To get those values you may read the following FPM event parameters IF_FPM_GUIBB_LIST=>GC_EVENT_PAR_TOGGLE_STATE (for the toggle button), IF_FPM_GUIBB_LIST=>GC_EVENT_PAR_INPUT_VALUE (for the input field) or IF_FPM_GUIBB_LIST=>GC_EVENT_PAR_DROP_DOWN KEY (for the drop down list box) FPM Cookbook + Selection events: A row selection might also lead to an FPM event. Via configuration itis possible to choose whether only a lead selection will lead to an FPM event or also a normal selection (see configuration settings for details). 3.3 Tabbed UIBB ‘The tabbed UIBB differs from the other generic UIBBs. It does not offer a standard WebDynpro UI but embodies one ore more child-UIBBs and arranges them in a certain layout. 3.3.1 General The Tabbed UIBB embodies other UIBBs and displays them in a master-detail layout. An example of a Tabbed UIBB is shown below: test the ipm tabbed component " Booking number | Aine LH From FRA —TosFX Flight Dete 26082007 Passenger Naren Geld nace ‘Booked an 2005 2007 osongnunese inners EB __--tabstrib ne 710 OH ax cacti oan HOTT Free sorts: TEAS seta ie cacy ta ZU neeseme ag ne capacey 12 SDTE, fee sete: val The master area can contain any number of UIBBs. These UIBBs are always visible regardless of the selected tab. The tabstrip includes any number of tabs. Each tab in turn has its own detail area assigned to it, whereas each detail area contains an arbitrary amount number of UIBBs that are only visible if the corresponding tab has been selected. 3.3.2 Creating an Application That Contains a Tabbed UIBB Currently Tabbed UIBBs can only be used within an OIF floorplan. If you want to build an application where only the Tabbed UIBB is visible and not the view switch of the OIF you will have to configure only one main switch with only one subview switch (this will ensure that the view switch is invisible). In order to create an application that contains a Tabbed UIBB, perform the following steps: ‘© Create a OIF floorplan application. Refer to chapter 2.2.1. ("Creating a simple OIF application’) for this task. + In the OIF Configuration Editor add a UIBB and give it the following attributes: Component: “FPM_TABBED_UIBB’, View: "TABBED_WINDOW’, Configuration Name: Enter you own configuration name. Here is an example where the configuration name for the tabbed UIBB is ‘ZUMI_TESTS' FPM Cookbook (inate) [amen] [dais] [aan UIBE (1) [zaauee) Cemsenert Na FPH_TASEED BE View TABEED ND ‘conmig.raien Rome Zn TESTS atria (Conte 166] BB Attributes UBS: TABBED_WiNDOW Trine [ae ‘Sonmorent:* FERGTABRED ER) Vtews * (TameeD wancow ———] onnguratenems: ZWWLTESTS == Convigureton Type: General ont. Vere (Semmes Nees steching ‘+ Now press the button “Configure UIBB" in order to configure the Tabbed UIBB. You will navigate to the Configuration Editor for the Tabbed UIBB. Add here UIBBs to the master area, tabs and UIBBs for detail area as required. The picture below shows an example of such a configuration: It contains two tabs, each with an embedded UIBB, (cpu nn nc a (in ase] | [RR] ve aeprncera [arrest Ee ee) ‘Tob VIBE (1) (gat conten ince OFFA 1 Auributes VIBE: W_MAIN Cet emaneat* EET) eee coc el cs Yair Sepercatdee | 4 ete orecr ‘+ Finally, choose the layout of your Tabbed UIBB. Choose “Top-Bottom in order to place the master area and the detail area one above the other or choose “Left-Right” to place them side by side. + Now save your configurations and test your application. ne G FPM Cookbook 3.3.3 Changing the Tabbed UIBB Dynamically at Runtime You may rename tabs, add and remove tabs or child-UIBBs from your Tabbed UIBE during runtime. To do 0 you will have to implement the following steps: + Choose an application-specitic Web Dynpro component and let it implement the Web Dynpro interface IF_FPM_TABBED_CONF_EXIT. Usually tis is one of the WebDynpro components that provide a child UIBB. 1} jane escriston [maiemen, [all 4) tf_FPM_TABBED_CONF_EXIT coe (F_FPM_UI_BUILDING BLOCK IF_FPM_ULBUILDING SLC CO@ ‘+ Now somewhere in your coding you want to e. g. rename a tab. There you have to raise your own FPM event, ©. g. "CHANGE_TAB_NAME", as follows: DATA: lo_fpm TYPE REF TO if_fpn, lovevent TYPE REY 70 El_fpmevent lo_fpm = cl_fpm=>get_instance( } lo_event = €l_fpn_event=>create_by_id( 'CHANGE_TAB_NAME' } Lo_event->mo_event_data->set_value( iv_key ‘pe ivivalue = lv_tab_id } Lo_event->mo_event_data->set_value( iv_key "NAME" ivivalue = lv_tab_name } lo_fpm->raise_event ( leevent = loevent ) + Now in the component controller implement the method OVERRIDE_CONFIG_TABBED. To rename a tab, for example, implement the following sample code: CASE io_tabhed->mo_event->mv_event_id WHEN "CHANGE _TAB_NAME" DATA lv_name TYPE string DATA lv_id TYPE string. io_tabbed->mo_event->mo_event_data->get_value( EXPORTING iv_key IMPORTING ev_value io_tabbed->mo_event->mo_event_data->get_value{ EXPORTING iv_key IMPORTING ev_value E 5 io_tabbed->zename_tab( iv_tab_id iv_new_name = lv_name ) To find out about options other than renaming a tab, please have a look at the interface IF_FPM_TABBED. hed FPM Cookbook 4 Using Advanced FPM Features 4.1 Variants In some cases the final setup of the OIF view switch or the GAF roadmap can only be decided at runtime. This might be the case if you can select objects of different types on the initial screen and depending on the selected object's type you want to provide a different roadmap to your users appropriate to the chosen view set. For this FPM allows you to configure several variants. Each variant is a complete set of configuration data for the OIF view switch or the GAF roadmap. You can use the input from the initial screen or some other startup information (like application parameters) to select one of these variants. The variant selection has to be done programmatically — to do this you have to use an application-specitic configuration controller (AppCC) (see 0 for detailed explanation). To do this, implement the interface IF_FPM_OIF_CONF_EXIT for an OIF or IF_FPM_GAF_CONF_EXIT for a GAF in one of the application components or in @ new component. This interface has only one method OVERRIDE EVENT_OIF (respective OVERRIDE_EVENT_GAF) which passes a handler object of type IF_OIF (respective IF_GAF). This handler object provides the API for manipulating the floorplan configuration at runtime. One method of this object is SET_VARIANT, which you can use to select the variant. Applicath »—a— — Cerone — | snenane TO core et ae — ue For the OIF, proceed as follows: method OVERRIDE_E yent->MV_EVENT_ID when if_fpm_const event-leave_init reen f->set_variant ( } For the GAF, proceed as follows: method OVERRIDE_EVENT_GAF case io_gaf->mo_event->MV_EVENT_ID FPM Cookbook when if_fpm_constant g¢_event-leave_initial_screen io_gaf->set_variant ( } In this sample code the variant selection is done when the navigation from the initial screen to the main floorplan area is complete. This is the latest point at which itis possible to select the variant. However, you can select the variant earlier. The last thing to do is to declare the AppCC to FPM. This has to be done in the floorplan component configuration in the node APP_SPECIFIC_CC. There you have to provide at least the name of the component you're using as AppCC. 4.2 Substeps in a GAF Roadmap GAF-based applications may sometimes need substeps. Substeps may be required between two main steps. When the application is started they are invisible, but all main steps that are a possible starting point for substeps are marked as such. At runtime it depends on the application context and the user input whether a substep has to be completed or not. This must be decided by the application. Therefore substeps are statically declared but activated at runtime via the FPM API by the application. The image below shows the configuration of a simple substep variant that contains two substeps, the first with one UI Building Block inside. ——— Aoplication tite cen oa > : i a no = = —— ——s name CE = =~ ate moe arte ard =i il neu FPM Cookbook In principle the configuration for substeps is the same as for main steps. You can define any number of substeps with an number of Ul Building Blocks within one substep. You have to populate the attributes for the following entities: + SUBSTEP: Enter qualifiers for the id and name. The entity name will be shown at runtime beneath the corresponding sub step. + SUBSTEP_UIBB: Enter the values for Component and View using the red arrows shown above. In the field Component enter the name of the WD component. In the field Window put the name of the WD ‘window of the interface-view (not the name of the WD view itself). ‘After the substeps have been configured statically, you may invoke it at runtime via the FPM API. This is done by raising a special FPM event, Before raising it, the event parameters have to be populated with the corresponding substep id you want to use. This is shown in the sample coding below: DATA: lo_fpm TYPE REF TO if fpm, It_event TYPE REF TO el_fpm_event. * get reference to FPM API lo_fpm = cl_fpm_factory=) * create event lr_event = cl_fpmevent=: ¢1_fpm_event=>ge_event_chang: + fill event parameters Ly_event->mo_event_data-set_value ( iv_key = cl_fpm_event->gc_event_paran_mains: iv_value = }. Lr_event ->mo_event_data->set_vale | iv_key = cl_fpm_event=>gc_event_param_substep_id ivivalue = <1D of Substep> ). Lr_event->mo_event_daza->set_value | iv_key = ¢l_fpm_event=>ge_event_param_subvariant_id iv.value = ). * now raise event wd_this->fpm->raise_event( ie_event = Ir_event } 4.3 Using Application Parameters Application parameters are defined on Web Dynpro Application level: Applicaton __[RvcfosLnaigafon———~=~CSC*di Rose = (Eaamstes [vse Tre esscuson ] DRDER_I0 oliaion Grea Abus IATL BD Fpplcason-Spacme Atute fi oI I 0) neo FPM Cookbook You can add arbitrary parameters as “application-specific attributes” to your Web Dynpro application During runtime, these parameters are exposed via IF_FPM->MO_APP_PARAMETER MO_APP_PARAMETER stores an instance of IF_FPM_PARAMETER. With this interface you are able to retrieve the parameters. Please note that there is no concept of mandatory or optional parameters. For security reasons, you should never trust parameters passed by a different application. Please always do a proper validation before using application parameters. When executing an FPM application you can add the following FPM-specific parameters to your application to evoke certain behaviours: FPM_SHOW_MESSAGE_LOG You can tum on a log history of the messages for a particular application. When the message log is turned on all the previously reported messages can be seen at a glance. FPM_MAXIMUM_MESSAGE SIZE When a message is created in the application then the message area will show up with a message area size that can accommodate the maximum number of messages (the maximum size is set via configuration). As soon as the visible number of messages in the message area exceeds the configured message size, a scroll bar will appear in the message area. FPM_HIDE_CLOSE If you have activated this parameter, you hide the CLOSE button of the toolbar for the overall application context 4.4 Dynamic Adjustments 4.4.1 Adjusting the Toolbar Using the CNR API 4.4.1.1 General Information During runtime the content and visibility of the OIF and GAF toolbar may be changed via the CNR API. Note that there are different APIs for the OIF and for the GAF. With theses APIs you can dynamically change the toolbar of an Initial Screen or an FPM Main Screen, ‘These APIs are accessed via the CL_FPM_SERVICE_MANAGER: “for the OIF: if fpm_enr_oif, lo_fpm TYPE REF TO if_fpm o_fpm = cl_fpm_factory=>get_instance( }. lo_enr_eif ?= 1o_fpm->get_service( cl_fpm_service_manager=>gc_key_enr_oif ). FPM Cookbook DATA YPE REF TO ££ fpm_en E REF TO if fpm _fpm_secvice_s ager=>ge_key_ Both APIs offer the same methods. These are + DEFINE_BUTTON With this method either standard buttons or application-specific buttons can be created and changed The parameter IV_FUNCTION defines the kind of button (see IF_FPM_CONSTANTS=>ge_ button). The ELEMENT_ID is needed if application-specific buttons have to be changed subsequently + DEFINE_BUTTON_CHOICE With this method either standard button-choices or application-specific button-choices can be created and changed. The parameter IV_FUNCTION defines the kind of button-choice (see IF_FPM_CONSTANTS=>gc_button_choice). The ELEMENT. ID is needed if application-spe have to be changed subsequently. buttons + CREATE_SEPARATOR ‘You can use this method to create a separator at runtime for the OTHER_FUNCTIONS area (application-specitic). + SET_DUPLICATE_TOOLBAR With this method you can activate or deactivate the duplication of the toolbar. + DEFINE_YOU_CAN_ALSO This method can be used to change the menu bar for YOU_CAN_ALSO (see also chapter 3.8 ‘Navigation API’), © DEFINE_RELATED_LINKS This method can be used to change the menu bar for RELATED _LINKS (see also chapter 3.8 ‘Navigation API’), = GET_BUTTONS This method determines the button configurations to be shown in the toolbar. * GET_BUTTON_CHOICES This method determines the button-choice configurations to be shown in the toolbar. + GET_SEPARATORS This method determines the positions of the separators in the toolbar (only within the Other Functions area). © GET_RELATED_LINKS This method determines the contents of the Related Links menu in the toolbar. © GET_YOU_CAN_ALSO This method determines the contents of the You Can Also menu in the toolbar. As the logical usage of these toolbars differs for each floorplan, two subchapters will be used to explain the different parameters. FPM Cookbook 4.4.1.2 OIF Specific Parameters Since a toolbar exists for every OIF variant, only the variant_id has to be passed with every OIF CNR API method. streamers GE INE_YOU_CAN ALSO I=] fee womeas | Exrton sere rerometr ing ssoces he es aie [beset Pa LANTTD Tse sInINe rag inser vee FS TTT ra atoms incor Type FPS. MWCGATTON, Jean ue icon CE Te st8ine Iw risiLETY imoorin Pape sou 9 aLITY (ah Do iy ‘An example of method calls to change the CNR of the OIF at runtime is: DATA: le_cnr_oif TYPE REF TO ‘f fpm_cnr_oif, lo_fpm TYPE REF TO if_fpm Lo_fpm = cl_fpm_factory=>get_instance( }. le_enr_eif ?= 1e_fpm->get_service( cl_fpm_service_manager=>q Vo_enr_oi f->define_butt on( EXPORT! NG Ivivariant_id = < optional; e.g. ‘variant_1'; current variant If skipped > Ivifunetion =< €.9. ACTIVATION FUNCTIONS {appi-speci!ic buttons) ALTERNATE FUNCT! ONS (app!-specilic buttons). CHECK, DELETE OBJECT , EDIT, LOAD_DRAFT, NEW NEXT OBJECT, OTHER FUNCTI ONS (appi-specitic buttons), REVI US OBJECT. PRINT, PRINT PREVIEW , READ ONLY, REOO, REFRESH SAVE_AS, SAVE DRAFT, SEND, START OVER, UNDO, see al so |F_FPM CONSTANTS=>gc_buiton > Iv_sereen =< optional: the seveen where the Ul-Element has to be changed (UNIT, MAIN} > ivsequence id » iv enabl ed iv_explanation = ivlon action = ivitooltip ivovisibility = coptional; Button-Visiility> iv default button = < optional; only for buttons CHECK and REFRESH; by pressing enter within an application triggers the action of this Iv element id Iv design lv_text button> ) iv_hot key =< optional; key-combination far activating the event of this buttons lo_enr_oi f->define_but ton_choi ce( EXPORTI NG Tv_variant_id < optional: e.g. ‘variant_1': current variant if skipped > iv funet i on < €.9. NEW, OTHER FUNCTIONS (appl specific button choices), PRINT, PRINT PREVIEW SEND See also 1F_FPM_CONSTANTS=>9¢_bulton_choice > Iv_sereen = < optional>; the screen where the Ul-Element has to be changed (INIT, MAIN) ivelement ig < optional; only it you want to change the button-choice properties alterwards> nye st FPM Cookbook iv sequence i¢ < optional; only it you use OTHER FUNCTIONS; determines the place where to insert this button-choice > lv_enaal ed < optional; Button-Choice-Enabl ing > ivitest < optional; Button-Gnoice-Laoel > iv tooltip = < opiional; Button-Choice: Tooltip > ivvisipility € optional; Buiton-Visipility > Itlmenu action items = < menu elements of a Buttan-Choice > | 4.4.1.3. GAF Specific Parameters More parameters are required for the GAF CNR API methods. The variant_id and the mainstep_id are always compulsory. This would be enough to define the Ul-Elements in a main step. If Ul-Elements on a substep are to be changed dynamically, you must also pass the subvariant_id and the substep_id. Wnehod pamela (SEF IN Yau_crn Alan Gel (ee wenses | Eeepaers EE EES Pesce roe [Po [0 [yng Posocsint ype Petaiaue Desanion nen ‘500 Ine reper ane SATE Foe 14 tnsrauce ipo we FPS NAVIGATION. irstene Isuaze tmnorin Tye STRING iM-VIGI6iLTY imoonn [= we OUI, v(GIBILTTY ‘Wee nary ‘An example of method calls to change the CNR of the GAF at runtime is: DATA: |o cnr gaf TYPE REF TO it tpmenr_gaf, lo-fpm TYPE REF TO If _fpm o_tpm ipmfactory=>get_instance( ) ovenr_gat P= lo fpmoget_service( cl_fpmservice manager=>ge_key enr_gaf } lo_enr_gat ->detine_butt on( EXPORT! NG iv_variant_id < optional; e.g. ‘variant_t'; current variant if skipped > ivomai nst ep_id € optional; ‘mainstep 1’; current mainstep if skipped > ivosubvariant_id = ¢ optional; subvariant xyz’ > ivosubstep id = < optional; substep 99°> i vtfunet i on < 8.9. EXIT_TO, FINISH, OTHER FUNCTIONS (appl-speci fic buttons}, SAVE DRAFT. NEXT STE?) see also IF FP CONSTANTS=59c_ button > iv_sereen < optional; the screen where the Ul-Element has to be changed (INIT, MAIN} > lv_element_ié = < optional; only if you want to change the properties of application specitic buttons afterwards> optional; only it you use OTHER FUNCTIONS; determines the place where to insert this button > optional; Button: Design > optional: Button- Enabling > optional: Butlon- Explanation > optional; determines the Event-1d for a bull possi dle with standard buttons > iv sequence id iv design Iv_enabl ed iiv-expl anation not Iv_tert = < optional; Button-Label > Ivoteoltip < optional; Butlon-Tool tip > Ivovi sibility < optional; Butlon-Visi bility > ividet ault button = < optional; only for NEXT bulton; by pressing enter within an application triggers the action of this button> ) iv_hot key =< optional; key-combination for activating the event of this out ton> FPM Cookbook lo_enr_gaf ->deti ne_but ton_choi ce( EXPORT! NG. Tv_variant_id = < optional; e.g.'variant_1'; current variant if skipped > Iv_mai nstepid optional;'mainstep 1°; current mainstep if skipped > Ivosubvariant_id optional’ suovari ant_xy2' > ivosubstep_id optional’ suastep 99°> iv funet i on ¢.9. OTHER FUNCTIONS (appl-specitic button choi ces) > Iv_sereen =< optional; the screen where the Ul-Element has to de changed(INIT, MAIN) > lvelement_ié = < optional; only if you want 10 change the button: choice properties alterwards> Iv_sequence id = < optional; only if you use OTHER FUNCTI ONS: determines the place where lo insert this bulton-choice > iv_enaal ed < optional; Button-Choi ca: Enabling > iv tent < optional; Button-Choice-Label > iv tooltip < optional; Button-Choice- Tooltip > Ivovisiility < optional; Button-Visibility > itlmenu_actionitems = < menu elements of @ Button-Choice > 4.4.2 Changing the IDR at Runtime During runtime you can use the IDR API to make a number of changes to the header, This API consists of the methods encapsulated in the interface IF-FPM_IDR. The first step in using this API is access it, as shown in the coding below: To if fpm yo>get_instance ( uservice( ¢l_fpm_service_manage c_key_idr ) The following chapters give a detalled description of the available methods: 4.4.21 Header Area + GET_APPLICATION_TITLE: Retrieves the title text and its tooltip. + SET_APPLICATION_TITLE: Puts a new title text and the tooltip into the header. + SET_HEADER VISIBILITY: This method can be used to change the visibility of the header. 4.4.2.2 Ticket Area © GET_TICKET: Retrieves the texts of the ticket top and bottom and their tooltips. = SET_TICKET: Changes the texts of the ticket top, ticket bottom and their tooltips. © SET_TICKET_VISIBILITY: Alters the visibility of the ticket area. 4.4.2.3 Items Area + ADD_ITEM_GROUP_BY_VAL: Use this method to add a new item group to the item area. One item consists of a labol, its tooltip, a value and the value's tooltip. A group of items consists of an arbitrary FPM Cookbook amount of such items. By using this method, you can add items to the FPM as simple static text strings. Therefore if the value of an item needs to be changed on a later point of time, you will need to-call method change_item_group by val. The method add_item group by _refcan also be used to pass WD context nodes to the IDR. In this case the value changes automatically, when the value of the corresponding attribute in the context node changes. * CHANGE ITEM GROUP_BY VAL: This method changes the label and values that where passed to the IDR via the method add_item_group_by val. + ADD_ITEM_GROUP_BY_REF: Similar to add_item_group_by_val, this method is used to add labelivalue items to the IDR. In this case the value is not passed as a static text but as reference to a WD context node attribute. The advantage here is that the value can be of a type other than string, In addition, updating the value happens automatically whenever the attribute of the context node changes, the IDR changes the visible value. It is also possible to have the IDR show the unit of the value. This is done using a flag; the actual unit is taken from the DDIC information of the value's. type. Therefore this feature will only work if the type of the attribute in the context node that is passed to the IDR has a defined DDIC unit. + ADD_NAVIGATION_ITEM: This method is used to add pairs of label / navigation links to the IDR. The link itself has to be provided by the report launchpad. It doesn't matter whether the link in the report launchpad comes from the database or is created dynamically during runtime via the report launchpad API. For more information about the report launchpad please refer to the report launchpad documentation. You specify the launchpad via the parameters instance and role. Since one launchpad may contain several targets and this method is used to add only one target, you need touse an additional parameter in order to specify the single target. That adcitional parameter is either the application alias or the navigation key. + CHANGE_NAVIGATION_ITEM: This method is used to change a pair of label / navigation link that has been added using the method ADD_NAVIGATION_ITEM. Itis only possible to change the label and the link text with this method. If you want to change the target itself you have to use the report launchpad API + ADD_IMAGE_ITEM: This method is used to add pairs of label / icons to the IDR. * CHANGE_IMAGE ITEM: This method is used to change a pair of label / icon that has been add via the method ADD_IMAGE_ITEM. + CONTAINS_ITEM_GROUP: Checks whether a certain item group exists within the IDR. * REMOVE _ITEM_GROUP: Removes a certain item group. + INITIALIZE_ITEMS: This method is used to clear all items. + SET_ITEMS_VISIBILITY: This method is used to change the visibility of the item area (i.e. the Visibility status of all items, not single items. 4.5 Sharing Data Across Different User Interface Building Blocks When the UI building blocks of an application are implemented in several components there is often the need to share data across these components. Technically several approaches can be taken to achieve this, as described in the following chapters. For this purpose, the FPM offers so called “shared data’ components. This is an optional FPM feature which should suit most of the application demands. However, if needed it can be replaced by other technical altematives as described in chapter 3.5.2. 4.5.1 Using a Shared Data Component A shared data component is a ‘normal’ Web Dynpro component which implements the TF_FPM_SHARED_ATA interface. This interface contains no methods or attributes but serves as a marker interface only. FPM Cookbook Each component (e.g. Ul building block, FPM_OIF|GAF_CONF_EXIT-component) wanting to use such a shared data component only needs to declare a usage to the shared data component. For this, the technical type of the usage does not need to refer to I? _PeM_SHARED_DATA (by this it would not have any accessible methods/attributes) but links to the actual component itself. The lifecycle handling is now handled completely by the FPM: Whenever a component is instantiated by the FPM (e.g. a UIBB which is configured for a given screen), the FPM analyzes all usages of that component. In case it detects a usage pointing to a component which implements the T>_F®M_SHARED_DATA interface a singleton of this shared data component is automatically attached to the usage. ‘As a result an application has to follow the following steps to share data using the shared data interface: Create a component which implements the IF_FPM_SHARED_DATA interface. ‘This component now typically contains methods to retrieve data from the business logic and exposes the extracted UI data via its Web Dynpro context or interface methods. = Each component accessing these shared data defines a usage of the shared data component. This usage is automatically instantiated by the FPM. ‘+ The consuming component can now communicate with the shared data component via Web Dynpro context mapping, attribute access or method calls. 4.5.2 Other Options There are several options to share data between Web Dynpro components besides the optional FPM “shared data” concept. Reasons not to use a Shared Data component could be: ‘© There is already an application specific API available which can serve as a ‘data container’ and can be accessed by several components. ‘©The data needs to be shared not only between Web Dynpro components but also between further entities such as ABAP OO classes, function groups, et. ‘© The amount of data to be shared is so large that putting it into a Web Dynpro context would lead to performance and memory consumption issues. In these cases the application can consider using techniques such as ‘+ An ABAP OO class which is accessible as a singleton, so that all consumers share the same instance ‘© Afunetion group with appropriate function modules. 4.6 Using an Application Specific Configuration Controller Using an application specific Configuration Controller (AppCC) allows you to ‘+ Make global checks (Checks affecting more than one UIBB) ‘+ Make global adjustments for FPM events + Read the structure of your application at runtime ‘© Change the structure of your application dynamically This is the place where all the things affecting more than one single UIBB can be performed. The use is optional, so you need to provide an AppCC only it you need one of the features AppCC offers. In order to provide an AppCC you have to implement the interface IF_FPM_OIF_CONF_EXIT for the OIF (or IF_FPM_GAF CONF EXIT for the GAF) in a Web Dynpro Component. This Web Dynpro-Component is either one of the components already used within your application or a completely new one. You have to declare the AppCC component to FPM by entering its name (and optional a configuration key) in the floorplan components configuration in the node APP_SPECIFIC_CC. FPM Cookbook ui ume) f eansee FEL Message Paranaters | nso q It your AppCC has declared a static usage to a component implementing IF_FPM_SHARED_DATA this, shared data component is instantiated and attached automatically by the FPM framework, assuring that all Components within your application accessing this shared data component will see the same instance of it ‘The AppCC Interface contains only one method OVERRIDE_EVENT_OIF for the OIF (or OVERRIDE_EVENT_GAF for the GAF) which passes an object of type IF_FPM_OIF (or IF_FPM_GAF) which serves as AP! or the applications. The method OVERRIDE_EVENT_*-Method is called at the start of event processing, right after FLUSH has been called on all visible UIBBs. 4.6.1 Event Cancellation AppCC is the only place where you can perform global checks which apply to more than one UIBB. In order to check the event, itis available as an attribute of IF_FPM_OIF (or IF_FPM_GAF). Ifit's necessary to cancel the event out of AppCC, simply call the method CANCEL. EVENT. 4.6.2 Selecting a Variant With method 10_ FPM_OIF->SET_VARIANT you can select the variant to be used in the event that there is more than one variant configured. 4.6.3 Adjustment of Events IF_FPM_OIF (or IF_FPM_GAF) provides the currently processed FPM event as a changeable attribute. Therefore it's possible to change the event (addiremove/change event parameters even replace the event) ‘As AppCC is called right at the beginning of the event loop, changing the event has the same result as if the changed event had been raised instead of the original event. FPM Cookbook 4.6.4 Read the Configuration at Runtime The AppCC-API offers several methods for applications wanting to read the configuration data at runtime: * GET_CURRENT_STATE returns the current navigation state within the application (which step, view, ... is currently displayed, which variant is used, ..) © GET_VARIANTS returns a list of all available variants. + GET_UIBB_KEYS returns a list of all UIBBs assigned to a specified step, substep or subview. + GET_UIBB_KEYS_FOR_CONF_STEP and GET_UIBB_KEYS_FOR_INIT_SCREEN retum lists of UIBBs assigned to the initial screen and the confirmation screen. Only for OIF: © GET_MAINVIEWS returns a list of all views for a specified variant. + GET_SUBVIEWS returns a list of all subviews for a given main view. Only for GAF: + GET_MAINSTEPS retums a list of all main steps within a given variant. + GET_SUBSTEP_VARIANTS returns a list of all substep variants for a given main step. © GET_SUBSTEPS retums a list of al substeps for a certain substep variant. © GET_HIDDEN_MAINSTEPS retums a list for all hidden main steps 4.6.5 Change the Configuration at Runtime Changing the configuration at runtime is also supported by AppCC-API * ADD _UIBB offers the possibility to dynamically add another UIBB to a subview, step or substep. + REMOVE_UIBB offers the possibility to remove a UIBB from a subview, step or substep. Only for OIF: = ADD_MAINVIEW allows you to dynamically add a new view at runtime. REMOVE_MAINVIEW allows you to dynamically delete a view at runtime. ADD_SUBVIEW allows you to dynamically adde a new subview. REMOVE_SUBVIEW allows you to remove a subview. RENAME MAINVIEW renames a main view. RENAME_SUBVIEW renames a subview. SET_SELECTED_SUBVIEW allows you to change the target subview within the main view. This method should only be used in order to make a main view switch such that a subview other than the first is displayed, Only for GAF: ‘+ RENAME_MAINSTEP renames a main step dynamically at runtime. + RENAME SUBSTEP renames a substep dynamically at runtime. + ENABLE_MAINSTEP enables/unables a certain main step + HIDE_MAINSTEP can be used to hide a main step within the roadmap. This means that the affected imain step will be not visible as a step in the roadmap anymore. Nevertheless the hidden steps continue to be processed in the background in order to keep the business logic untouched FPM Cookbook 4.7 Using an Application Controller ‘Sometimes itis necessary for the application to participate at all FPM events that happen during the entire lifetime of the application with one arbitrary single component instance. This might be necessary for controling and steering the application as a whole. This is not possible for example with simple plain Ul building blocks, since the methods provided by the WD interface IF_FPM_UI_BUILDING_BLOCK only participate in the FPM eventloop when the corresponding Ul building blocks are visible at the time the eventloop happens or will get visible after the current event loop has been finished successfully. Furthermore the Ul building blocks cannot make assumptions about the sequence they are called with. Therefore an application controller is provided that closes this gap and gives the possibilty to control and steer the application as a whole The application controller is a singleton instance of a WD component provided by the application. In order to Use a WD component as an application controller, the following two steps have to be executed: ‘+ Choose a WD component and let it implement the WD interface IF_FPM_APP_CONTROLLER. ‘= Insert the component you have chosen into the OIF or GAF configuration. To do so open the configuration with the configuration editor, press the button choice named “Display” on the left side and choose the entry “global” settings”. Then a popup will open for inserting the component. Regarding the behaviour of instantiating of WD components and participation within the FPM eventloop, the WO interfaces provided by the FPM can be devided into two categories: + Category one: More than one WD components may implement this WD interfaces. Those which do, may have more than one instances and the instances may only participate in a part of the FPM eventloops during the application lifetime. The following WD interfaces belong to this category: IF_FPM_ULBUILDING_ BLOCK, IF_FPM_TRANSACTION, IF_FPM_WORK_PROTECTION, IF_FPM_RESOURCE_MANAGER «Category two: Only one WD component should implement this WD interface. The corresponding WD component has only one instance which participates at all FPM eventloops that happen during the applications lifetime. The following WD interfaces belong to this category’ IF_FPM_APP_CONTROLLER, IF_FPM_SHARED_DATA, IF_FPM_OIF_CONF_EXIT respectively IF_FPM_GAF_CONF_EXIT. Having that said, itis clear that when using the interfaces IF_FPM_APP_CONTROLLER and IF_FPM_OIF_CONF_EXIT respectively IF_FPM_GAF_CONF_EXIT together they should be implemented by the same WD component. Furthermore itis recommended (but not necessary) to implement the WD interface IF_FPM_SHARED_DATA also in that WD component (of course only if this WD interface is needed), The WD interface IF_FPM_APP_CONTROLLER contains similar methods than the WD interface IF_FPM_UL_BUILDING_BLOCK. For each method of IF_FPM_UI_BUILDING_BLOCK the WD interface IF_FPM_APP_CONTROLLER has two corresponding methods with the prefix “BEFORE_" respectively ‘AFTER_". For example BEFORE_PROCESS_EVENT and AFTER_PROCESS_EVENT. As the naming suggests the method BEFORE_PROCESS EVENT is called right before any other call to the corresponding Ul building block method PROCESS_EVENT whereas AFTER_PROCESS_EVENT is called right after all calls to PROCESS_EVENT are finished. 4.8 Handling of Transactions Transactions can be handled in FPM by implementing the WD interface IF_FPM_TRANSACTION. This is an optional interface, meaning that not all applications will need to implement this interface unless they choose to handle transactions in a systematic manner as defined by the FPM. An application can choose to handle the transactions independently without needing to implement the interface but using this interface will guarantee that 1. There is a logical sequence in which the interface methods are called. 2. The transaction steps can be split up into the sequence in which they are supposed to be processed. 3. There is a check — save — validate sequence that provides high transaction integrity. 4. The check ~ save ~ fail - recover sequence provides the required robustness to the transaction. FPM Cookbook ‘The following are the interface methods of the WD interface CHECK_BEFORE_SAVE save APTER_COMMIT APTER_REJECTED_SAVE ‘The methods are called in the sequence depicted below: new FPM Cookbook Start event processing Is transaction interface implemented? Allow the application to handle the event i internally | Call the interface methods CHECK_BEFORE_SAVE q SAVE Exception? Was save not, successful? ¥ ¥ AFTER_REJECTED_SAVE AFTER_COMMIT Complete transaction event processing Please consult the FPM design document for the detailed sequence diagram for the method calls. How to use the transaction interface FPM Cookbook 1. Select a component that will contain the business logic to be executed on a save event. This could be any component known to the FPM - this means any UIBB or any Shared Data component used by the UIBBs of your application... 2. Inthe component view in SE80 you should add the interface IF_FPM_TRANSACTION as an implemented interface. (In the example below we have used the main controller to implement the interface) In edit mode, add the IF_FPM_TRANSACTION interface. | itera sr fre mae raRoETI oso maon, a ‘You will see the following methods in the component controller [re ato.rer— ewes [Tjtersecic: sit oneves=) 3. Fora save event you will always need the data to be saved. This can be realized in many ways: a. Use a shared data component (see section on shared data for further details). nee FPM Cookbook b. Use direct context binding, c. Use an assistance class. The decision to use any or a combination of the above methods is taken by the application developer. The following is the use case for each of the methods: CHECK_BEFORE_SAVE This method has a returning parameter which indicates whether the validation before a save to the database will be successful. Use this method as the trial for save and then return a true if the trial save was successful and false if it was not. SAVE This method is used to do the actual save and any possible commit. tis called where the check _before_save has returned a false (please note that the semantic of the retum parameter of the check_before_save is negative and reads ‘rejected’. In other words, a false value for rejected means that the check _before_save was successtul) ie. if rejected = false (meaning the trial was successful). In case of errors while saving you should return rejected = true so that the AFTER REJECTED SAVE can be called. If the save was indeed successful then the method AFTER_COMMIT is called. Please refer to the flow chart for more details. AFTER_COMMIT You can perform clean up activities like releasing database locks, releasing other resources, trigger an event for processing after successful commit. AFTER_REJECTED_SAVE Typically here you can perform your roll back activities. Also locks and resources can be released. Note: (Once the interface is implemented the FPM identifies the corresponding component that has the method to be called in sequence and calls the methods on this component in the same sequence as defined above. FAQ on transaction 1. On what event wil these methods be called? > These methods will be invoked on the standard FPM SAVE event. 2. Can | have the FPM call these methods on my own custom event? > No. These methods are called as part of the standard FPM event loop and hence will not react to custom events, 3. Can I have multiple components implement this interface in the same application? > Yes, you can. The FPM will call all the methods on all the implementing components. But our general recommendation is to use only one central component for transaction handling, FPM Cookbook 4.9 Navigation API To navigate to a specific target out of your application you can use the ‘You can also’ and ‘Related links’ functionality The usage and configuration of ‘You can also’ and ‘Related Links’ is identical. So only the ‘You can also’ ‘functionality is described. You will find this functionality on the right hand side of the toolbar. Birime HH From FRA Yo.FK Flight rte #0008 Passengerfome eoked on tne ans Figtre 0400 compare, FRAN LRT owe: 3EI02E Bm: fom sana newyork Sj ove cato2MK toe ee fie ‘60p008) oneey ces: a Osean ease nse ot First you must create a launchpad. To do that call transaction LPD_CUST. In the first screen press the button ‘New Launchpad’. Enter a name for the role and instance and a description in the popup. In the field namespace you must enter the package namespace of the package that you want to use to transport the launchpad. Ifthe package has the default namespace you don't need to enter any namespace. In the following screen, enter some navigation targets. Press the button ‘New Application’, enter a text and choose an ‘Application Type’. Depending on the chosen application type you must enter further information such as @ URL oF transaction code. het FPM Cookbook SAP, LFS CGO SHE O5o5 BA Oe >= Change Launchpad for Role YOU_CANT and instance ALSOT (Di ew Pode DY New iticain | 400 Sepa TF Deke ooale ew yeneTires Lines and GriuratDeserion Deseme ‘ost ias PoslkatnGannalBeRemowdtomtheLanciwad Bopleon Caeser ‘Aseliaton Sategony URL SAP BI Report cower) SAPBLRepoM ged Texpiate) Reo vitor Wokdnero Jaa focomare azar usual composerigpe To activate the ‘You can also’ functionality you must go to the component configuration in your application and add the ‘You can also’ Toolbar Element. Enter the role and instance of your launchpad. When you have saved the changes the ‘You can also’ link will be displayed in your application with the appropriate Launchpad entries. «vate Yon =) (a ese] Bel vasa vert a eee Application tite ce) a ‘por YOR TEST PERS EER ‘common Nae 2 TEST RS. CORE Atributos You can Also a ie Eek TE ow BB) tee al new FPM Cookbook 4.9.1 How to Access the Navigation APIs. There are two navigation interfaces: IF_FPM_NAVIGATION is used to start an application using a given launchpad. The intertace IF_FPM_NAVIGATE_TO allows you to navigate to a target without using a launchpad, 4.9.1.1 Interface IF_FPM_NAVIGATION (Runtime class CL_FPM_NAVIGATION) To get access to the Navigation API you can use the interface IF_FPM. It provides the method GET_NAVIGATION( ). It returns an instance of the Navigation API IF_FPM_NAVIGATION. The Navigation interface provides a list with all customized applications of a given Launchpad. Table: MT_TARGETS Parameters: Type kind Type Deseription entry type Type FPM_NAVIGATION_TARGET_TYPE | Type of application parent Type String Guid of the parent folder or initial key Type String Guid of application alias Type String A.unique identifier for an application. Itis defined in the customizing of the Launchpad text Type text255 Text of the link description Type string Description icon_path Type string Path to an icon enable Type boole_d Determine if an application is| active/enabled or inactive/disabled visible Type boole_d Determine the visibility of an application Domains Domain: FPM_NAVIGATION_TARGET_TYPE 1D: Description APP Line contains an Application FOL Line contains a folder SEP Line contains a separator The Navigation interface provides the following methods: Meth AVIGATE Parameters: Direction Type kind Type Description FPM Cookbook IV_TARGET_KEY_| importing Type string Guid of Application ‘This method is used to start the navigation of an application. Method: MODIFY Parameters: Direction Type kind Type Description IV_VISIBLE importing Type BOOLE_D Set an application to visible/invisible IV_ENABLE importing Type BOOLE_D Enable/disable an application IV_TexT importing Type string An alterative text for the application IV_DESCRIPTION | importing Type string Anatterative description for the application IV_TARGET KEY_| importing Type string Guid of Application Iv_NOTIFY importing Type BOOLE_D Invokes notification on all registered nodes / abjects. ‘The method MODIFY is used to change some attributes of an application. You can change the visibility of an application, you can enable/disable an application, and change the description and text. Method: SET_FILTER Parameters: Direction Type kind Type Description IT_Filter importing Type T Filter Guids of application that shouldn't be provided in the list, of application ‘The SET_FILTER method provides the functionality to remove some applications from the list of applications that the Launchpad provides. Method: MODIFY_PARAMETERS Parameters: Direction Type kind _| Type Description ID_TARGET_KEY importing Type STRING Guid of Application IT_APPLICATION_PARAMETER | importing Type ‘APB_LPD_T_PARAMS | Contains application parameters that will be added or changed IT_BUSINESS_PARAMETER | importing Type APB_LPD_T_PARAMS | Contains business FPM Cookbook parameters that will be added or changed ‘The method MODIFY_PARAMETERS can be used to change the values for existing parameters or to add the parameter if none exists. Method: ADD_BEX_ANALYZER Parameters: Direction, Type kind Type Description IV_PARENT_FOLDER_ID importing Type FPM_APPLICATION_ID Guid of parent folder. Ifthe parameter is emply the application will be added at top level IS_BEX_ANALYZER_FIELDS importing Type FPM_S_BEX_ANALYZER Structure that contains all fields to add a BEx Analyzer EV_APPLICATION_ID exporting Type FPM_APPLICATION_ID Guid of Application ET_MESSAGES exporting Type FPM_T_T100_ MESSAGES Error messages: EV_ERROR exporting Type BOOLE_D Status: false: the application was added, true: an error occurs This method can be used to add an application of type BEx Analyzer to a given launchpad. There are also to methods with a similar interface to add a specifiy application at runtime to a launchpad: ADD_URL ADD_TRANSACTION ADD_REPORT_WRITER ADD_OBN ADD_INFOSET QUERY ADD_FOLDER ADD_BI_ENTERPRISE_REPORT ADD_BI_QUERY ADD_8I_TEMPLATE ADD_KM_DOCUMENT ADD_PORTAL_PAGE ADD_VISUAL_COMPOSER ADD_WEBDYNPRO_ABAP ADD_WEBDYNPRO_JAVA FPM Cookbook Method: REMOVE Parameters: Direction Type kind | Type Desoription ID_APPLICATION_ID importing Type STRING Guid of Application This method can be used to remove an application from a launchpad, 4.9.1.2 Integration: Navigation in the Eventloop If you call the method IF_FPM_NAVIGATION-NAVIGATE a new event object of type cl_fpm_navigation_event will be created. This event object contains all application parameters. In the interface IF_FPM_U|_BUILDING_BLOCK there is a method process event which you can use to get the navigation event again to change any parameters: In this method you need to implement the following sample code: At first check if the event a navigation event check io_event>MV_EVENT_ID = io_event->ge_event_navigate. and make a cast from the event object to the cl_fpm_navigation_event object, DATA Ir_event type ref to cl_fpm_navigation_event. I_event ?= io_event. Get the business parameter I_bus_parameter ?=Ir_event->mo_event data. Get the launcher parameter Ir launcher_parameter 2 _event->mo_launcher_data With the method Ir_parameter->TO_LPPARAM( ) you will get a internal table with the parameters. If you want to change any parameter you can use the methods of Ir_parametets, like get_value, set_value or delete_value, If the event processing requires further user interaction (e.g. ask for further data in a popup) the event processing can be deferred by returning EV_RETURN = IF_FPM_CONSTANTS~GC_EVENT RESULT- DEFER. If the result of the event processing is ok you can return EV_RETURN IF_FPM_CONSTANTS~GC_EVENT_RESULT-OK otherwise EV_RETURN IF_FPM_CONSTANTS~GC_EVENT_RESULT-FAILED To prevent a loss of data you can implement the method NEEDS_CONFIRMATION that is located in the interface IF_FPM_UI_BUILDING_BLOCK. In this method you get also the navigation event and you can decide to raise a ‘Data Loss’ Popup. If you want to do that you must retum the following value: e0_confirmation_request = cl_fpm_confirmation_request=>go_data_loss. FPM Cookbook For further information, see also a Powerpoint presentation by Holger Bohle. 4.9.1.3 Interface IF_FPM_NAVIGATE_TO To get access to this Navigation API you can use the interface IF_FPM. It provides the method GET_NAVIGATE_T0(). it returns an instance of the Navigation API IF_FPM_NAVIGATE_TO. It provides a set of methods to launch an application without having a launchpad. Method: LAUNCH_BEX_ANALYZER. Parameters: Direction Type kind Type Description IS_BEX_ANALYZER FIELDS _ | importing Type FPM_S_BEX_ANALYZER Structure that contains all fields to add a BEx Analyzer ET_MESSAGES exporting Type FPM_T_T100 MESSAGES Error messages EV_ERROR exporting Type BOOLE_D Status: false: the application was added, true: an error occurs This method can be used to launch an application of type BEx Analyzer. There are also methods with a similar interface to launch a specific application LAUNCH_URL LAUNCH _TRANSACTION LAUNCH _REPORT_WRITER LAUNCH _OBN LAUNCH _INFOSET_QUERY LAUNCH FOLDER LAUNCH _BI_ENTERPRISE_REPORT LAUNCH _BI_QUERY LAUNCH _BI_TEMPLATE LAUNCH _KM_DOCUMENT LAUNCH PORTAL PAGE LAUNCH _VISUAL_COMPOSER LAUNCH _WEBDYNPRO_ABAP LAUNCH _WEBDYNPRO_JAVA 4.10 Navigation Customizing 4.10.1 Creating a New Launchpad Call transaction LPD_CUST and press the button ‘New Launchpad FPM Cookbook ole FPULNAY 2 Instance YOU_CAN ALSO Description Namespace Enter a role, an instance and a description in the popup. You can use the role for a kind of grouping if you have several launchpads. To transport a launchpad you need a package. If this package has a namespace you must enter this namespace into the field namespace. 4.10.2 General Settings ‘You will find ‘General Settings’ in the menu: Extras -> General Settings. These settings are valid for all applications in a launchpad. ‘DEW Navigation Moe UserSeiofdee. Seutse Bele i Acsee= Tyee Sytem Detaut > ‘Access replicated datz Diet Sc¢9%2 4 oporatho dats You can set the OBN navigation mode here. ‘User Set of Roles’ means that an OBN target can be assigned to any roles that are assigned to a user. ‘Source Role’ means that the navigation target must be assigned to the same role as the application that uses the launchpad. The Bl Access Type defines the data source that will be used by a BI application. The ‘Bl System Default’ means that the decision of the data source is on the Bl side. ‘Direct access to operative data’ means that the data source is an ECC system. If you choose ‘Access to replicated data’ that data source is the Bl system. 4.10.3 Source Parameter To support parameter mapping you can define a set of parameters that are know by the application that uses the launchpad. nye FPM Cookbook a (4) CE) You can call the popup in the menu Extras->Source Parameters. 4.10.4 Parameter Mapping ‘Some application types has a button ‘Parameter Mapping’ at the end of the ‘Parameter input feld. If you press this button the following popup will be displayed: @ XS) CSS we) Paces espe apc ty et ale rs nme wane ae ee You can enter here in the parameter field the parameter name that the FPM application will send to the starting application, In the field ‘Replaced by’ you must enter the parameter name that the starting application will expect. If you launch an application the launchpad automatically replace the parameter that was send by the FPM application by the parameter that the application expected, 4.10.5 Copy a Whole Launchpad Call transaction LPD_CUST. In the screen ‘Overview of Launchpads’ choose ‘Read from other system by RFC’ in the Launchpad menu. RFGDesnaton| aaa (ix) It you leave the RFC-Destination blank, you get a lst of all aunchpads in your current client. You can also enter an RFC-Destination to another system and client in order to obtain the list of launchpads there. nye FPM Cookbook Pt WRT) Ee oats na ee Bergices thee Betton: Re. on VBathon tr eee Capture Bertie: Choose the launchpad that you want to copy and press ok. A popup will be displayed so that you can enter another role or instance. Instance SUSP_RESUM ] It the displayed values are ok, the launchpad will be copied into your current system and client. 4.10.6 Copy Applications From one Launchpad to Another Launchpad In the Launchpad customizing you can press the ‘Copy from other Launchpad’ button and you will get a list of all |aunchpads that exists in the client. After you choose a launchpad a second tree will be displayed and you can take over application to you current launchpad. You can also take over folder with their content. 4.10.7 Searching Over all Launchpad of a Client To initialize the search you must at first run the report APB_LPD_UPDATE_SEARCH_TABLE. This report analyze all launchpads in a client and forward the information into a search table. The teport is only required, if launchpads already exists in the client. In the Launchpad customizing you can now press the search button and you will gt a list that contains all application of all launchpads in the current client. You can search now over the whole list and can select a Tine that contains a hit. If you press the ok button a second tree with the selected application is displayed 4.10.8 Display a SAP Delivered Launchpad if a Customer Version Exists If a customer makes any changes to a given launchpad a customer version of the launchpad will be saved. To display the SAP delivered launchpad again you must choose Extras->SAP Version on/off nye FPM Cookbook TESTI. | ju essen ‘= Sin BSR EES (oneneoooan om =D ed A second tree on the loft hand side will be displayed and shows the SAP delivered launchpad. 4.10.9 Transport The transport of a launchpad depends on the system configuration. For further information take a look at note 1165160 5 FPM for Experts 5.1 Handling of Application Specific Popups In order to process a given event (in method IF_FPM_UI_BUILDING_8LOCK-PROCESS EVENT; see chapter 2.4.3.6.) it may be necessary to gather additional information from the end-user by means of a popup. This might be as simple as a standard popup with some text and a set of buttons, but could contain more complex screens with input fields, checkboxes, ete, With normal WD programming, such procssing can become very cumbersome since WD popups cannot be processed in a synchronous way (i.e. tigger the popup, wait for it to be closed and continue processing), This means that the UI building block would need to return the result of the event processing (OF or FAILED) before the popup could be processed, In order to achieve synchronous popup handling, the FPM allows you to defer the processing of the event loop and resume it after the popup has been processed: FPM Cookbook + Defer current event processing This is done in method process_event: ev_result = if_fpm_constants=>gc_event_result-defer + Register a popup This is purely WD ABAP and not a feature of the FPM. Therefore you should look up the WD ABAP documentation regarding WD ABAP popups in general. Nevertheless here is a short describtion of how to do this. First of all the registration of the popup needs to be triggered in the method process_event because this will be the last method until program control returns to the FPM. However, for an application specific popup you need your own WD ABAP View and the registration of the popup is only possible from within this View. For this reason in the method process_event you need to call a method of the View that is supposed to be used for the application specific popup. ‘Since view methods cannot be accessed from within methods of the component controller the WD ABAP eventing mechanism needs to be used: raise an event in the method process_event and register an event handler on the corresponding view. Here is a detailed lst: a) Create a new WD ABAP View, ©. g. "POPUP_CARRIER’. b) In the Component Controller create a new WD ABAP Event, e. g. "REGISTER_POPUP ¢) In the method process_event raise the WD ABAP Event "REGISTER_POPUP_EVNET d) In the View POPUP_CARRIER create anew method e. g. ‘REGISTER_POPUP" of type event handler for the event "REGISTER_POPUP_EVNET” ¢) In the method REGISTER POPUP use the ABAP Window API in order to create a popup, register action handler methods to the buttons of the popup and register the popup for opening. Here is a coding fragment showing how this could look (the sample coding uses a standard popup with the buttons “yes” and “no’) DATA: leap TYPE lo_window_manager TYPE o_view_ap. TYPE Lo_popup TYPE lo_api = lo window manager = lo_api->get_window_manager( } lo_view_api wd_this->wd_get_api( ). 1o_popup = lo_window manager->create_popup_to_confirm{ pup text n_kind if_wd_window=>co_b ‘ons_yesno message_type = if_wd_window=>co_msg_type_question window titie = ‘some popup title window_position = if_wd_winde center ) CALL METHOD 1o_popt EXPORTING button = if_wd_window: * ONRESUME_EV?_¢ >subscribe_to_bu act action_view = lo_view_api CALL METHOD 1¢_popup->subseribe_to_button_event EXPORTING button £_wd_window->co_button_no action_name = 'ONRESUME_EVT_FA action_view = to view_api opup->open( } 9) Create WD ABAP actions and handler methods for the actions that come from the popup, in this case from the yes- and the no-button. In the example above the names are ONRESUME_EVT_OK and ONRESUME_EVT_FAILED. + Resume the event Once the user input required has been obtained, the frozen FPM event can be continued, either having the result OK or FAILED. To do £0, you simply have to call the FPM method resume_event_processing within the action handler methods for the buttons of the popup. This could look like this: FPM Cookbook DATA 1e_fpm 1 1o_fpm = cl, o_fpm->z REF To if _fpn. ctory=>g vent_proce: vent_result-ok } After the event is resumed the remaining UI building block will be processed ( in case there are more than one). The following diagram summarizes the described behavior: (uma) cca] [ago] [ai eee at Sea a ee sono Le earainse opup bution | = QmLActionopup Button, =e Resume_Event >rocessing}OK J FAILED'Y etyat ot event pmcessng, omen wstrebepewouset] | 9 ‘esis ee oop rocess. Eve soar 5.2 Skipping the Initial Screen Atypical OIF application starts with an initial screen where you select the object you intend to work with. If the object is already known because you are calling the application with the parameters already set, you don't want to see the unnecessary initial screen (Of course there are similar use cases for the GAF). In this case, you need to know how to skip an initial screen at runtime. To do this, you have to launch the FPM event LEAVE_INITIAL_SCREEN, You can do this in the OVERRIDE_EVENT_*-Method of your AppCC or in the PROCESS_BEFORE_OUTPUT Method of one of your intial screen UIBBs in case you don't use an AppCC: data: lo_fpm je ref to if_fpm, vobject_id type string. FPM Cookbook * check event id if lvevent_id = if_fpm_constants=>gc_event_start. * Determine if Parameter OBJECT_ID is provided lo_tpm = cl_fpm_factory->get_instance( } o_fpm->mo_app_parameter >get_valxe( exporting iv_key = 'OBJKCT_ID" importing ev_value = lv_object_id }. * In case OBJECT_ID is set navigate directly to the main floorplan * area if not lv_object_id is initial. Lo_fpm-draise_event_by_id( i f_fpm_constants=>ge_event-leave_initial_sereen } endif endif 5.3 Work-Protect Mode ‘The FPM allows the application to make use of the “work-protect mode" offered by the Portal and the NWBC (ie. showing a data-loss popup when the application is closed but contains unsaved data). ‘Thecurertsessun ray contah usar a ‘Bo you want te cose the session wilhaut saving? (5S) (Biawsie| nie saa) he FPM Cookbook In order to achive this behaviour the application needs to ‘tell the FPM whether it contains unsaved (i.. ‘dirty) data or not. For this the FPM provides the WD-Interface IF_FPM_WORK PROTECTION with the one and only method IS_DIRTY: ‘cnterlace \F_FPM_WORK_PROTECTION 1S_DIRTY : bool This interface can be implemented by any application (WD-) component which is known to the FPM (e.g. any UI building block or a shared-data component). At runtime the FPM will detect all components implementing this interface. If any of these components signals unsaved data then the application is marked as ‘dirty. This application dity-state is then passed on by the FPM to the shell (ie. the portal or the NWBC). Important: Since the shell-API requires to this information as soon as the application state changes, the IF_FPM_WORK_PROTECTION~IS_DIRTY method is called by the FPM runtime during each roundtrip, Therefore it needs to perform very quickly. A typical implementation might use this skeleton: [e__Wetodtist__Jize_ shod | aw] eo Fear T cure. rae [Fh voB_POTETION BEM Ferra: i Bae evens ED 5 fev direy = aba false. 5.4 Transient UIBBs and Resource Manager Interface Itis possible from NW EhP1 onwards for UIBBs to be made transient in their behavior. Transient behavior means that UIBBs which are no longer used by the applications can be removed from memory so as to increase the performance and the memory footprint of the application. Technically a UIBB is an interface vview and this by itself cannot be released from memory, hence the FPM will release the component containing the UIBB based on certain rules. The rules can be described as follows. 1. The application must use the new schema available from EhP1 onwards. ‘The application developer must have set the transient flag to true via the FPM Configuration Editor. ‘The FPM framework finds that itis technically feasible to release the component. ‘The UIBBs implement the Resource Manager interface and do not veto the transient decision passed by the application via the on_hide method 5. The UIBB has not implemented the resource manager intertace (meaning that it does not have the possibility to voto). ‘A UIBB is defined and identified by the following key: configuration + component + interface view. The transient behavior can only be specified during design time at the level of the application and not at the level of a UIBB or its usage. The transient behavior of the UIBBS can be handled in the following combinations 1. One UIBE per component — The component contains anly one interface view which is used as a UIBB. In this case when the UIBB is removed from the view assembly the component that contains this UIBB will be released, FPM Cookbook 2. Multiple UIBBs per component — The component will be released only when all the interface views that behave as UIBBs are no longer part of the view assembly and the next set of UIBBs for the forthcoming view assembly does not contain a UIBB from this component. In such a case the ‘component cannot be released until all the interface views of this component are no longer part of the visible view assembly. Note that when one of the interface views (UIBB) is removed from the view assembly the component will remain alive if other interface views of the same component are still part of the view assembly or part of the next view assembly. If the application developer has set the global flag to “transient” meaning that the UIBBs (components) can be released then the FPM wil investigate to determine technically whether the component can be released. There are reasons why even if the application developer has set the default to transient the component containing the UIBB cannot be released. The technical feasibility checks are as follows: 1. The component is held as a used component by another component. 2. There are UIBBs from this same component that i stil being displayed. 3. The component implements an FPM interface that does not allow it to be released. The following is the evaluation order by FPM on the release decision of the components 1. FPM checks for the presence of the Global fig. If itis not present then it will treat all the UIBBs for this application as non-transient and hence will not release any components. 2. FPM wil first read the configuration global flag and see if the configuration is set to transient. I the configuration is non-transient then the same information is also passed on to the UIBBs and FPM does not do anything concerning the transient behavior. In other words it will nt be release the components 3. FPM reads the coi following options: a. If the Flag is present then it wll check if the IF_FPM_RESOURCE_MANAGER interface is implemented by the component. I yes, then it proceeds to the next steps. Otherwise it will check the technical feasbilly of the component being released and if itis feasible it wil release it. Otherwise it will retain the component. b. FPM checks whether the component containing the UIBB under consideration is technically capable of being released (please read the reasons above) and if so, it forwards the same status to the UIBBs via the IF FPM_RESOURCE_MANAGER's on_hide method. ¢. _FPM sees that the interface is implemented and that technically it can be released. The same information is passed on to the UIBB. It checks for the veto value from the UIBB. Ifthe UIBB has not vetoed the release state then FPM will release it. Otherwise it will retain it. In either case the on_hide method of the component is called. uration and sees that the global flag is set to transient. Then there are the Depending how the application wants to use the transient behavior, you can make the following settings. Requirement | Transient Implement Veto | Coding with the resource Flag | IF_FPM_RESOUCE MANAGER manager to handle application data Idonotwant | False NA NA transient behavior for any UIBB and I do not want to release any memory Idonotwant | False NA NA | Yes transient behavior for any UIBB but | would like to release some resources Iwantallmy | True NA NA | NA UIBBs to be transient. Ido not have the FPM Cookbook need to release any resources explicit to release any resources. Iwant all my | True Yes No | NA UIBBs to be transient. | want to release some resources explicitly | want only some | True Yes Yes _| Based on need from of the UIBBs to (only | business logic be released. for Some I would those like to retain due that to some do business logic not reasons need tobe relea sed) only want some | True Only on those that need to veto. | Yes | NA of the UIBBs to (or not be released) (only be released. for Some | would those like to retain due that to some do business logic not reasons, for need those UIBBs that tobe are transient relea there is no need sed) 5.4.1 Setting the Transient Flag Step1. Open the FPM Configuration Ecitor and the component configuration. FPM Cookbook Step 3. The global settings pop-up will contain the file for the transient setting, nye FPM Cookbook Step 5. Save the configuration All the UIBBs in the application will be transient. FPM Cookbook 5.4.2 Using the IF_FPM_RESOURCE_MANAGER to Veto the Release Decision ‘Step 1. Open se80 and the WD component. 1B Wivtnveconomt EN Gob Ui Exar aehm ine a7 e 74a OR cose apoE Sana a 2 AAO vs Step 3. The on_hide method should be available in the component controller. neu FPM Cookbook e 48 ece mx nccemm #2 yueo Be Aan! @ 1 Sine 1 Bie a rressce rset Recent” Step 4. The on_hide method will have an importing parameter called IV_RELEASE_COMPONENT which will provide information to the UIBB about the FPM's decision on the release feasibility for the component containing this UIBB. The UIBB will ne to react to this parameter only if the value is “true”. If the UIBB does hot want itself to be released then it will have to set the exporting parameter EV_VETO_RELEASE to “true” (the default is false). FPM will use this veto parameters only if the IV_RELEASE_COMPONENT is true. If the UIBB sets the veto to true then the component containing the UIBB will not be released even if itis capable of being released. Hye FPM Cookbook ° 4a e@e@/GHE oDbe BE OR Web Dynpro Explorer: Change Controller for 2 FPM_TRANSIENT_TUT crear 2 BSaoremsaa B= RESO OOP rn cevrmm comnroamen cr The following table is helpful to understand the final action taken by FPM: IV_RELEASE_COMPONENT | EV_VETO_RELEASE | FPM action False Trueltalse Ignore the veto value: do not release component Tue False Release the component Tue False Do not release the component 5.5 Application Specific Commit This chapter will be provided soon. 5.6 Suspend & Resume With Enhancement Package 1 of NW the suspend and resume feature is available for FPM applications. ‘Suspend and Resume (referred to henceforth as S&R in short) can be described briefly as a feature in which the WD application built on FPM can be placed in a suspended state and navigation can be made to another URL. Further action can be performed on the URL and possible to navigate back to the suspended application. The suspended application is resumed from the same state before navigation. It is possible to ass parameters back and forth to the URL. The current scope provides the basic suspend and resume feature for the applications. Catalogue integration is not part of the scope. The basic settings to utlize this feature include the time out of suspended applications. Session Management and the Suspend and resume feature are provided by technology layers like WD ABAP Foundation, Portal, ABAP Server etc and are not provided or influenced by FPM. ‘Suspend and reusme is supported in the following client environments he FPM Cookbook 1. Stand alone 2. NWBC 3. Portal “Suspend and Resume’ is currently limited to URL-Navigation. In the Report Launch pad customizing the ‘Suspend and Resume is only available for the URL type of report launch pad application type. The same is also applicable to the API that oniy dynamic navigation to URLs vis APIs can utlize the Suspend and Resume methods. There is a uniform may to enable Suspend in applications across all the clients and also a uniform way to resume. But the way in which the external URLs will get the information to navigate back to the WD application will vary. This is not covered in the cook book. Only the FPMs methods to suspend and resume will be discussed here. ‘The usage of report Launchpad is mandatory to enable suspend and resume for FPM applications. Via Static Lauchpad customizing Launch the configuration via the transaction Ipd_cust 4B eee CHR SHO EM @ win’ Es ou Bele ee — Je w\eoe CHK BHSe BE ol sequen Becton: Degen Betn: Bettie eens Bective Begum Batam: ect Gatun eas Bar thicaverans tase Ue erence Bestiicwverming 2.0200 Mongar ate Be tacws sense eran Sagoo orzo Jegoms Geese is ES) Click on the New Launchpad button to create a new Launchpad entry hye FPM Cookbook Instance esenenon Namespace verean Enter the role and area EEE Role feu Intonce IruroRALe FoR coOKBCOK Decenpnon ‘Cairo aupiesone| = Namespace ersten ‘cooooa0sd And click on the okay button. er 240) 00@ ke cocenE Click on the button ‘New Application’ nye FPM Cookbook Fie ae ee oe —_ 0 (sin ece ome cote mn on Enter a link text (say, FPM_TEST) ‘The application alias is useful when you use APIs of the Launchpad and hence recommended. Set the application category to URL. neu FPM Cookbook Enter the URL of the application that should be opened on suspension of the FPM application. We will use the test BSP in this cookbook. Check the Activate Suspend and Resume feature by selecting the check box. neu FPM Cookbook ae ai a ‘When navigation happens from this lauch pad item the application will be suspended. Via Launchpad Dymanic API Its possible from EhP1 of NW to also use navigation dynamically without creating a lauchpad entry. Itis possible to enable suspend and reusme for such navigation too. Note: Please refer to the Navigation chapter on how to get the handle to IF_FPM_NAVIGATE_TO. Once a handle is obtained to the IF_FPM_NAVIGATET_TO object you can call the method LAUNCH_URL to open extemal applications. This method takes in an input parameter IS_URL_ FIELDS of type FPM_S LAUNCH URL. te i hen ae or _— ° Tes 000 OMe SESE EN @: | se cur Fe FUSE BTS BAVA Crointond renenmine neon FPM Cookbook In the structure FPM_S_LAUNCH_URL the field USE_SUSPEND_RESUME should be set to abap_true or e =é8 60¢ Ouw DBon BO OR evo: Opry Sovcare ee FEE Ae AON teonouy wenn application will be suspended. Resuming a suspended application When navigation is performed from the extemal URL back to the Suspended application the FPM event loop is triggered and this is the entry point into the application. The application will need to react to a standard FPM event called FPM_RESUME which should be accessed via the constant CL_FPM_EVENT=> GC_EVENT_RESUME. ‘The event data will contain the URL parameters that are passed from the external URL back into the application. The key to access this is CL_FPM_SUSPEND_RESUME_UTILITY=>CO_RESUME_URL_PARAMETERS ‘The value obtained is an intemal table of the type TIHTTPNVP containing the URL key-values pair passed by the external application, Note that this data will be avaible only during the lifetime of the event object and will not be stored by FPM. The application will need to maintain a copy if they need to access this information latet. Sample coding to resume an application is as follows. COMPONENTCONTROLLER PROCESS_EVENT method. METHOD process_event DATA Lz_event CASE io_event—>mv_event, WHEN €l_fpm_event=>gc_event_resume. get_resume_parameters( ‘c_event } ENDCASE. Method GET_RESUME_PARAMETERS. het FPM Cookbook ORTA: lr_fpmevent_data TYPE REF TO if_{pm_parameter DATA: it pazameters 7YPE tinttpavy data = io_event~>mo_event_data CALL METHOD 1r_fpm_event_data->get_value EXPORTING iv_key pm_suspend_resume_utility->co_resume_url_parameters IMPORTING ev_value = it_url_parameters At the end of this code the internal table it_url_parameters will contain the URL parameters passed back from the external application. The above mentioned coding along with other parts can be found in the test application FPM_TEST_SUSPEND_RESUME in the APB_FPM_TEST package. 5.7 Embedding an FPM FPM was designed for building standalone applications. It is however possible with some restrictions to ‘embed an FPM “application” within another application. To do this, create a usage for component FPM_OIF_COMPONENT for OIF (or FPM_GAF_COMPONENT for GAF) within the embedding component. Then embed the Interface View FPM_WINDOW within one of your views. Finally you have to create the component to be used manually (as you have to provide the configuration key of the floorplan component). This is best done as soon as possible. In most cases this is the WODOINIT method of the embedding component controller: method Wo) data: lo_usage type ref to if wd_component_usage, s_conf_key type wdy_config_key lo_usage = wo_chis->wd if lo_usage->has_act ive, je->de lete_conp: Lo_us: endif ls_conf_key-config_id = <1 uration of FPM ¢ o_usage->create_component name = 'PPM_O=E on_id = ls_conf_key. ‘Some remarks about the code example: The configuration you have to pass is the configuration key of component FPM_OIF_COMPONENT. You can't pass the application's configuration key. ‘+ The code example assumes that the usage is named ‘FPM_USAGE". If you give it another name you have to adjust the line 1o_usage = wd_this->w FPM Cookbook ‘+ The example is for OIF, for GAF you simply have to replace ‘Fry_orr_s YEPM_GAF_COMPONENT’ ‘+ The call of delete_component( ) is not necessary for simple static embedding, however in case you want to change the embedded FPM application later on you need it. There are some limitations using this technique’ © FPM allows only one instance running at the same time within one intemal mode. Therefore you can't embed more than one ‘FPM application’ at the same time. I's possible to switch the embedded FPM application’, replacing one ‘FPM application’ by another. You can assure this if you only use one Usage to an FPM component within your application. This forces you to delete the old FPM component before creating a new one. + You can't pass any configuration key for the IDR (header area). Therefore the header is displayed without any configuration settings. This means you have to fill all header settings programmatically at runtime. * You can't use application parameters for the FPM as the application is now unknown to FPM, 5.8 Detailed FPM Message Manager Documentation ‘The FPM Message Manager is an integral part of FPM and is available to all applications that use the standard floorplans such as OIF, GAF etc. The FPM message management consists of the following parts, ~ Message Area ~ Message Manager Interface 5.8.1 Message Area The floorplans like GAF and OIF have the message included as a standard Ul element and hence itis available to all the applications based on the floorplans provided by FPM. 5.8.2. Message Manager Interface ‘The Message Manager Interface is available to all applications to report messages into FPM. This interface offers methods to perform the following tasks: + Report messages Raise Exceptions + Clear messages 5.8.3 API Method Documentation 5.8.3.1 Public Methods REPORT_MESSAGE REPORT_T100_MESSAGE REPORT_BAPIRET2_ MESSAGE RAISE_EXCEPTION RAISE_T100_EXCEPTION CLEAR_MESSAGES 3.2. Description of the Parameters: FPM Cookbook §.8.3.2.1 The Report_XX methods Parameter Relevant methods Description 10_COMPONENT All Pass an object reference to the message manager. This object will be used as the key to store the message. Preferably the WD component which is raising the message should be passed here. But only in the event of exceptions where the object raising the message does not have a handle to the wd component (like for instance an ABAP OO class) you can pass any other object reference. This is important for those messages whose lifetime is maintained manually by the applications (see lifetime for more details). When you create a message whose lifetime is marked as manual the application creating such a message has then to take care to delete the message once it is no longer needed. In that case you will need to pass the ‘component whose messages have to be cleared. This helps to prevent messages from a different component being cleared by a component that has not raised them, which can be the case when you are re-using components from different areas IV_SEVERITY All The severity of the message to be reported. There are three values 1. Error (E) 2. Warning (W) 3. Success (|) (same as information) ‘The effect of the severity of messages on the navigation within the floorplan can vary with the floorplan, for instance the navigation can be different if there is an error message in GAF or OIF. The three values that can passed are 4. GC_SEVERITY_ERROR for Error 2. GC_SEVERITY WARNING for Waming 3. _GC_SEVERITY_SUCCESS for success This is an optional parameter and the default is Error. IV_UIFETIME All This is a very important parameter and should be given special attention. This parameter determines when, where and how long a message is displayed for. This parameter is a combination of the following two dimensions 1. Lifetime 2. Visibility Lifetime ~ This determines how long the message will exist in the message area, i.e. the creation and deletion of the message. The possible lifetimes are ‘automatic’ meaning that FPM will handle the destruction of the message as defined by the Ul guidelines for the floorplan and ‘manual’ meaning that the application developer has to handle the deletion or clearing of the message from the message area. Visibility — This will determine when the message will be shown on the message area. This can take the following FPM Cookbook values: ‘Automatic’ meaning FPM wil take care of the visibility based on the guidelines, ‘view meaning that the message will be visible as long as the view to which the message is bound is available, ‘controller meaning that the message will be visible as long as the controller that has raised the message is available (see the parameter controller for details), ‘application’ meaning the message will be permanent (until deleted manually by the application developer) and will be visible until the application is alive. The last visibility is ‘pop-up’ which means that the message will be visible only in a pop-up. Not all combinations of lfetime and visibility are possible and for obvious reasons some combinations like Lifetime = Manual = visibiity = pop-up are not available. The possible combinations ate as follows, described with the constant to be used, where the lifetime is described first and visibility next 4. GC_LIFE_VISIBILITY_AUTOMATIC, Automatic + Automatic (Fully handled by FPM) 2. GC_LIFE_VISIBILITY_AUT_POPUP - ‘Automatic + Pop-up (Creation and destruction handled by FPM, visible as long as a pop-up is visible) 3. GC_LIFE_VISIBILITY_MANU_VIEW - Manual + View (Should be deleted by the application visible until the view that created itis visible) 4, GC_LIFE_VISIBILITY_MANU_CONT - Manual + controller (Should be deleted by the application visible until the controller that created itis visible) 5. GC_LIFE_ VISIBILITY MANU_APPL - Manual + Application (Should be deleted by the application visible as long as the application is alive) IV_PARAMETERS, All Bunch of parameters of the type WDR_NAME_VALUE_LIST that can be stored along with the message. This will be passed to the WD. message manager as is and will have to visualize change in the message behavior. Refer to the WD message manager documentation for further details R_MESSAGE_USER_DATA ALL ‘Some additional data that can be stored along with the message. This does not visually influence the message. This can be used by the application developers to provide some error resolution mechanism. See the WD. help for further details. IV_MESSAGE_INDEX ALL Numerical value on the order in which this message has to be displayed. If no value is passed (as this is an optional parameter) then the messages will be displayed inthe order in which the WD runtime chooses to display them. The messages are sorted according to the following attributes: 1. Error severity 2. Message index (parameter MSG_INDEX) FPM Cookbook 3. Context element (iit exists) 4, Context attribute (i it exists) 1O_ELEMENT ALL Reference to a context element to which the message should be bound. The effect is that the message will then be clickable and that the focus will shift to a UI element bound to this context element. IV_ATTRIBUTE_NAME ALL The element attribute to which the message has to be mapped. This should be used in conjunction with the 1O_ELEMENT. IV_IS_VALIDATION INDEPENDENT ALL With this parameter, you can define whether a message referring to a context attribute or a context element has an influence on the execution of a standard action. If the parameter has the value ABAP_FALSE (default value), the standard action is no longer executed after this message is created. However, if the parameter has the value ABAP_TRUE, the standard action is executed, IO_CONTROLLER ALL Pass the reference to the controller whose lifetime will dictate the lifetime of the messages which have the lifetime set to context. IS_NAVIGATION_ALLOWE D ALL Relevant only if the Floorplan is GAF. Use this flag it navigation has to be allowed even on an é’ message in the GAF. Iv_vIEW ALL Relevant only in case the message manager is used in application specific pop-ups. Provide the name of the view of the pop-up. The error will then be only restricted to the pop-up. Otherwise there is a side effect in that the error message (in case of a non-automatic type) will also bee reported on the main page when the pop-up is closed. IV_MESSAGE_TEXT REPORT MESSAGE Any free text that should be reported in the message area. When used with the Element and attribute parameters becomes a clickable free text message. IS_BAPIRET2 REPORT_BAPIRET2 MESSAGE Pass the BAPIRET2 structure directly into the message. The severity of the message is automatically selected from the BAPIRET2 structure. The T100 message that is ‘embedded into the BAPIRET2 structure will be used to display the message text. The lifetime, visibility, context mapping can be set additionally along with the BAPIRET2 structure. Note: If the BAPIRET2 structure contains as severity ‘A’ the message is converted into an exception. IV_MsGID REPORT _T100 MESSAGE This parameter should be used while reporting a T100 based message. This parameter should be supplied with the message class. IV_MSGNO REPORT_T100 Pass the message number of the message class IV_PARAMETER 3, IV_PARAMETER 4 MESSAGE, specified by the IV MSGID. IV_PARAMETER 1 REPORT _T100 ‘Optional parameters for the message IV_PARAMETER 2, MESSAGE, FPM Cookbook 5.8.3.2.2 The Raise_XX_Exception methods Parameter Relevant methods Description IV_TEXT RAISE_EXCEPTION Optional text that can be passed while raising a simple exception. This text will be logged and can later be used for analysis Iv_MsciD RAISE_T100_EXCEPTION Message class ID for the T100 message. Use this parameter to Raise an exception whose text is based on the T100 message mechanism. IV_MSGNO RAISE_T100_EXCEPTION Message number of the T100 message class IV_PARAMETER 1 | RAISE_T100_EXCEPTION Optional message parameters Iv_PARAMETER 2 iv_PARAMETER_3 iV PARAMETER 4 IOEXCEPTION | RAISE_CX_ROOT_EXCEPTION | Raise an exception from using an exception class inherited from CX_ROOT. This parameter is a mandatory parameter. IV_ADDITIONAL_T | RAISE_CX_ROOT_EXCEPTION | Any additional text to be added while reporting an EXT exception based on CX ROOT IS_BAPIRET2 RAISE_BAPIRET2_EXCEPTION | The BAPIRET2 structure for raising an exception. §.8.3.2.3 The Clear method Parameter Relevant methods Description 10_COMPONENT CLEAR_MESSAGES | The component in which messages were previously reported. Only those messages that were reported from this component will be cleared. If this contains object references other than components, then those object references will be used. This is a mandatory parameter. IV_EXCLUDE ERROR | CLEAR MESSAGES | Pass true if error messages belonging to the component are not to be deleted. This is an optional parameter and the default is false. This means that all the error messages belonging to this component will be deleted unless this parameter contains a true value. Looking at the name the parameter indicates that the default value (false) has to be overridden only if error messages are to be saved from being cleared and this parameter contains negative semantic with respect to the method name. IV_EXCLUDE_WARNING | CLEAR_MESSAGES | Default is false, override with true if warnings raised for the component are to be saved. IV_EXCLUDE_SUCCESS | CLEAR_MESSAGES | Default is false, override with true if success messages raised for the component are to be saved. 5.8.3.3 Notes The following should be noted for the Report_XX methods: FPM Cookbook Message severity -if not specified - is defaulted to Error, Lifetime and visibility -if not specified - is defaulted to Automatic and Automatic. By default the message is not mapped to a context element. The component that is raising the message is mandatory to report a message. It there are minor inconsistencies while reporting the message FPM will automatically take some alternative actions unless an exception is raised The following are the alternative actions that FMP will take 1. If the message is reported to be bound to a context element and if the element or the attribute is missing then FPM will report the message but without the binding, The following are the cases when FPM will raise an exception 4. If the message lifetime is marked to be bound to a controller and the controller is null or not reachable 2. If the component for the message is missing 3. If the message lifetime is marked to Manual + view and if the element or attribute is missing For specific methods the following should be noted. REPORT_MESSAGE — The message text is mandatory REPORT_T100_MESSAGE - The message class and number are mandatory REPORT_BAPIRET2_MESSAGE - The BAPIRET2 structure is mandatory. If the severity of the message as specified in the BAPIRET2 structure is A then the message is converted into an exception. The following should be noted for Raise_XX_exception methods 1. Allthe exceptions are logged in the system with details of the method that was used to raise the exception, the text of the exception any additional text if used. 2. As of SP13 there is no recovery mechanism from the exceptions The following should be noted about the clear_messages method. 1. The method clears messages from the message area and this method acts upon all those methods that have the lifetime defined as Manual 2. This is the only method to selectively clear the messages with lifetime equaling manual from the message area 3. This method ensures that those messages from a different component are not cleared accidentally 4. The defauits for the parameters contain a negative semantic with respect to the method name and if the method is called with defauits then all the messages are deleted. .8.4 Additional Functionality Offered by FPM Message Manager 1. FPM Message Manager has a connection to the ABAP log. To activate this feature, go to transaction SAAB and activate the check point group FPM_RUNTIME_MESSAGES for your user or for all users in the server. 2. You can tum on a log history of the messages for a particular application. When the message log is turned on all the previously reported messages can be seen at a glance (see the FPM requirement for details). This can be done by defining an application parameter FPM_SHOW_MESSAGE_LOG and setting it to true, i.e. FPM_SHOW MESSAGE LOG = X. This can also be sot via the configuration (see details below) 3. Tho message area can be restricted to show a fixed maximum number of messages. This is can be set either via customizing or via the URL parameter FPM_MAXIMUM_MESSAGE_SIZE which takes an integer (see below for configuration) Maximum message size: The parameter for the maximum messages can be configured in the global parameter settings. Open the component configuration for the target application FPM Cookbook ‘The parameter for the maximum message size contains a input field neu FPM Cookbook eee Enter a numerical value such as § in the field ES EEE RRR TET Save the configuraiton settings and exit. ‘When a message is created in the application then the message area will show up with a message area size that can accommodate 5 messages (the size that was set via the configuration). Once the visible number of messages in the message area exceed the configured message size a scroll bar will appear in the message area. Inthe FPM_MESSAGE_MANAGER_TEST (standard message area test application) the following are the results when the message size is set to 3. For the first message: hye ot FPM Cookbook For the third message: heen FPM Cookbook ran = semoee cen] Somer tteneeteeretenet ‘Open the component configuration via the new configuration ecitor. Navigate to the global setting (please refer to the screen shots above). In the global settings you can see the checkbox for tuning on the message log, hy oue FPM Cookbook Save the changes and exit. ‘The messages will be displayed in the ALV format in the message area as follows. Note that the log does not appear until there is at least one message in the message manager. No message - No log So Log when the message is reported in the message manager. By default the log is opened but the link indicates that the log is present in the message area. hye ont FPM Cookbook al 1 enmcennevrenscm sneer, Pi ws tees ee Reventon propa men = Be Er ree 4 Click on the link "Display Message Log” to open the log display. Note: The message log can also be tuned on using the URL parameter FPM_SHOW_MESSAGE_LOG: I the message log is turned on via the setting, it cannot be tumed off via the URL parameter. 5. 5 FAQ on the Message Manager Can | use the WD message along with the FPM message manager > Yes. You can. But you will need to create and maintain your own reference of the WD message manager. Messages that are reported directly into the message manager will not be maintained by FPM after they are reported and the application has to handle the message independent of the FPM lifetime and visibility functionality. Exceptions logged directly to the WD message manager will not be logged under the FPM_RUNTIME_MESSAGES checkpoint group hye oe FPM Cookbook 2. I want to use the FPM floorplan but | do not want to use the FPM message area, can | do so? > Yes, you can use the WD message area only, but functionality from the FPM message manager like automatic lifetime handling, consolidated popup display ete will not be available. 3. Should | create a message area to use the FPM message manager > No. If you are using a standard floorplan like OIF or GAF the message area comes built in with the floorplan 4, Can I change the position of the message area? > No. You cannot change the location of the message area. If you create an additional message area, then the messages might be repeated in both message area views. 5. I reported a message mapped to a context, but | see only the text and the message is not navigable. What is happening? > The element and the attribute might not contain proper references. In such a case, FPM will stil display the message but it will not be navigable. 6. When I raise an exception | get a dump on the screen and in the stack | see the IF_FPM_MESSAGE_MANAGER as the point where the dump is caused, PAs of SP13 of NW 7.00 and SPO3 of NW/7.10 there is very basic support for exception handling for FPM applications. Features like recovery mechanisms from exceptions, special exception screens etc will not be available. All Raise_XX_exception methods in FPM will log any exception raised from it and then force a dump. That way the applications will terminate. 5.9 ‘There are currently two different options to have a link in the IDR header of your FPM application that points to the Configuration Editor: 1. In transaction SUS set the user parameter FPM_CONFIG_EXPERT to X. Then you get the link "Change Configuration” in the IDR header that starts the FPM Configuration Editor via WebDynpro application "configure_component”. This corresponds to a change of the explicit and implicit configuration in the so- called "Developer Mode" ink to Configuration Editor in FPM Application Flight Overview (Hein Sano canmation [see] 2. Start your FPM application with URL parameter sap-config-mode=X. Then you get the link "Adapt Configuration” in the IDR header that starts the FPM Configuration Editor via WebDynpro application "customize component”. This corresponds to a customizing of the explicit and implicit configuration in the so-called "Administrator Mode". In the “Administrator Mode” you may adapt all elements of the configuration that have not been marked before as final elements in the “Developer Mode" Flight Overview thle icra FPM Cookbook 5.10 Detailed Description of Feeder Classes 5.10.1 Detailed Description of Interface IF_FPM_GUIBB_FORM The methods you see in bold need to be implemented. The other methods can have an empty implementation if the application does not need them. But you must have at least an empty implementation otherwise it will dump. 4. GET_DEFINITION With this method the feeder provides all necessary information for configuring a form: the list of available fields with its properties and the list of actions (=FPM Events) the feeder class can handle, + EO_FIELD_CATALOG: Is of type CL_ABAP_STRUCTDESOR. The components of this object are the available fields. The simplest way to provide a field catalog is to create a flat DDIC- structure containing all ficids and then get the field catalog via eo_field catalog ?= CL_ABAP_STRUCTDESCR=>describe_by_nat The form GUIBB supports only flat structures. When using deep structures only the highest level fields are available! + ET_FIELD_DESCRIPTION: here you can provide the additional information needed to create the form, e.g. Label_by_DDIC, LABEL_REF, ‘+ ET_ACTION_DEFINITION: alist of all actions (which will be transformed to FPM Events at runtime) you can assign to form elements + ET_SPECIAL_GROUPS: You have here the same options you have in the ABAP ALV (see function module REUSE_ALV_GRID_DISPLAY) to group the fields within your field catalogue. The special group for each field has to entered in the field descripition table in field SP_GROUP. At design-time the FPM Configuration Eitor then groups the fields. If your field catalogue contains many fields, this makes it easier to find them. 2. IF_FPM_GUIBB~GET_PARAMETER_LIST This method is called at design time and provides the possibilty to define a list of the parameters that the feeder class supports. This list is used by the FPM Configuration Ecitor to provide the input fields for these parameters. + RT_PARAMETER_DESCR is returned from this method. It describes which parameter are possible. Within Field "TYPE" the DDIC type needs to be filled in, 3. IF_FPM_GUIBB~INITIALIZE This method is called at runtime when the form is created, Itis the first feeder method which is called from FPM. + IT_PARAMETER contains a list of the feeder parameters and the values for them specified in the configuration. 4, FLUSH This is the first feeder method which is called during an event loop. Whenever an FPM event is triggered (this inoludes all roundtrips caused by the form itself) this method is called. It is mainly used to forward the changed form data to other components within the same application, + IT_CHANGE LOG lists all changes done by the user ‘+ IS_DATA structure containing the changed data 5. PROCESS EVENT This is called within the FPM event loop and forwards the FPM PROCESS_EVENT to the feeder class. Here the event processing can take place and this is where the event can be canceled or deferred, ‘+ 10_EVENT: the FPM event which is to be processed. FPM Cookbook + EV_RESULT: the result of the event procesising. There are 3 possible values: © ev_result = i_fpm_constants=>ge_event_result-OK. 2 ev_result = i_fpm_constants=>ge_event_result-FAILED. © ev_result = if_fpm_constants=>ge_event_result-DEFER, ‘+ ET_MESSAGES: a list of messages which shall be outputted in the message area 6. GET_DATA This is called within the FPM event loop and forwards the FPM PROCESS_B8EFORE_OUTPUT ‘event to the feeder class. Here you have to specify the form data after the event has been. processed, + 10_EVENT: the FPM event which is to be processed. + IT_SELECTED_FIELDS: the list of fields necessary for the form rendering. You only need to provide the data for the fields listed in this table as all other fields are neither visible at runtime nor used as reference for visible fields. + ET_MESSAGES: a list of messages which shall be outputted in the message area. + EV_DATA_CHANGED: For performance reasons the GUIBB adjusts the data in the form only if the data has changed. To indicate this you have to set this flag whenever you changed the data to be displayed within this feeder. + EV_FIELD_USAGE_CHANGED: Indicates whether or not the field usage has been changed by this method. If you change the field usage without setting this flag to ‘X" your changes will be ignored + EV_ACTION_USAGE_CHANGED: Indicates whether or not the action usage has been changed. You have to use an °X'to indicate whether you changed something. If you do not, your changes will be ignored. ‘* CS_DATA: The form data to be changed + CT_FIELD_USAGE: Field usage to change. The field usage consists of the field attributes which might change at runtime (enabled, visible, ..), In case you change the fixed values of a field you have to set the flag FIXED_VALUES_CHANGED for this field. + CT_ACTION_USAGE: Action usage to change. The action usage consists of the attributes related to actions which might change at runtime (e.g. visibility: if an action is rendered as a button, then the visibility setting of the button will be defined here) 7. GET_DEFAULT_CONFIG: This method can be implemented if you want to have a default configuration. This avoids that users who use this feeder class to create a form have to start from scratch. Instead there is already a ready-to-run configuration available when they start the FPM Configuration Editor. ‘+ IO_LAYOUT_CONFIG of type IF_FPM_GUIBB_FORM_CONFIG: This object provides the API to Greate a default configuration. 8. CHECK_CONFIG This method can be implemented if you want to make own application-specific checks of the configuration in the FPM Configuration Ecitor right before saving = IO_LAYOUT_CONFIG of type IF_FPM_GUIBB_FORM_CONFIG: This object provides the API to read the the configuration to bé saved. = ET_MESSAGES: a list of messages which shall be outputted in the message area. FPM Cookbook 5.10.2 Detailed Description of Interface IF_FPM_GUIBB_LIST This chapter will be provided soon.

You might also like