Media Product Master in SAP S/4HANA: Extend the Product Master
Introduction
With SAP ERP, the Media Product Master is an extension of the Material Master that is shipped as part of the media business function set (IS-Media). A set of media-specific fields are shipped as part of the Media Product Master. Adding new customer-specific fields is a time-consuming task that requires development skills.
In SAP S/4HANA, SAP provides a more flexible concept. Instead of shipping a fixed set of fields SAP provides an easy way of defining and adding new fields to the product master. In this blog post, you will learn how to define new fields for the product master and how to add them to the Fiori UI.
Prerequisites
You have the following authorization roles assigned in the front-end system:
- The SAP_BR_PRODMASTER_SPECIALIST specialist role. This allows access to the Manage Product Master app.
- The SAP_NW_APS_EXT_CFL_APP role. This allows use of the Custom Fields and Logic app. For more information about system requirements, see SAP Note 2283716.
- The SAP_UI_FLEX_KEY_USER role. This allows you to adapt Fiori UI.
In addition, the business catalog SAP_CMD_BC_PR_MAINT_PC must be assigned to your user. This allows you to adapt the UI of the Product Master app.
Process
There are 3 steps involved in extending the Product Master:
- Create a Custom Field
Generate the persistence for the new field in the backend - Add New Field to the Fiori UI
Define where the new field is placed on the Fiori UI - Extend CDS View
Define a CDS view extension for the CDS view C_MDProductHierarchyQuery
As an example, for a custom field we will use field Genre with a code list.
1: Create a Custom Field
- Open the Custom Fields and Logic application from the SAP Fiori launchpad and click Create.
- In the opening pop-up, choose Product Master General for Business Context and enter the Label Genre.
- Change the editable pre-filled Identifier and Tooltip if required.
- Choose Type Code List and enter the Length of the ID, for example 4.
- Now you can enter the code list. As an example, enter Code Value SCFI and Description Science Fiction.
- When you are finished entering the allowed values, click Create and Edit.
- Go to UIs and Reports.
- Click Enable Usage for Product Basic Data, Master Data Product Filter and Master Data Product Hierarchy Query.
- For Product Basic Data select the Search Relevance checkbox. Then you can enter values for genre in the basic search field when searching for your products.
- Save the data and then choose the Publish button.
This creates the persistence of the field and makes it available in adaptation mode of the chosen UI. Once the status for the new field changes from Publishing to Published you can continue with the next step.
Tip: you can define several custom fields and publish them all together.
Result: As part of the generation that happens during the publishing process, a domain ZZ1_GENRE and a data element ZZ1_GENRE are created. Using these DDIC objects a field ZZ1_GENRE_PRD was appended to the MARA table. Here we assume that in the Adaptation Transport Organizer (ATO, transaction S_ATO_SETUP) a prefix “ZZ1_” was defined.
2: Add New Field to the Fiori UI
In this step, you define where the new field is placed on the SAP Fiori UI.
- Open the Product Master application from the SAP Fiori launchpad. Search for an existing product and go to the object page of that product.
- Click on your image in the upper left corner to access the Me area.
- Click Adapt UI. The Product Master object page is displayed in UI adaptation mode.
Note: When you mouseover the UI, different areas are highlighted. With a right-click several options are displayed for the highlighted area of the screen. - Select the area to the right of the Created By/On and Last Changed By/On fields.
- Right-click and choose Create Group from the menu and enter Title Data as a title for this new group.
- To place the new field Genre, select the new group, right-click and choose Add Field.
- In the list of Available Fields search for Genre. The fields Genre and Genre (Desc.) are displayed. Select Genre and click OK.
- Choose the Publish button to publish the UI changes. Choose Exit to close the UI adaptation mode.
3: Extend CDS View
Finally, you define a CDS view extension for the CDS view C_MDProductHierarchyQuery . This allows you to use the custom fields in tree table columns of the Product Master Hierarchy application. This is required, since in SAP S/4HANA 1709 the Custom Fields and Logic app generates the custom fields only into the CDS view C_MDProductHierarchyQuery for usage as filter attributes. If you would like to have the custom fields available for usage as columns in the tree table of the Product Master Hierarchy application, this must be added manually via the extension view.
- Open the SAP HANA Studio and connect to the SAP S/4HANA back-end system.
- Switch to the ABAP perspective. If your development system is not yet registered, create a new ABAP project for your development system.
- Right-click System Library and choose New → Other ABAP Repository Object.
- Open the Core Data Services folder, select Data Definition, and click on Next.
- Enter the Package, the Name (for example ZEXT_HPC_ProdHierarchyQ) and the Description (for example extension view for fields in tree table columns).
- Click Finish and copy the following text into the text editor:
@AbapCatalog.sqlViewAppendName: 'ZPRODHRYQEXT' @EndUserText.label: 'Extension for C_MDProductHierarchyQuery' extend view C_MDProductHierarchyQuery with ZEXT_HPC_ProdHierarchyQ { _Product.ZZ1_Genre_PRD as ZZ1_Tree_Genre, _Product.ZZ1_ReleaseDate_PRD as ZZ1_Tree_ReleaseDate, _Product.ZZ1_Title_PRD as ZZ1_Tree_Title }
For each custom field that will appear in the product hierarchy tree table, you must add a line such as “_Product.ZZ1_<name>_PRD as ZZ1_<Alternative name>” .
- Click on Activate button to activate the new extension view. It should now be considered as extension of the C_MDProductHierarchyQuery view.
In the Product Master Hierarchy App, you can add the field Genre to filter attributes by choosing Adapt Filters. To add the field to the columns, you need to click the Settings button.
Conclusion
With these steps you can extend the product master by the required custom fields and add these fields to the UI of the Product Master App and the Product Master Hierarchy App. In addition these fields are available in the corresponding CDS view, so that you can make them available for analytics.
Dear Frank,
It gives me a lot of comfort to see at long last some innovations on IS Media to start with Product Family Masters which prompts me to consider the S4HANA migration in the near future.
We would be waiting anxiously for more updates from you on IS Media related transactions in HANA environment.
K Varkey George
Dear Frank,
First of all, thank for giving some hints regarding IS-Media. I haven't found any other documentation about Media Sales Contact on S4H 1709 and the issue generator. Do they supported in that release?
Rgds,
a
Hi Frank
Thanks for sharing such a useful information.
In earlier ERP system if we activate IS-MEDIA business function set we can get directly set of media specific attributes assigned to Material Master which can be maintained through MM* SAP Transactions and stored in MARA Table, If we need to add custom specific fields then through development we can achieve it
But in case of S/4HANA as IS_MEDIA business function set is not applicable, media Specific attributes (Pre-delivered set of media specific fields) are not existing for Material Master.
Does this mean that we need to add them one by one through Fiori UI (Custom Fields and Logic) along with any new custom field that needs as per business requirement?
If yes, from where we can get list of media specific attributes which are available through IS-MEDIA business function set?
Also is it necessary to extend CDS view for every field which are of media specific attributes and available through IS-MEDIA business function set and business required any custom field if any?
Hi,
Thank you for the nice explanation.
Could you please explain to me how to add the custom field in the Manage Product Master data application?
I am trying to add the custom field in the general information menu tab in that basic data section.