0% found this document useful (0 votes)
97 views

Extension Fields SRM BuPa WDUI v2

This document describes how to add custom extension fields to SRM's Business Partner web UI. It involves: 1) Adding the fields to the central BUT000 database table by creating structures and appends. 2) Including the fields in SRM data transfer structures. 3) Enhancing the relevant Web Dynpro views to display the fields by adding attributes to contexts and UI elements to layouts. Metadata and testing steps are also covered. The process allows extending Supplier, Bidder, and other partner types separately with custom fields.

Uploaded by

Robert Borja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

Extension Fields SRM BuPa WDUI v2

This document describes how to add custom extension fields to SRM's Business Partner web UI. It involves: 1) Adding the fields to the central BUT000 database table by creating structures and appends. 2) Including the fields in SRM data transfer structures. 3) Enhancing the relevant Web Dynpro views to display the fields by adding attributes to contexts and UI elements to layouts. Metadata and testing steps are also covered. The process allows extending Supplier, Bidder, and other partner types separately with custom fields.

Uploaded by

Robert Borja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

How to add Extension Fields to SRM Business Partner Web Dynpro UI

How to add Extension Fields to SRM Business Partner Web


Dynpro UI
15-September-2009, updated on 04-Apil-2011

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.

This document contains a description of how to add customer-specific fields to the


Business Partner main views of the SRM Web Dynpro UI for Business Partner
maintenance.
Fields can be added to the main views of the following Business Partner master data
objects:
Supplier
Bidder
Invoicing Party
Contact Person
Portal Provider
Purchasing Company
Location
Extension fields can be added separately to the different Business Partner objects, so
you can define different extension fields for different Business Partners.
The customer-specific extension fields will be saved in the central Business Partner
database table BUT000. Note that extension fields of all Business Partners will be stored
in table BUT000.

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

Figure 1: Sample implementation of extension fields on the Supplier

2
How to add Extension Fields to SRM Business Partner Web Dynpro UI

Add extension fields to the database table BUT000

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.

1) Create a structure containing the extension fields

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

Save and activate the new structure.

2) Create an append in extension structure INCL_EEW_BUT000

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 3: Creation of an append to INCL_EEW_BUT000

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.

3) Create an append in extension update structure INCL_EEW_BUT000_X

INCL_EEW_BUT000_X represents the update structure for INCL_EEW_BUT000_X. This


structure contains the information on which extension fields have to be updated when
Business Partner data is saved.

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

Figure 6: Create an append to structure INCL_EEW_BUT000_X

Enter the identical component names as in INCL_EEW_BUT000, but with the


component type BAPIUPDATE.

Finally, the structure INCL_EEW_BUT000_X could look like the example on the following
screenshot:

Figure 7: Append to INCL_EEW_BUT000_X. Note the specific Component Type BAPIUPDATE!

6
How to add Extension Fields to SRM Business Partner Web Dynpro UI

Add extension fields to the SRM Business Partner data transfer


structure
In the next step, the extension fields have to be included in SRM-specific extension includes
to Business Partner transfer structures. These extension includes are:
INCL_EEW_BP_CSF_COMPANY_DATA for Supplier, Bidder, Invoicing Party, Portal
Provider, Location, and Purchasing Company
INCL_EEW_BP_CSF_CONTACT_PERSON for Contact Person.

The following paragraph describes how fields are added to


INCL_EEW_BP_CSF_COMPANY_DATA. In this structure all extension fields have to be
included which can then be used for the Business Partner roles Supplier, Bidder, Invoicing
Company, Portal Provider, Location, Purchasing Company.

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.

Figure 8: Create an append to incl_eew_bp_csf_company_data

7
How to add Extension Fields to SRM Business Partner Web Dynpro UI

Figure 9: Including customer-specific extension fields via structure to incl_eew_bp_csf_company_data

Figure 10: Sample realization of incl_eew_bp_csf_company_data

8
How to add Extension Fields to SRM Business Partner Web Dynpro UI

Enhance Web Dynpro component views with the extension fields

The following Web Dynpro component view(s) have to be enhanced:


/SAPSRM/WDC_MODC_NAME, view V_PS_OIF_NAME for Supplier, Bidder,
Invoicing Party, Portal Provider, Purchasing Company, and Location
/SAPSRM/WDC_MODC_CPD_BD, view V_BD_OIF_BASIC_DATA for Contact
Person.
In the following we will focus on the Web Dynpro Component
/SAPSRM/WDC_MODC_NAME, which shall be used for all Business Partners besides Contact
Person. Corresponding entities for Contact Person are mentioned in the following description.

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.

1) Enhance Context: Add new attributes to the Context

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

Save and activate the Enhancement Implementation.

2) Enhance the Layout: Add UI elements to the layout

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

Metadata for extension fields

In SRM, the visibility of UI elements on business objects (Purchase Order, Shopping


Cart, etc) UI is controlled by the SRM metadata framework, where metadata is stored
in dedicated database tables.
This SRM metadata framework is in place for master data objects since SRM 7.01
(SRM 7.0 Enhancement Package 1). With the framework in place, you can easily
maintain the metadata of customer extension fields in the dedicated metadata tables,
which are also used for fields on business objects and then for standard fields on master
data objects.
For SRM 7.0 no limitations results from the missing connection of the Business Partner
to the SRM Metadata Framework, but a different and more complex approach has to be
taken.
The two different approaches on how to set Metadata for Business Partner Extension
Fields are now described.

How to set Metadata for Business Partner Extension Fields in SRM


>=7.01

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.

Sample coding for an implementation of a method post-exit looks as follows:

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

Check Extension Field Data

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

You might also like