ISH Imp AdminGuidesmartUI V1-1 en

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Administrator's Guide CUSTOMER

i.s.h.med Clinical System


Document Version: 1.1

Using Custom Clinical Order Components in


Smart UI
Guide for Creating Web Dynpro Components
Typographic Conventions

Font Description

Example Words or characters quoted from the screen. These include field names, screen titles,
pushbutton labels, menu names, menu paths and menu options.
Textual cross-references to other documents.

Example Emphasized words or expressions.

Example Technical names of system objects. These include report names, program names,
transaction codes, table names and key concepts of a programming language when they are
surrounded by body text, for example, SELECT and INCLUDE.

Example Output on the screen. This includes file and directory names and their paths, messages,
names of variables, parameters, source code as well as names of installation, upgrade and
database tools.

Example Exact user input. These are words or characters that you enter in the system exactly as they
appear in the documentation.

<Example> Variable user input. Angle brackets indicate that you replace these words and characters
with appropriate entries to make entries in the system.

Example Keys on the keyboard, for example F 2 or E N T E R .

2 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
Document History

Version Date Change

1.0 01.04.2013 Released Version

1.1 09.08.2013 Enhancements in Chapter 2.4.2:


Service ordering API
Loading of header components and item components
Processing of user input

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 3
Contents

1 Introduction.............................................................................................................................................. 5
1.1 Use ............................................................................................................................................................................ 5
1.2 Prerequisites ............................................................................................................................................................ 5
1.3 Methodology ............................................................................................................................................................ 5
1.4 Structure .................................................................................................................................................................. 6

2 Adding Custom Clinical Order Components to Smart UI ...................................................................... 7


2.1 Preparations............................................................................................................................................................. 7
2.1.1 Creating a Web Dynpro Component ..................................................................................................... 7
2.1.2 Creating a UIBB Controller Class........................................................................................................... 8
2.1.3 Implementing UIBB-Specific Methods................................................................................................ 10
2.2 Enhancing the Web Dynpro Component ............................................................................................................. 13
2.2.1 Adding CONTEXT Nodes to COMPONENTCONTROLLER ................................................................ 13
2.2.2 Configuring the View Layout ................................................................................................................ 15
2.2.3 Implementing View Methods ............................................................................................................... 17
2.3 Enhancements in Transaction N1COT................................................................................................................. 19
2.3.1 Layout Configuration for Order Types ................................................................................................ 19
2.3.2 Field Attribute Configuration for Web Dynpro Components.............................................................20
2.4 Completing the Web Dynpro Component, the UIBB Controller Class and the Clinical Order
Component ............................................................................................................................................................ 22
2.4.1 Adding Configuration Controller to the Web Dynpro Component ................................................... 22
2.4.2 Completing the UIBB Controller Class ................................................................................................ 23
2.4.3 Implementing Interface to the Web Dynpro Component in the Clinical Order
Component ............................................................................................................................................29

4 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
1 Introduction

1.1 Use

The purpose of this administrator's guide is to provide the information needed to add custom clinical order
components to service ordering in Smart UI. It demonstrates the basic steps when creating the required additions
for the clinical order components to be used in the Web Dynpro landscape. At the end of this tutorial you will be
able to add custom clinical order components to service ordering in Smart UI. You will also be familiar with most
of the classes and methods required for this purpose.
Service ordering in Smart UI uses the classical clinical order backbone (classes, function groups, tables) and adds
Web Dynpro technology to it.

1.2 Prerequisites

You are using i.s.h.med as of ERP 6.0 EHP6/10 and want to use your existing custom clinical order components
for the clinical order also in Smart UI.
To understand the various steps, you should have technical background knowledge in the following areas:
ABAP Workbench
Object-oriented ABAP programming
Web Dynpro Framework
The administrator's guide focuses on the specifics of the i.s.h.med implementation and does not explain the above
aspects in detail.
Your existing custom clinical order components form the basis for the steps described hereafter. This means that
these custom clinical order components must be created and you need to be familiar with them so as to embed
the components in service ordering in Smart UI as described in this document. If you only want to use the custom
clinical order components in service ordering in Smart UI, you do not require the corresponding display classes.
You can use, among other things, the Web Dynpro components from the standard i.s.h.med system as a
reference.

Note
Header components and item components basically behave in the same way in the clinical order and in
service ordering. However, the system synchronizes the fields of header components in service ordering,
as standard, if you specify this in the component configuration.

1.3 Methodology
This administrator's guide describes step-for-step the approach with the ABAP Workbench. Create the example
component ZN1CORD_COMP_TUTORIAL as the example to be used throughout. The guide uses the i.s.h.med Web

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 5
Dynpro component N1CORD_COMP_COMMENT and the related UIBB controller class
CL_ISHMED_CORD_UC_COMMENT as a reference.

1.4 Structure
First, Chapter 2.1 describes how you create the objects required for a custom Web Dynpro component for service
ordering in Smart UI. Chapter 2.2 describes how to add interface functionality to the component and how to
configure a single view. Next, Chapter 2.3 covers the capabilities of the cross-UICC layout configuration and the
configuration options for individual fields offered by transaction N1COT. Chapter 2.4 describes the final integration
between clinical order component and the Web Dynpro environment through changes to the clinical order
component itself.

6 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
2 Adding Custom Clinical Order Components
to Smart UI

2.1 Preparations

This chapter describes how to create the objects required for a custom clinical order component in the Smart UI
landscape. The following steps are required for this:
Create a Web Dynpro component
Create a UIBB controller class for the Web Dynpro component
Implement the specific methods for Web Dynpro UIBBs
You create the basic Web Dynpro component ZN1CORD_COMP_TUTORIAL and the related UIBB controller class
ZCL_ISHMED_CORD_UC_TUTORIAL for the example.

2.1.1 Creating a Web Dynpro Component

To create a Web Dynpro component, proceed as follows:


1. In the ABAP Workbench, choose the Web-Dynpro-Comp./Intf. entry from the selection list in the
Repository Browser.
Enter the name for the new component according to the following convention:
<ClientNameSpace_CompName>. As an example, we will use ZN1CORD_COMP_TUTORIAL for a Web
Dynpro component for the clinical order component.
Choose E n t e r to confirm your input.
2. When creating the component, enter the following information in the Web Dynpro: Component / Create
Interface dialog box:
o Name: Change the name of the component, if required.
o Description: We recommend that you enter a description.
o Type: Select the Web Dynpro Component radio button.
o Window Name: Enter W_MAIN.
o View Name: Enter V_MAIN.

Note
The specifications for Window Name and View Name respect the naming convention for service ordering
in Smart UI Web Dynpro. If you want to use other names, make sure that you use the correct names when
referring to the window and the view.
3. Confirm your input by clicking E n t e r or Confirm and save the Web Dynpro component you have created.

To be able to use the Web Dynpro component in Smart UI, you need to implement the interface
IF_FPM_UI_BUILDING_BLOCK. To do this, perform the following steps:

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 7
1. Navigate to the Implemented Interfaces tab in your component and add the interface
IF_FPM_UI_BUILDING_BLOCK to the list:

Implemented Interfaces tab in the Web Dynpro Explorer

2. Press E n t e r and click the Reimplement pushbutton that appears in the Action column.
3. Choose Save. By adding this interface, you add the methods listed below to the COMPONENTCONTROLLER.
These are used later on to enable the component to take part in the event loop and in the phases of the
Floorplan Manager (FPM):
o AFTER_FAILED_EVENT
o FLUSH
o NEEDS_CONFIRMATION
o PROCESS_BEFORE_EVENT
o PROCESS_EVENT
4. Activate the component.

2.1.2 Creating a UIBB Controller Class

In the following section, you create a UIBB controller class for the Web Dynpro component. You use this class to
map the Web Dynpro functionality and logic and to enable integration into the architecture of service ordering in
Smart UI Web Dynpro. To do this, perform the following steps:
1. Call transaction SE80 and choose Classes/Interfaces in the selection list in the Repository Browser.
The naming convention for the delivered classes of service ordering in Smart UI Web Dynpro is:
CL_<ProjectName>_CORD_UC_<ComponentName>.
The class name has the following format:
o CL stands for class.
o CORD stands for clinical order.
o UC stands for UIBB (User Interface Building Block) Controller.
The name of the example class used in the customer namespace is ZCL_ISHMED_CORD_UC_TUTORIAL.
2. Choose the following class in the Superclass input field: CL_ISHMED_CORD_UC_COMPONENT.

8 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
3. Choose Save and redefine the following methods of the superclass without implementing them:
o _LOAD_CORD_COMPONENT
o _REFRESH_DISPLAY
Also create the new method SUPPLY_DATA. On the Attributes tab, choose Public visibility and the Instance
method. On the Parameters tab, define the signature in the Create Method dialog box, as illustrated in the
screenshot below:

Creating the SUPPLY_DATA method

Chapter 2.4.2 describes how to implement this method.


4. Choose Activate and return to the Web Dynpro component.
5. Add a reference to the UIBB controller class, which encapsulates the functionality and logic of the Web
Dynpro component, to the COMPONENTCONTROLLER of the Web Dynpro component. To do this, double-
click the COMPONENTCONTROLLER in the tree view of the component.
6. Save and activate your entries.
7. Navigate to the Attributes tab and add a new attribute. Enter the following information:
o Attribute: We recommend the naming convention GR_UIBBCTRL. You can use any other name. In this
case, you need to adjust the name wherever it is used in this document.
o Select the checkboxes in the Public and RefTo columns.
o Enter the name of the created UIBB controller class in the Associated Type column. Use
ZCL_ISHMED_CORD_UC_TUTORIAL for the example.

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 9
2.1.3 Implementing UIBB-Specific Methods

This chapter describes the implementation of the methods in the COMPONENTCONTROLLER of the Web Dynpro
component. The example implementation is based on the component N1CORD_COMP_COMMENT.
You can copy the source code examples from this chapter into your implementation.
Alternatively, you can display the Web Dynpro component N1CORD_COMP_COMMENT and copy the methods from
there.

Note
Note the following when copying the implementation from the component N1CORD_COMP_COMMENT:
In the method WDDOINIT, adjust the class name i_clsname in accordance with the UIBB controller
class used.
If you have changed it, also adjust the name GR_UIBBCTRL for the reference to the UIBB controller
class.
Double-click COMPONENTCONTROLLER in the tree view of the example component
ZN1CORD_COMP_TUTORIAL and navigate to the Methods tab.
Double-click the respective method name to access the method implementation.
Perform the following steps to implement the interface to the Floorplan Manager and the transfer to the UIBB
controller class:

1. Implement the method AFTER_FAILED_EVENT as follows:

METHOD after_failed_event .

cl_ishmed_fpm_manager=>uibb_after_failed_event(
ir_uibbctrl = wd_this->gr_uibbctrl
io_event = io_event
it_interface_views = it_interface_views
iv_revert = iv_revert ).

ENDMETHOD.

2. Implement the method FLUSH as follows:

METHOD flush .

cl_ishmed_fpm_manager=>uibb_flush(
ir_uibbctrl = wd_this->gr_uibbctrl
it_interface_views = it_interface_views ).

ENDMETHOD.

10 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
3. Implement the method NEEDS_CONFIRMATION as follows:

METHOD needs_confirmation .

CALL METHOD cl_ishmed_fpm_manager=>uibb_needs_confirmation


EXPORTING
ir_uibbctrl = wd_this->gr_uibbctrl
io_event = io_event
it_interface_views = it_interface_views
IMPORTING
eo_confirmation_request = eo_confirmation_request.

ENDMETHOD.

4. Implement the method PROCESS_BEFORE_OUTPUT as follows:

METHOD process_before_output .

cl_ishmed_fpm_manager=>uibb_process_before_output(
ir_uibbctrl = wd_this->gr_uibbctrl
io_event = io_event
it_interface_views = it_interface_views ).

ENDMETHOD.

5. Implement the method PROCESS_EVENT as follows:

METHOD process_event .

CALL METHOD cl_ishmed_fpm_manager=>uibb_process_event


EXPORTING
ir_uibbctrl = wd_this->gr_uibbctrl
io_event = io_event
it_interface_views = it_interface_views
IMPORTING
ev_result = ev_result.

ENDMETHOD.

6. Implement the method WDDOAPPLICATIONSTATECHANGE as follows:

METHOD WDDOAPPLICATIONSTATECHANGE .
CHECK wd_this->gr_uibbctrl IS BOUND.

wd_this->gr_uibbctrl->WDDOAPPLICATIONSTATECHANGE(state_change = state_change).
ENDMETHOD.

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 11
7. Implement the method WDDOBEFORENAVIGATION as follows:

METHOD wddobeforenavigation .

CHECK wd_this->gr_uibbctrl IS BOUND.

wd_this->gr_uibbctrl-
>wddobeforenavigation( is_current_root = is_current_root ).

ENDMETHOD.

8. Implement the method WDDOEXIT as follows:

METHOD wddoexit .

CALL METHOD cl_ishmed_fpm_manager=>uibb_wddoexit


EXPORTING
i_reason = reason
CHANGING
cr_uibbctrl = wd_this->gr_uibbctrl.

ENDMETHOD.

9. Implement the method WDDOINIT as follows to initialize the reference to the UIBB controller class:

METHOD wddoinit .

CALL METHOD cl_ishmed_fpm_manager=>uibb_wddoinit


EXPORTING
ir_component = wd_this->wd_get_api( )
i_clsname = 'ZCL_ISHMED_CORD_UC_TUTORIAL'
IMPORTING
er_uibbctrl = wd_this->gr_uibbctrl.

ENDMETHOD.

Note
If you use a name other than that suggested for the UIBB controller class, adjust the value of the
parameter i_clsname.

12 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
10. Implement the method WDDOPOSTPROCESSING as follows:

METHOD wddopostprocessing .

CHECK wd_this->gr_uibbctrl IS BOUND.

wd_this->gr_uibbctrl->wddopostprocessing( is_current_root = is_current_root ).

ENDMETHOD.

11. Save and activate your entries.

2.2 Enhancing the Web Dynpro Component

This chapter describes the enhancement of the Web Dynpro component through the following steps:
Add a CONTEXT node to the COMPONENTCONTROLLER
Modify the layout of the view V_MAIN
Implement the methods of the view V_MAIN

2.2.1 Adding CONTEXT Nodes to COMPONENTCONTROLLER

This chapter describes how to create the nodes and attributes in the CONTEXT of the COMPONENTCONTROLLER.
The DATA node contains all relevant data for the clinical order component. The system needs the SCRM_DATA
node for the screen display of the order type, based on the layout configuration. For more information, see
Chapter 2.3.
The SCRM_DATA node is connected with the SCRM_CONFIG controller. How to create the SCRM_CONFIG controller
is described in Chapter 2.4.1.

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 13
Perform the following steps to complete the CONTEXT:
1. Define the attributes of the DATA node and of the SCRM_DATA node with the same names and types as
in the i.s.h.med component N1CORD_COMP_COMMENT:

Settings for the context of the COMPONENTCONTROLLER

You can choose any name for the DATA node. In this case, you need to adjust the name of the node to
your chosen name in the subsequent process. However, we recommend that you use SCRM_DATA as the
node name for layout data, as otherwise more extensive modifications are required.

Note
Define the nodes in the CONTEXT as interface nodes to be able to access them from outside the Web
Dynpro component.
2. To fill the CONTEXT node at initialization, create a SUPPLY_DATA method for the DATA node with call to
the UIBB controller class, as follows:

METHOD supply_data .

CHECK wd_this->gr_uibbctrl IS BOUND.

wd_this->gr_uibbctrl->supply_data(
node = node
parent_element = parent_element ).

ENDMETHOD.

14 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
2.2.2 Configuring the View Layout

Based on the creation and configuration of the COMPONENTCONTROLLER in the previous chapter, this chapter
describes how to set up the view V_MAIN. You are free to define the layout of the view provided that the element
properties below are connected as follows. Here you can again use the We Dynpro component
N1CORD_COMP_COMMENT from the standard i.s.h.med system as a reference.
For the example, select the input field COMMENT in the tree view of the ROOTUIELEMENTCONTAINER. Call the Define
Context Binding dialog box to connect properties of UI elements of the CONTEXT by clicking the pushbutton in the
Binding column of the row of the relevant property. For the example, define the connection to the element
COMMENT of the DATA node, as follows:
1. Call the Define Context Binding dialog box and bind the COMMENT attribute of the DATA node to the
property value of the input field in the view.

Bind attribute COMMENT of the DATA node to the property value

Confirm the dialog box by choosing Continue.

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 15
2. Call the Define Context Binding dialog box for the property enabled.
Choose the attribute COMMENT of the DATA node in the tree view of the CONTEXT and choose the radio
button Bind to the Property of the Selected Attribute.
Choose the property Enabled from the selection list Property and confirm your entries.

Bind attribute COMMENT of the DATA node to the property enabled

3. Call the Define Context Binding dialog box for the property readOnly.
Choose the attribute COMMENT of the DATA node in the tree view of the CONTEXT and choose the radio
button Bind to the Property of the Selected Attribute.
Choose the property Read Only from the selection list Property.
4. Call the Define Context Binding dialog box for the property state.
Choose the attribute COMMENT of the DATA node in the tree view of the CONTEXT and choose the radio
button Bind to the Property of the Selected Attribute.
Choose the property Required from the selection list Property.
5. Call the Define Context Binding dialog box for the property visible.
Choose the attribute COMMENT of the DATA node in the tree view of the CONTEXT and choose the radio
button Bind to the Property of the Selected Attribute.
Choose the property Visible from the selection list Property.

16 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
2.2.3Implementing View Methods

Subsequent to the creation of the view layout and the connection with the Web Dynpro component data, this
chapter describes the methods of the view. The implementation basically just wraps the calls to the UIBB
controller class. As in Chapter 2.1.3, the implementation is based on the component N1CORD_COMP_COMMMENT.
You can copy the source code examples from this chapter into your implementation.
Alternatively, you can copy the implementation from the Web Dynpro component N1CORD_COMP_COMMENT of the
standard i.s.h.med system.

Note
If necessary, adjust the name GR_UIBBCTRL for the reference to the UIBB controller class in your
implementation.
Double-click the V_MAIN view in the tree view of the example component ZN1CORD_COMP_TUTORIAL and
navigate to the Methods tab.
Call the implementation of the respective methods by double-clicking the relevant row.
1. Implement the method WDDOAFTERACTION as follows:

METHOD wddoafteraction .

CHECK wd_comp_controller->gr_uibbctrl IS BOUND.

wd_comp_controller->gr_uibbctrl->wddoafteraction( ir_view = wd_this-


>wd_get_api( ) ).

ENDMETHOD.

2. Implement the method WDDOBEFOREACTION as follows:

METHOD wddobeforeaction .

CHECK wd_comp_controller->gr_uibbctrl IS BOUND.

wd_comp_controller->gr_uibbctrl->wddobeforeaction( ir_view = wd_this-


>wd_get_api( ) ).

ENDMETHOD.

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 17
3. Implement the method WDDOEXIT as follows:

METHOD wddoexit .

CHECK wd_comp_controller->gr_uibbctrl IS BOUND.

wd_comp_controller->gr_uibbctrl->wddoexit_view( ir_view_controller = wd_this-


>wd_get_api( ) ).

ENDMETHOD.

4. Implement the method WDDOINIT as follows:

METHOD wddoinit .

CHECK wd_comp_controller->gr_uibbctrl IS BOUND.

wd_comp_controller->gr_uibbctrl->wddoinit_view( ir_view_controller = wd_this-


>wd_get_api( ) ).

ENDMETHOD.

5. Implement the method WDDOMODIFYVIEW as follows:

METHOD wddomodifyview .

CHECK wd_comp_controller->gr_uibbctrl IS BOUND.

wd_comp_controller->gr_uibbctrl->wddomodifyview(
first_time = first_time
view = view ).

ENDMETHOD.

6. Implement the method WDDOONCONTEXTMENU as follows:

METHOD wddocontextmenu .

CHECK wd_comp_controller->gr_uibbctrl IS BOUND.

menu = wd_comp_controller->gr_uibbctrl->wddooncontextmenu(
ir_view_controller = wd_this->wd_get_api( )
context_menu_event = context_menu_event
context_menu_manager = context_menu_manager ).

ENDMETHOD.

18 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
2.3 Enhancements in Transaction N1COT

This chapter describes how to add the following Smart UI configuration options to transaction N1COT:
Layout configuration for individual order types
Field attribute configuration for individual Web Dynpro components
If you want to use the Customizing activities for your Web Dynpro component, you need to add a custom
controller to your Web Dynpro component as described in Chapter 2.4.1.
You call the configuration of the order type for Smart UI from transaction N1COT by clicking the Configure Layout
pushbutton on the Structuring tab. The system displays a preview of the display of the order type in Smart UI in
the Configure Layout screen.

2.3.1 Layout Configuration for Order Types

Service ordering does not use the tab page design elements from the Structuring tab. Instead, you can use the
Floorplan Manager (FPM) to define a layout configuration that is valid for all Web Dynpro components. This
provides the following options for configuring the display of an order type in Smart UI:
Split Web Dynpro components into columns
Combine or stack Web Dynpro components in tabs
For example, you can combine the example comment field for displaying the order type in Smart UI on a tab with
further textual or administrative information.
You call the layout configuration in the Configure Layout screen by clicking the pushbutton with the quick info text
Personalize.
For information about personalizing an order type using a Floorplan, see the SAP Help Portal (help.sap.com)
under:
SAP NetWeaver SAP NetWeaver Platform SAP NetWeaver 7.0 Including Enhancement Package 3
Application Help English SAP NetWeaver by Key Capability Application Platform by Key Capability ABAP
Technology UI Technologies in ABAP Floorplan Manager Web Dynpro ABAP Floorplans Floorplan for
Overview Page (OVP) Personalizing Pages in an Overview Page Floorplan

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 19
2.3.2Field Attribute Configuration for Web Dynpro Components

Service ordering provides an overview of the order type's Web Dynpro components in the UIBB Settings dialog
box. You can select an existing configuration in the Config ID column or create or change a field attribute
configuration for the respective Web Dynpro component using the hotspot on Create/Edit Configuration. In the
Interface Views column, you can define the window and the associated view of the Web Dynpro component that
the system is to use for this order type.

Note
The system generally uses the term Interface View for the window assigned to a Web Dynpro component
in connection with the Floorplan Manager.

Config ID Setting for the UIBB

The Component Configuration screen for creating and editing a field attribute configuration enables you to define
the following attributes for each field, irrespective of status, via a selection list for each Web Dynpro component:
Optional: The system displays the field as active; the user is not required to make an entry.
Mandatory: The system displays the field as active; the user is required to make an entry and the system
displays a relevant error message.
Display: The system displays the field; however the field is not active.
Inactive: The system does not display the field.
The configuration for service ordering overwrites the status-dependent settings from Customizing for the clinical
order on the Screen Modification, subject to the following conditions:
Fields that are defined as mandatory in one of the settings are required entry fields.
Fields that are defined as mandatory in none of the settings and are defined as inactive in one setting are
configured as inactive.
Fields that are defined as mandatory or inactive in none of the settings are configured as display if you
have specified this in one of the settings.

20 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
The settings thus have the following priority:
Mandatory
Inactive
Display
Optional
For fields you define as "optional" in the field attribute configuration of service ordering, the status-dependent
settings from the Screen Modification apply without restriction.

Recommendation
Do not use the additional configuration option in the Web Dynpro Built-In group box on the Component
Configuration screen. The system does not interpret these settings. You can, however, hide optional fields
by means of this group box, making input impossible.
You call the UIBB Settings dialog box via the corresponding pushbutton on the Configure Layout screen.
For information about setting up order types, see the Implementation Guide under:

SAP Healthcare - Industry-Specific Component Clinical System Clinical Order Clinical Order Basic
Data Set Up Order Types for Clinical Order
SAP Healthcare - Industry-Specific Component Clinical System Smart UI Applications Service
Ordering General Information on Service Ordering

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 21
2.4 Completing the Web Dynpro Component, the UIBB Controller
Class and the Clinical Order Component

This chapter describes the final steps to complete the participating classes, as follows:
Add a configuration controller to the Web Dynpro component
Complete the UIBB controller class
Implement the Web Dynpro interface in the clinical order component

2.4.1 Adding Configuration Controller to the Web Dynpro


Component

To create a configuration controller for the Web Dynpro component, perform the following steps:
1. Select the custom controller for the Web Dynpro component. To do this, select the Web Dynpro
component and choose Edit Configuration Data. In the Configuration Editor field, select the
configuration controller N1CORD_CONF_COMPONENT.
2. To create a custom controller, choose Create Custom Controller in the context menu for the Web
Dynpro component in the tree view.
In the Controller input field, enter SCRM_CONFIG as the name of the controller.
In the Description input field, enter a description, such as Configuration controller.
3. Change the controller type to configuration controller by choosing Change to Configuration Controller in
the context menu for the controller in the tree view of the Web Dynpro component.
4. Create the CONTEXT node on the Context tab for SCRM_CONFIG, as illustrated in the screenshot below.
Use the CONTEXT of the standard component N1CORD_COMP_COMMENT as a reference to copy attributes
and types. To do this, choose the Create Using the Wizard Copy Nodes of Different Context function in
the context menu of the CONTEXT node. Enter N1CORD_CONF_COMPONENT in the Component Name field
and choose SCRM_CONFIG in the View/Controller Name field. Confirm your selection and choose the node
SCRM_DATA in the resulting dialog box. Confirm your selection.

Creating the CONTEXT node

5. Create a new controller usage for the COMPONENTCONTROLLER. To do this, choose the
COMPONENTCONTROLLER and choose Controller Usage. Select the SCRM_CONFIG controller for the Web
Dynpro component TUTORIAL.SCRM_CONFIG. Use drag&drop to map the node SCRM_DATA to the
context of the COMPONENTCONTROLLER of the Web Dynpro component.

22 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
6. Create the method SUPPLY_SCRM_DATA for the SCRM_DATA node that contains the definitive field
properties and layout configuration as described in Chapter 2.3.
The controller N1CORD_CONF_COMPONENT overwrites the configuration controller of the Web Dynpro component.
A separate COMPONENTCONTROLLER exists for the clinical order components Services and Surgery Team:
N1CORD_CONF_SERVICES
N1CORD_CONF_SURG_TEAM

2.4.2Completing the UIBB Controller Class

This chapter describes how to complete the UIBB controller class (in the example:
ZCL_ISHMED_CORD_UC_TUTORIAL), in the following steps:
Configure data transfer between the clinical order component and the Web Dynpro component
React to the events of the Floorplan Manager at Web Dynpro component level
Resource cleanup
You have the possibility to call the functions of the service ordering API. The API is implemented as a singleton
and you can access the API via the reference gr_instance. Amongst other things, you can determine the
services for an order using the method ordsrv_get as follows:

cl_ishmed_cord_appapi=>gr_instance->if_ishmed_cord_appapi~ordsrv_get( ir_cordpos =
lr_cordpos ).

The API also provides the following functions:


Determination of the list of all selected services
Determination of patient, case and initiator
Set status of an order item
For more information about the full functionality of the API, see the method description of the interface
if_ishmed_cord_appapi.
To establish data transfer between clinical order component and the new Web Dynpro architecture, you need a
reference to the class of the clinical order component (in the example: CL_ISHMED_COMP_COMMENT) in the UIBB
controller class.
We recommend the naming convention GR_COMP_<YourComponentName>. Add the reference as a private
attribute to the UIBB controller class ZCL_ISHMED_CORD_UC_TUTORIAL. Use the name
gr_comp_my_comp_name, for the example.
To load the order component, call the relevant methods of the order component via the reference
gr_comp_my_comp_name.

Note
You can find further examples of how to configure the data transfer in the components of the standard
i.s.h.med system, which inherit from CL_ISHMED_UC_COMPONENT and implement the method
SUPPLY_DATA.
Perform the following steps to implement the methods created in Chapter 2.1.2 and thus set up data transfer
between the clinical order component and the UIBB controller class:

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 23
1. Implement the method SUPPLY_DATA to determine the relevant information from the clinical order
component and then bind it to the CONTEXT of the Web Dynpro component. You can use the
implementation in the UIBB controller class CL_ISHMED_CORD_UC_COMMENT in the example:

METHOD supply_data.

DATA ls_data TYPE iwci_n1cord_comp_comment=>ele


ment_data.
DATA ls_n1corder TYPE n1corder.
DATA lr_element TYPE REF TO if_wd_context_element.
DATA l_rc TYPE ish_method_rc.
DATA lr_errorhandler TYPE REF TO cl_ishmed_errorhandlin
g.
DATA lx_root TYPE REF TO cx_root.

CHECK node IS BOUND.

DO 1 TIMES.
CHECK gr_corder IS BOUND.
CALL METHOD gr_corder->get_data
IMPORTING
es_n1corder = ls_n1corder
e_rc = l_rc
CHANGING
cr_errorhandler = lr_errorhandler.
IF l_rc <> 0.
_report_errorhandler_messages( ir_errorhandler = lr_errorhandler ).
EXIT.
ENDIF.
TRY.
ls_data-comment = cl_ishmed_cord_utl_webdynpro=>get_ltx_string(
ir_textmodule = gr_corder
i_text_id = cl_ish_corder=>co_text_rmcord
i_first_line = ls_n1corder-rmcord ).
CATCH cx_ish_static_handler INTO lx_root.
_report_exception( ir_exception = lx_root ).
ENDTRY.
ENDDO.

lr_element = node->bind_structure( ls_data ).

* _set_field_properties( ir_context_node = node ).

IF gr_handler_prop IS BOUND.
gr_handler_prop->set_properties( ir_context_node = node ).
ENDIF.

ENDMETHOD.

24 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
2. Implement the method _LOAD_CORD_COMPONENT to load the reference to the clinical order component in
the following steps:
1. Load the definition of the clinical order component
2. Check the correctness of the reference
For the parameter i_classid, use the class name of the clinical order component you want to make
available in Smart UI.
In the following source code example, you use the reference gr_corder as the reference to a header
component. If you work with an item component, instead use the reference gr_cordpos in the relevant
places.

Note
The implementation in the UIBB controller class CL_ISHMED_CORD_UC_COMMENT uses
gr_comp_comment as the name for the reference to the associated clinical order component.
Implement the method in the same way as the implementation in CL_ISHMED_CORD_UC_COMMENT, as
follows:

METHOD _load_cord_component.

DATA lr_compdef TYPE REF TO cl_ish_compdef.


DATA lr_cord_component TYPE REF TO if_ish_component.

IF gr_comp_my_comp_name IS NOT BOUND.


CHECK gr_corder IS BOUND.
CALL METHOD cl_ish_compdef=>get_compdef
EXPORTING
i_obtyp = cl_ish_cordtyp=>co_obtyp
i_classid = cl_ish_comp_comment=>co_classid
IMPORTING
er_compdef = lr_compdef.
CHECK lr_compdef IS BOUND.
CALL METHOD gr_corder->get_component
EXPORTING
ir_compdef = lr_compdef
IMPORTING
er_component = lr_cord_component.
TRY.
gr_comp_my_comp_name ?= lr_cord_component.
CATCH cx_sy_move_cast_error.
RETURN.
ENDTRY.
ENDIF.

rr_cord_component = gr_comp_my_comp_name.

ENDMETHOD.

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 25
3. Implement the method _REFRESH_DISPLAY to refresh the display. To do this, call the method
SUPPLY_DATA created in step 1:

METHOD _refresh_display.

DATA lr_data_node TYPE REF TO if_wd_context_node.

CHECK gr_context_root_node IS BOUND.

lr_data_node = gr_context_root_node->get_child_node( name = co_node_data ).

supply_data( node = lr_data_node ).

ENDMETHOD.

4. Redefine the method __PROCESS_CONTEXT_CHANGE_LOG in the UIBB controller class. This lets you
process user input in the following cases:
o Exit the Web Dynpro Component
o Save the orders
o Check the orders
You save the user input in the relevant tables by accessing the data object of the order component via the
reference gr_comp_my_component. This extract from the implementation of the class
CL_ISHMED_CORD_UC_CPOS describes the work with the context change log:

METHOD __process_context_change_log.

DATA ls_corder_x TYPE rn1_corder_x.


DATA ls_cordpos_x TYPE rn1med_prereg.
DATA ls_apcn_x TYPE rn1apcn_x.
DATA lr_app_constraint TYPE REF TO cl_ish_app_constraint.

FIELD-SYMBOLS <ls_log> LIKE LINE OF gt_context_change_log.


FIELD-SYMBOLS <l_orgfa> TYPE n1vkgfa.
FIELD-SYMBOLS <l_cordtitle> TYPE n1cordtitle.
FIELD-SYMBOLS <l_ordpri> TYPE n1apri_d.
FIELD-SYMBOLS <l_wdate> TYPE n1apcnwdate.
FIELD-SYMBOLS <l_wtime> TYPE n1apcnwtime.

super->__process_context_change_log( ).

LOOP AT gt_context_change_log ASSIGNING <ls_log>.


CHECK <ls_log>-node_name = co_node_data.
CHECK <ls_log>-node IS BOUND.
CASE <ls_log>-attribute_name.
WHEN co_attr_ordpri.
CHECK <ls_log>-new_value IS BOUND.
ASSIGN <ls_log>-new_value->* TO <l_ordpri>.
ls_corder_x-ordpri = <l_ordpri>.

26 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
ls_corder_x-ordpri_x = abap_true.
WHEN co_attr_date_apcn.
CHECK <ls_log>-new_value IS BOUND.
ASSIGN <ls_log>-new_value->* TO <l_wdate>.
ls_apcn_x-wdate = <l_wdate>.
ls_apcn_x-wdate_x = abap_true.
WHEN co_attr_time_apcn.
CHECK <ls_log>-new_value IS BOUND.
ASSIGN <ls_log>-new_value->* TO <l_wtime>.
ls_apcn_x-wtime = <l_wtime>.
ls_apcn_x-wtime_x = abap_true.
ENDCASE.
ENDLOOP.

If you want to be able to react to the Floorplan Manager (FPM) events at the level of the individual Web Dynpro
components, redefine the method _PROCESS_EVENT, also. You can also use this method if you want to react to
user actions in one single place.
This source code from the class CL_ISHMED_CORD_UC_SERVICES describes an example implementation in which
the system generates individual services upon a user action:

METHOD _process_event.

DATA lr_cordpos TYPE REF TO cl_ishmed_cordpos.

CLEAR ev_result.

IF io_event IS INITIAL.
RETURN.
ENDIF.

CASE io_event->mv_event_id.
WHEN cl_ishmed_cord_fpmevents=>co_id_generate_indservices.
lr_cordpos = cl_ishmed_cord_fpmparams=>generate_indservices( ir_event = io_event
).
IF lr_cordpos = gr_cordpos.
_cmd_generate_indservices( ir_event = io_event ).
ELSE.
CALL METHOD super->_process_event
EXPORTING
io_event = io_event
it_interface_views = it_interface_views
IMPORTING
ev_result = ev_result.
ENDIF.
WHEN 'SERVICES_SET_DETAILS'.
CHECK gr_details_data_element IS BOUND.
_show_details( ir_data_element = gr_details_data_element ).
WHEN co_action_generate.
_generate_indservices( ).

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 27
* WHEN cl_ishmed_cord_fpmevents=>co_id_goto_indsrv_full.
* _cmd_goto_indsrv_full_scrm( ir_event = io_event ).

WHEN OTHERS.
CALL METHOD super->_process_event
EXPORTING
io_event = io_event
it_interface_views = it_interface_views
IMPORTING
ev_result = ev_result.
ENDCASE.

ENDMETHOD.

Now redefine the method _WDDOEXIT as follows to release the resources for the clinical order component and to
pass on the further release of resources in the hierarchy. Depending on the respective clinical order component,
release steps of differing complexity are possible:

METHOD _wddoexit.

CLEAR gr_comp_my_comp_name.

super->_wddoexit( reason = reason ).

ENDMETHOD.

28 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
2.4.3Implementing Interface to the Web Dynpro Component in the
Clinical Order Component

This chapter describes the completion of the connection between Web Dynpro component and the clinical order
component.

Note
For the example, this guide uses the clinical order component CL_ISHMED_COMP_COMMENT, in which the
modifications discussed here have already been made.
Add the interface IF_ISHMED_CORD_WDCOMPONENT to the clinical order component and implement the interface
methods for the last step, as illustrated in the following steps:
1. Implement the method GET_UIBB in the same way as the implementation in the class
CL_ISHMED_COMP_COMMENT. Adjust the name of the Web Dynpro component and of the window in
accordance with your entries in Chapter 2.1.1:
Rs_uibb-component: Name of the Web Dynpro component (in the example:
ZN1CORD_COMP_TUTORIAL)
Rs_uibb-interface_view: Name of the window (in the example: W_MAIN)
The source code below shows the implementation in the class CL_ISHMED_COMP_COMMENT in the
standard i.s.h.med system:

method IF_ISHMED_CORD_WDCOMPONENT~GET_UIBB.

DATA lr_compdef TYPE REF TO cl_ish_compdef.

rs_uibb-component = 'N1CORD_COMP_COMMENT'.
rs_uibb-interface_view = 'W_MAIN'.

lr_compdef = get_compdef( ).
IF lr_compdef IS BOUND.
rs_uibb-title = lr_compdef->get_compname( ).
ENDIF.

endmethod.

2. Implement the method GET_FIELDDEFS by simply inserting the following line:


rt_fielddef = cl_ishmed_cord_utl_webdynpro=>build_default_fielddefs(
ir_component = me ).
In addition, the implementation in the example enables you to exclude individual fields from the check of
the field attribute configuration. For the example, you can use the following source code:

Using Custom Clinical Order Components in Smart UI © 2013 SAP AG. All rights reserved. 29
METHOD if_ishmed_cord_wdcomponent~get_fielddefs.

DATA ls_msgmap TYPE rn1_cord_wdcomp_msgmap.

FIELD-SYMBOLS <ls_fielddef> LIKE LINE OF rt_fielddef.

rt_fielddef = cl_ishmed_cord_utl_webdynpro=>build_default_fielddefs( ir_compon


ent = me ).

LOOP AT rt_fielddef ASSIGNING <ls_fielddef>.


CASE <ls_fielddef>-id.
WHEN 'FRAME_COMMENT'.
<ls_fielddef>-ctx_attrname = cl_ishmed_cord_uc_comment=>co_attr_comment.
<ls_fielddef>-view_elemid = cl_ishmed_cord_uc_comment=>co_attr_comment.

CLEAR ls_msgmap.
ls_msgmap-object_type = cl_ishmed_corder=>co_otype_corder_med.
ls_msgmap-msg_parameter = 'FRAME_COMMENT'.
ls_msgmap-msg_field = ''.
INSERT ls_msgmap INTO TABLE <ls_fielddef>-t_msgmap.
ENDCASE.
ENDLOOP.

ENDMETHOD.

Upon completion of these steps, you can use the clinical order component in service ordering in Smart UI.

30 © 2013 SAP AG. All rights reserved. Using Custom Clinical Order Components in Smart UI
www.sap.com/contactsap

© 2013 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any


form or for any purpose without the express permission of SAP AG.
The information contained herein may be changed without prior
notice.
Some software products marketed by SAP AG and its distributors
contain proprietary software components of other software
vendors.
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered
trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System ads, System i5, System
p, System p5, System x, System z, System z10, System z9, z10, z9,
iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS,
S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise
Server, PowerVM, Power Architecture, POWER6+, POWER6,
POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes,
BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2
Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX,
Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are
trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the U.S. and
other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either
trademarks or registered trademarks of Adobe Systems
Incorporated in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the
Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame,
VideoFrame, and MultiWin are trademarks or registered trademarks
of Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered
trademarks of W3C®, World Wide Web Consortium, Massachusetts
Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc.,
used under license for technology invented and implemented by
Netscape.
SAP, R/3, xApps, xApp, SAP NetWeaver, Duet, PartnerEdge,
ByDesign, SAP Business ByDesign, and other SAP products and
services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP AG in Germany and in
several other countries all over the world. All other product and
service names mentioned are the trademarks of their respective
companies. Data contained in this document serves informational
purposes only. National product specifications may vary.
These materials are subject to change without notice. These
materials are provided by SAP AG and its affiliated companies ("SAP
Group") for informational purposes only, without representation or
warranty of any kind, and SAP Group shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP
Group products and services are those that are set forth in the
express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting
an additional warranty.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy