You are on page 1of 19

Extending an SAP SRM 2007 Web Dynpro Vi ew

Table of Contents
Extending an SAP SRM 2007 Web Dynpro View ................................... i
Table of Contents .................................................................................... ii
1 Creating an Enhancement Containing One or Several Fields....... iii
Creating or Selecting an Enhancement Implementation................................... iii
Creating Context Attributes for the Fields .......................................................... v
Adding Labels and Fields to the Web Dynpro View .......................................... vi
Adding a Label to the Web Dynpro View................................................................................vi
Adding a Field to the Web Dynpro View ................................................................................vii
Binding a Label to the Field....................................................................................................vii
Binding a Field to the Context Attribute ...............................................................................viii
Activating Changes .............................................................................................. ix
Defining Field Metadata ....................................................................................... ix
Suppressing Standard Display of Customer Fields ........................................... x
2 Personalization................................................................................. xii
3 Appendix .......................................................................................... xiii
Finding the Right Web Dynpro Component and View..................................... xiii
Overview of Basic Data Views on the SAP SRM 2007 Web Dynpro UI........... xiv
Overview Which Generic Framework is Implemented in Which Support
Package................................................................................................................ xv
Copyright ................................................................................................................................xvi
SAP - Important Disclaimers............................................................................. xvii
Coding samples.....................................................................................................................xvii
Internet hyperlinks.................................................................................................................xvii
Accessibility...........................................................................................................................xvii
SAP Supplier Relationship Management 6.0 (SAP SRM 2007) is based on Web Dynpro UI
technology and enhancement framework. This combination allows developers of add-ons and
customer enhancements to extend and adapt SAP SRM screens, called Web Dynpro views,
according to their needs without modifications.
Enhancing a Web Dynpro view allows you to create new UI elements. This procedure is similar
to the development of the components. All UI elements created within the enhancement
implementation are handled the same way as Web Dynpro UI elements during runtime.
A customer field extension framework is implemented in SAP SRM 2007. The customer or add-
on must append the fields to the header or item structures of a business object. The framework
then dynamically generates fields on the UI on the basic data tabs on header and item level of
most business objects.
1 Creating an Enhancement Containing One or
Several Fields
If the customer field extension framework either does not exist for a certain business object
type, or it is not sufficient for your needs, you can extend an existing Web Dynpro view
component by adding new fields. For example, the basic data tab on the item level of the
shopping cart can be extended by adding new fields using a Web Dynpro enhancement
implementation. In the following example we describe how to add an input field, a checkbox
and a dropdown list box to a Web Dynpro view.
To display a Web Dynpro view, proceed as follows:
1. From the ABAP Workbench, start the Object Navigator transaction (SE80).
2. Select Web-Dynpro-Comp./Intf. From the input help.
3. Select a component, for example, /SAPSRM/WDC_DODC_SC_I_BD (Component for
Shopping Cart Item).
4. Double-click the view in which you want to add fields, for example, V_DODC_SC_I_BD.
Note: A Web Dynpro component may have more than one view.
Creating or Selecting an Enhancement Impl ementation
The first time you extend a Web Dynpro view with new fields, a new enhancement
implementation must be created or an existing to be selected.
Figure 1: Creation of a New Enhancement Implementation
To create an enhancement implementation, double-click
1
the view or controller in which you
want to perform the enhancement (see Figure 1). You can then open a creation dialog for a
new enhancement implementation or see a list of all existing enhancement implementations for
this component
2
. You can ignore the next dialog screen unless you are using switched
packages. For more information about switches, see the Switch Framework Documentation.
Figure 2: Assignment of a Switch to an Enhancement Implementation
If the implementation has already been created, you need to change the view to enhance
mode. The view displays the status and the enhancement status as either Active or Inactive
(see Figure 3). This automatically directs you to the Layout tab page of the view.
Figure 3: Status of the Enhancement in View Editor
1
The function Create/Change of an enhancement implementation is only available to you if the
original component is in display mode. If you switch from display mode to change mode, the
original component itself will be ready for change, so therefore no enhancement implementation
can be created or changed and the icon is grayed out.
2
We recommend that you add a namespace prefix to the name of the enhancement
implementation. The names of objects that you create in this enhancement implementation
should also begin with this namespace
2
prefix. Make sure you use the customer namespace for
the enhancement implementation, as well as for the UI elements.
The Layout tab page shows the layout structure (see Figure 4). The layout structure consists of
a main container, the ROOTUIELEMENTCONTAINER, and several sub-containers.
Containers structure the layout of the application, for example, grouping related fields together.
Figure 4: Structure of the Vi ew Layout of the Shopping Cart Basi c Item Data Tab
Creating Context Attributes for the Fields
Each element
3
of a Web Dynpro view is always bound to a context element ( A context fields).
Each context has a hierarchical structure. It contains a root node CONTEXT and the different
context elements are arranged below it. A context element or node consists of an arrangement
of attributes assigned from a DDIC structure or manually added. Each view contains a data
container which displays the data in the view (see Figure 5). This data container is called a
view context.
Figure 5 Web Dynpro Vi ew Contexts
The application data is structured and stored in the view context. This data, for example, is
provided by the SRM system and is displayed in the view. It can be predefined or data
elements can be filled by user input. Other context elements are used for the internal structure
of the context.
Before new elements are going to be added to a Web Dynpro View, it must be first checked if
the corresponding context fields to bind these elements already exist in the context. To check if
new context attributes for the fields need to be created:
3
A element could be an input field, a check box or a dropdown list box
1. Select the Context tab on the view editor
4
.
2. Select the desired context tree and find the required attributes. For the shopping cart, select
the node ITEM_BASIC_DATA.
Figure 6: Adding Attributes to the View Context Node
If the required attributes are not in the context tree, they must be added to the context from
DDIC. To add attributes from the DDIC structure to the view context node, use the wizard (see
Figure 6). You can then select the components or attributes of the structure
5
to be added to the
view context. When you confirm the selected attributes, they are automatically assigned to the
view context.
6
Figure 7: Selecti ng Attributes From the Underlying DDIC Structure
Adding Labels and Fields to the Web Dynpro View
You can add new fields from the DDIC to the selected enhancement implementation.
To add several fields with labels to a Web Dynpro component, you must create a label and a
field before creating more labels.. The following steps apply to each field.
Adding a Label to the Web Dynpro View
To insert a label element to a Web Dynpro view, proceed as follows:
4
The view editor is also called UI Designer.
5
It is not possible to include any attributes in a node that do not correspond to a component of the
selected structure.
6
The added attributes seen in Figure 7 are dummy fields used in this example and are not standard
delivery. However these have been appended in the customer included structure of the shopping cart.
1. Open the context menu of the container in which the fields are inserted, for example,
LEFT_CONTAINER,.
2. Choose Insert Element.
3. Enter the name of the element, for example, "ZZINPUT_FIELD_LABEL".
4. Select Label from the input help for the Type field.
5. Choose Confirm Selection in the dialog box.
Adding a Field to the Web Dynpro View
To add fields to the Web Dynpro view, proceed as follows:
1. Select the context menu of the selected container and choose Insert Element.
2. Enter a name for the input field, for example, "ZZINPUT_FIELD".
3. Select Input Field from the input help for the Type field.
4. Choose Confirm Selection in the dialog box.
Figure 8: Adding New Elements to a Web Dynpro View
Binding a Label to the Field
To bind labels to the fields you add to Web Dynpro views:
1. Select the Label element from the element list.
2. From the input help for the LabelFor line in the properties table, choose the InputField
element that you created, in this case, ZZINPUT_FIELD. The ZZINPUT_FIELD_LABEL is
now bound to the input field
7
.
7
As the new elements have been added as an enhancement to a Web Dynpro view, you will
see the name of your enhancement implementation in the Erweiterung (Extension) property of
each added element. Therefore, you will only able to edit these enhancement fields in the
enhancement mode of the corresponding implementation.
To display the fields together, set the layout data property of the element label to
MatrixHeadData and the layout property of the element ZZINPUT_FIELD_LABEL to
MatrixData.
For an indicator or dropdown list box element with corresponding labels repeat steps 1.3.1.to
1.3.3
8
.
Figure 9: Overview of the Newly Added El ements
The labels text boxes are empty (see Figure 9). You can enter your own text in the property
Text. If left blank the label can be taken over from the bound field in the Web Dynpro context
as described in the next step.
Binding a Field to the Context Attribute
As shown in the previous paragraphs, UI elements have inherent properties. Each UI element
for the transfer or display of data contains one property that describes user input or the source
of the data to be displayed.
These properties can be defined at design time by specifying a fixed value or referring to a
context element. Alternatively, you can bind them to a context element. In this case, the
context element value is displayed at runtime, or the input field content is passed from the
screen to the context element of the view element.
Data binding of a UI element property is set up in the view layout. In the Binding column of the
properties table of the embedded UI elements, choose to open a dialog box, which
provides the context structure of the corresponding view for an element selection.
Figure 10: Binding the New Element to the View Context Item Basic and View in Browser
8
It is important to note that for SAP NetWeaver support packages prior to SAP NetWeaver
SP13, the enhancement framework does not support moving enhanced Web Dynpro view
elements to non-standard places. It might be possible to move the UI elements within the view,
but you may not achieve the desired result . Therefore, do not move the enhanced fields to a
different place than where they were created by default in the Web Dynpro view in SAP SRM
2007 support packages prior to SAP SRM 2007 SP04.
The new elements are bound to the attributes of the view context. It is not necessary to bind a
label to view context as it is bound by default to the medium field label of the corresponding
DDIC data type
9
of the attribute. You can change the binding of the labels text property by
selecting the type of character you require, for example, Long Text (see Figure 11).
Figure 11: Changing the Binding of the Text Property of a Label
Activating Changes
To activate the changes you have made, save your changes and activate the component. The
Web Dynpro framework first activates the enhancement and then the component. The
elements are displayed in the LEFT_CONTAINER and automatically checked when the you
change from display to change mode, or they are a displayed as a required field.
Defining Field Metadata
You must define field metadata to make elements or fields visible on a Web Dynpro ABAP UI.
To configure metadata for header and item fields, start the Call View Maintenance transaction
(SM30) and call one of the following views:
/SAPSRM/V_MDF_HC (Customer Metadata Configuration for Header Fields)
/SAPSRM/V_MDF_IC (Customer Metadata Configuration of Item Fields)
For example, metadata can be configured for item fields in the view /SAPSRM/V_MDF_IT. You
can enter additional data to make the field visible on the UI. You must enter a field name and
the business object type. You do not have to enter data for the other four key fields: subtype,
transaction type (process type), item type, and item process type.
9
Note: The text of a label element is normally determined by the bound data type of the element to
which the label points. If the element has a data type assigned where the same field label is left blank,
no text will be displayed for it on the label. In this case, change the binding property of the label text
or, if necessary, add your own text directly in the field of the labels text property.
Figure 12: Metadata Configuration of Item Fields and View in Browser
You can enter data for each new element (field) on the UI, and each element can have more
than one entry. If several entries for the same element exist that correspond to the same key,
the most specific one takes precedence. Entries in the tables should be as generic as possible.
For more information about metadata configuration, see the SAP SRM 2007 SP03
Implementation Guide (IMG) and the corresponding Solution Manager content. SAP SRM 2007
SP02 customers, see SAP Note 1103956.
Suppressing Standard Display of Customer Fields
It is sometimes necessary that a certain generic customer field not be displayed in a Web
Dynpro view
10
so that it can be used in another view, for example, another tab
11
. In this case,
the fields standard display needs to be suppressed from the current view. You can suppress a
field using the metadata framework setting for the field, however, metadata can be only set
globally for a customer field and therefore cannot be set for a specific Web Dynpro view. The
metadata is always necessary for displaying the field, regardless of the view
12
. To suppress
13
the standard display of customer fields in a view, maintain an entry for the desired field in the
view /SAPSRM/V_WD_FLD. To suppress a field, proceed as follows:
1. Create a new entry (see Figure 13).
2. Choose Exclusive from the Inclusive/Exclusive option on the Configuration for Generic Display
of Extension Fields on WD tab
14
. This stops the framework from generating this field on the
UI.
10
For example, the view of the tab for the Item Basic Data Tab of the Shopping Cart
11
The generic display of customer fields is only available in some Web Dynpro View. For more
information, see chapter 3.3. This is only a technical point of view regarding the layout. Before adding
a field to another view, it must be checked to see if a context field for binding already exists.
12
If we set metadata to make a customer field invisible, it would mean that this field is suppressed in
all views of the certain business object for within a specific scope.
13
This option prevents fields appended in a customer include structure from being processed by the
standard display of customer fields.
14
If you do not select Inclusive/Exclusive, the entry will be ignored.
Figure 13: Suppress a Customer Field from Being Displayed
To customize the sequence of customer fields and their horizontal alignment, or to change the
order in which customer fields appear
15
, proceed as follows:
1. Create a new entry or use an existing one.
2. On the Configuration for Generic Display of Extension Fields on WD tab, enter a numeric
value between -9 and +9 in the Sequence field. Entering a lower sequence number for a field
will cause the field to be displayed with a higher sequence value. Similarly, a higher
sequence causes a field to be displayed with a lower sequence value.
3. Choose Inclusive from the Inclusive/Exclusive option.
4. To customize the alignment
16
of a customer field, select an alignment setting from the
Horizontal Alignment input help (see Figure 14).
Figure 14: Customizi ng the Sequence and Alignment of a Customer Field
15
It is not possible to change the display sequence of core fields.
16
If Horizontal Alignment displays 0, the alignment is set to auto.
2Personalization
Personalization allows you to adjust the application to suit your requirements or preferences.,
You can personalize your application directly from within the application. There are fewer
options for variation in personalization than in Configuration. This ensures that personal
settings do not restrict the run capability of the application.
Settings can be personalized for individuals or groups. A system administrator can process
personalization settings on the basis of his or her extended authorization when the application
is running in configuration mode.
For more information, see Personalization see SAP Help Portal at http://help.sap.com ->Web
Dynpro for ABAP ->End User and Administrator Personalization or read SAP Note 1109666
(How to activate Web Dynpro Customizing).
Appendix
Finding the Right Web Dynpro Component and View
The next chapter gives you an overview of the basic data views on the SAP SRM 2007 Web
Dynpro UI.
To find a required Web Dynpro component or name, proceed as follows:
1. On the UI select Enhanced, and in the context menu, select More Field Help. A popup
appears displaying the technical information for a UI element.
2. In the popup, under General Information About the Application and Component, you can find
the Web Dynpro component name and associated views (see Figure 16).
Figure 15: Finding the Right Component on the UI
To find technical information about a field, proceed as follows:
1. Select More Field Help from the context menu. A popup appears displaying the functional
field description and its usage.
2. In the popup, select Technical Help. The technical information for the field Product ID is
displayed (see Figure 16).
Figure 16: Technical Help for the Field Product ID of the Shopping Cart Item Basic Data
Vi ew
Overview of Basic Data Views on the SAP SRM 2007 Web
Dynpro UI
Overview of on basic data views on SRM 6.0 Web Dynpro UI
Business Object Scope Web Dynpro Component
Header /SAPSRM/WDC_DODC_ASL_H_BD
Item /SAPSRM/WDC_DODC_ASL_S_GD
SC(Shopping Cart) Header /SAPSRM/WDC_UI_SC_DOFC_HD
Item /SAPSRM/WDC_DODC_SC_I_BD
PO(Purchase Order) Header /SAPSRM/WDC_DODC_PO_H_BD1
Overvie
w /SAPSRM/WDC_PO_DOFC_OV_HD
Item /SAPSRM/WDC_DODC_PO_I_BD
CTR(Contract) Header /SAPSRM/WDC_CTR_DODC_H_BD
Overvie
w /SAPSRM/WDC_CTR_DOFC_OV_H
Item /SAPSRM/WDC_CTR_DODC_I_BD
INV(Invoicing) Header /SAPSRM/WDC_DODC_INV_H_BD
Overvie
w /SAPSRM/WDC_DODC_INV_O_BD
Item /SAPSRM/WDC_DODC_INV_I_BD
AUC(Auction) Header /SAPSRM/WDC_DODC_AUC_H_BD
Item /SAPSRM/WDC_DODC_AUC_I_BD
CONF(Confirmation) Header /SAPSRM/WDC_DODC_CONF_HBD
Item /SAPSRM/WDC_DODC_CONF_IBD
POR(POR) Header /SAPSRM/WDC_DODC_POR_H_BD
Overvie
w /SAPSRM/WDC_DODC_POR_O_BD
Item /SAPSRM/WDC_DODC_POR_I_BD
QTA(Quote Arrangement) Header /SAPSRM/WDC_DODC_QTA_C_GD
Item /SAPSRM/WDC_DODC_QTA_H_GD
QTE(Quote) Header /SAPSRM/WDC_DODC_QTE_H_BD
Item /SAPSRM/WDC_DODC_QTE_I_BD
RFQ(Bid Invitation) Header /SAPSRM/WDC_DODC_RFQ_H_BD
Item /SAPSRM/WDC_DODC_RFQ_I_BD
Overview Which Generi c Framework i s Implemented i n
Which Support Package
Frameworks
SP02 SP03
Business Object Scope MD
CE
F
T
E MD
CE
F
T
E NDF
ASL(PO. Response ) Header X X
Item X X X
SC(Shopping Cart) Header
Item X X X X X X X
PO(Purchase Order) Header X X X X X X
Overview X X
Item X X X X X X X
CTR(Contract) Header X X X X X
Overview X X
Item X X X X X
INV(Invoicing) Header X X X X
Overview X X
Item X X X X
AUC(Auction) Header X X X X X X
Item X X X X X X
CONF(Confirmation) Header X X X X X X X
Item X X X X X X X
POR(POR) Header X X X X
Overview X X X
Item X X X X
QTA(Qoute Arrangement) Header X X X X X
Item X X X X X
QTE(Quote) Header X X X X X X
Item X X X X X X
RFQ(Bid Invitation) Header X X X X X X
Item X X X X X X
MD Metadata Framework
CEF Customer Extension Field
Framework
TE Table Extension Framework
NDF Non-Database Display Field
Framework
Copyright
Copyright 2007 SAP AG. All rights reserved.
SAP document classification: PUBLIC
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, Outlook, and PowerPoint are registered trademarks of Microsoft
Corporation.
IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400,
OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner,
WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM
Corporation 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.
J ava is a registered trademark of Sun Microsystems, Inc.
J avaScript is a registered trademark of Sun Microsystems, Inc., used under license for
technology invented and implemented by Netscape.
MaxDBis a trademark of MySQL AB, Sweden
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, 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 information 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.
SAP - Important Disclaimers
SAP document classification: PUBLIC
This document is for informational purposes only. Its content is subject to change without
notice, and SAP does not warrant that it is error-free. SAP MAKES NO WARRANTIES,
EXPRESS OR IMPLIED, OR OF MERCHANTABILITY, OR FITNESS FOR A PARTICULAR
PURPOSE.
Coding samples
Any software coding and/or code lines / strings ("Code") included in this documentation are only
examples and are not intended to be used in a productive system environment. The Code is
only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP
does not warrant the correctness and completeness of the Code given herein, and SAP shall
not be liable for errors or damages caused by the usage of the Code, except if such damages
were caused by SAP intentionally or grossly negligent.
Internet hyperl inks
The SAP documentation may contain hyperlinks to the Internet. These hyperlinks are intended
to serve as a hint where to find supplementary documentation. SAP does not warrant the
availability and correctness of such supplementary documentation or the ability to serve for a
particular purpose. SAP shall not be liable for any damages caused by the use of such
documentation unless such damages have been caused by SAP's gross negligence or willful
misconduct.
Accessibility
The information contained in the SAP Library documentation represents SAP's current view of
accessibility criteria as of the date of publication; it is in no way intended to be a binding
guideline on how to ensure accessibility of software products. SAP specifically disclaims any
liability with respect to this document and no contractual obligations or commitments are
formed either directly or indirectly by this document. This document is for internal use only and
may not be circulated or distributed outside your organization without SAP's prior written
authorization.

You might also like