Extension Fields SRM BuPa WDUI v2
Extension Fields SRM BuPa WDUI v2
Content
How to add Extension Fields to SRM Business Partner Web Dynpro UI.................................1
Add extension fields to the database table BUT000.............................................................3
1) Create a structure containing the extension fields ........................................................3
2) Create an append in extension structure INCL_EEW_BUT000...................................3
3) Create an append in extension update structure INCL_EEW_BUT000_X ...................5
Add extension fields to the SRM Business Partner data transfer structure ...........................7
Enhance Web Dynpro component views with the extension fields ......................................9
1) Enhance Context: Add new attributes to the Context...................................................9
2) Enhance the Layout: Add UI elements to the layout .................................................. 11
Metadata for extension fields ............................................................................................ 14
Check Extension Field Data ..............................................................................................17
Prerequisite:
The OSS Note 1384267 has to be installed as prerequisite to the proceeding described in
this document.
The result could look as shown in the following example for the Business Partner
Supplier. Note that this documentation allows adding extension fields only on the shown
tab/subview.
1
How to add Extension Fields to SRM Business Partner Web Dynpro UI
2
How to add Extension Fields to SRM Business Partner Web Dynpro UI
To add your customer-specific extension fields to the database table BUT000, you need to
perform the following steps:
1) Create a structure containing the extensions fields for Business Partners.
2) Create an append in extension structure INCL_EEW_BUT000, which includes the
structure which contains the extension fields.
3) Create an append in extension update structure INCL_EEW_BUT000_X, which contains
the identical field names as structure INCL_EEW_BUT000, but different component types.
Note, that here you have to include all Business Partner extension fields you want to use for
the different Business Partner master data objects like Supplier, Bidder, Contact Person, etc.
Create a structure in the customer namespace that contains all extension fields, which shall be
stored on the database table BUT000.
This structure will be included in an append to the BUT000 include structure
INCL_EEW_BUT000.
Figure 2: Sample structure containing two Business Partner extension fields Z_EXTFLD_01 and Z_EXTFLD_02
Use transaction se11 to open the Data Type INCL_EEW_BUT000 in Display mode. Create a
new append to INCL_EEW_BUT000. Include the newly created structure containing the
customer extension fields to the append as shown in the screenshots below.
3
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Figure 4: Including the structure with the extension fields to the append for incl_eew_but000
Finally, the structure INCL_EEW_BUT000 could look like on the following screenshot:
4
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Figure 5: Sample for INCL_EEW_BUT000 after including Business Partner extension fields.
Steps to perform:
Use transaction se11 to open the Data Type INCL_EEW_BUT000_X in display mode.
Create a new append to INCL_EEW_BUT000_X.
5
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Finally, the structure INCL_EEW_BUT000_X could look like the example on the following
screenshot:
6
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Steps to perform:
Use transaction se11 to open Data Type INCL_EEW_BP_CSF_COMPANY_DATA in
display mode.
Include the structure that has already been inserted to incl_eew_but000 to the
append.
7
How to add Extension Fields to SRM Business Partner Web Dynpro UI
8
How to add Extension Fields to SRM Business Partner Web Dynpro UI
In order to add extension fields to the UI, you have to use the Web Dynpro Enhancement
Framework to enhance the view V_PS_OIF_NAME. Note, that this enhancement framework
allows for modification-free changes to the UI.
On the view of the Web Dynpro component, you have to perform two tasks:
1) Enhance the context: Add an attribute for each extension field to a specific context
node
2) Enhance the layout: Add UI elements to the layout.
Please see the document in consulting note 1115579 “Extending an SAP SRM 2007 Web
Dynpro View”, pages i-ix for detailed explanations of how to extend an SRM Web Dynpro
View with the help of the Web Dynpro Enhancement Framework. Please ignore the part about
metadata in that document, as we will have a dedicated section in this document for the
handling of metadata.
Steps to perform:
Use transaction se80 to open the Web Dynpro Component
/SAPSRM/WDC_MODC_NAME, view V_PS_OIF_NAME.
Select the tab “Context” on the View V_PS_OIF_NAME in display mode.
Open the Context-root structure until you find the node COMPANY_DATA (for
Contact Person: CP_BASIC_DATA).
9
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Use the Enhancement Symbol in the toolbar or press CTRL-F4. Create a new
enhancement implementation.
Figure 11: Creation of an enhancement implementation to enhance view V_PS_OIF_NAME of Web Dynpro
Component /SAPSRM/WDC_MODC_NAME
Right-click the Context node COMPANY_DATA and choose in the context menu
“Create Using the Wizard” -> “Attributes from Components of Structure”
Figure 12: Context node COMPANY_DATA - add attributes from underlying context structure
10
How to add Extension Fields to SRM Business Partner Web Dynpro UI
In the upcoming selection list, keep all entries marked and additionally mark the new
fields you want to add to the layout
Figure 13: Select new extension fields to be added to the Context of View V_PS_OIF_NAME
Select the tab “Layout” on the View V_PS_OIF_NAME in display mode. Then perform the
following actions:
Press the Enhancement icon in the toolbar or press CTRL-F4, select the Enhancement
Implementation which you already created for enhancing the context in the previous
section.
11
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Add a new input field as matrix data element at the desired position of the layout. You
can do this by right-clicking the container BASIC_DATA1 of
ROOTELEMENTCONTAINER (Contact Person: container BASIC_DATA).
Select “Insert Element” and choose an ID for the new UI element and the appropriate
Type – in our example : InputField.
Bind the value property of the input field to the corresponding context element.
Figure 14: Insert an input field into the layout and bind the value to the context
Add a corresponding label for the new input field. Choose your input field as value for
the property “LabelFor”. You can choose LayoutData “MatrixHeadData” in the
properties of the label if you want to begin a new row on the UI screen with your
extension fields. You can move the UI element up or down in order to the desired
position by right-clicking the UI element in the control panel on the right side.
Save and activate the enhancement implementation.
The result could look as follows in the Web Dynpro layout editor:
12
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Figure 15: Sample enhancement of the Web Dynpro View V_PS_OIF_NAME with two input fields and two
corresponding labels
13
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Use transaction sm30 to access table view /sapsrm/v_mdfsbc. For each extension field make
an entry in the table. For this you have to select the correct Set Type and Business Object
Type. In our example, we have to use the Set Type “BC” for Business Partner Central Data,
and the Business Object “BBP000” for Supplier.
The metadata is set in the columns Field Visible, Editable, Required. If needed, you can
dynamically determine these metadata properties during runtime by defining a dynamic
metadata class and methods.
Below you find a definition of metadata for the sample extension fields Z_EXTFLD_01 and
Z_EXTFLD_02:
Figure 16: Sample entries in table view /sapsrm/v_mdfsbc for the definition of Metadata for two sample extension
fields on the Business Partner Supplier.
14
How to add Extension Fields to SRM Business Partner Web Dynpro UI
How to set Metadata for Business Partner Extension Fields in SRM 7.0
This section is devoted to the setting of metadata for the extension fields in SRM 7.0.
Metadata for fields include the following three properties:
Visible,
Enabled,
Required.
With the metadata you can control for which Business Partner master data object the new
fields shall be visible on the UI.
For each Business Partner master data object there is a dedicated metadata provider class.
These are:
/SAPSRM/CL_PDO_META_MO_SUPP for Supplier
/SAPSRM/CL_PDO_META_MO_BIDDER for Bidder
/SAPSRM/CL_PDO_META_MO_INVP for Invoicing Party
/SAPSRM/CL_PDO_META_LOCATION for Location
/SAPSRM/CL_PDO_META_MO_PUR_COM for Purchasing Company
/SAPSRM/CL_PDO_META_MO_PORTAL for Portal
/SAPSRM/CL_PDO_META_MO_CP for Contact Person.
Standard behavior of SRM with respect to metadata is that a UI element is by default not
visible, if no metadata values are maintained or set.
In order to set metadata values for extension fields, it is recommended that you use the
NetWeaver Enhancement Framework to create an implementation of an Implicit
Enhancement Point at the end of a method. This so-called “Post-Exit” has to be created in the
method /sapsrm/if_pdo_meta_consumer~get_field_metadata of the
corresponding metadata provider class or classes.
Within the coding of the post-exit you can set the metadata values as desired.
Note:
In the case that you want to have an extension field only on one Business Partner master data
object, it might be necessary that you explicitly set extension fields to invisible in post-exits
of provider classes of other master data objects. Therefore, we recommend a test, where you
open a sample for each master data object and make sure that extension fields are visible only
on the desired master data objects.
15
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Figure 17: Sample implementation of a post-exit in the metadata provider class for the Supplier for setting metadata
values
16
How to add Extension Fields to SRM Business Partner Web Dynpro UI
Data of extension fields can easily be checked by implementing the following new BAdI
definitions of the Enhancement Spot /sapsrm/bd_pdo_bupa_check:
/sapsrm/bd_pdo_bp_chk_compdat for all Business Partners besides Contact
Person,
/sapsrm/bd_pdo_bp_check_cpdat for Contact Person.
In the corresponding BAdI implementations, the data of extension fields is available, and
customer-specific checks can be implemented with respect to extension data.
Actually, also standard SRM Business Partner data can be checked in an implementation of
the mentioned BAdI’s.
17