Show TOC

Procedure documentationAdding Fields to the UI Product Header View

 

You might want to make additional fields available on the UI in the product header data. These could be fields from your own set types, for example.

An empty view is provided for this purpose in the product header area, enabling you to include your own fields. An empty view is available for each application:

Application

Component/View for Customer Enhancement

Product (PRD01)

PRD01OV/CustomHeader

Service (PRD02)

PRD02OV/CustomHeader

IP Product (PRD04)

PRD04OV/CustomHeader

Warranty (PRD05)

PRD05OV/CustomHeader

Financing Product (PRD07)

PRD07OV/CustomHeader

Competitor Product (PRDCP)

PRDCPOV/CustomHeader

Object (PRDIO)

PRDIOOV/CustomHeader

Note Note

The product header is the topmost assignment block displayed on the overview page, and is called, for example, “Product Details” for products and “Service Details” for services.

End of the note.

Prerequisites

  • The additional field is available in the business object layer (BOL) as a dependent object of the root object “Product”. Customer set types are automatically available in BOL since the table entries required are generated when the set type is created.

    You can only include organization-independent, single-line set types in the product header.

  • You have created an enhancement set. For more information, see Enhancement Set.

Procedure

The steps below describe how to enhance the product application PRD01. You can enhance the other applications in the same way.

Example Example

You want to add the attribute ZCOLOR from the set type ZSET1 to the application PRD01. In the database table ZSET1, the attribute ZCOLOR has the name ZZ0010.

End of the example.
  1. Use the transaction GENIL_MODEL_BROWSER (component set PROD_APPL) to check that there is a relevant BOL node which contains the new field. The dependent object for the set type ZSET1 is called ZProdSetZSET1. The relationship between the product and ZProdSetZSET1 is called ZProdRelSetZSET1.

  2. Execute transaction BSP_WD_CMPWB and enter the relevant component (for example, PRD01OV). Enter the enhancement set that you created.

  3. If you have not created an enhancement for component PRD01OV, do so by choosing Enhance Component (for more information, see Create Enhancements). You have to do this for each component that you want to enhance.

  4. Enhance the view specified above (for example, PRD01OV/CustomHeader) by clicking Enhance with the secondary mouse button. This copies the view controller class and the context class so that you can enhance them.

  5. Select the view (PRD01OV/CustomHeader) and, on the right-hand side of the screen, choose in the structure Start of the navigation path Context Next navigation step Context Node End of the navigation path and click Create with the secondary mouse button. Enter the following data in the wizard:

    • Name of context node: Set type ID ZSET1 (recommended)

      As there are certain special characters that are not permitted in context node names, such as “_”, you cannot always use the set type ID as the name. If this applies, choose a different name.

    • BOL entity: BOL node of set type (for example, ZProdSetZSET1)

    • For the step "Define Dependency", choose PRODUCT as the superordinate node and enter the BOL relationship for the set type, for example, ZProdRelSetZSET1.

    On completion, a new context node is generated with an associated context node class (with the name ZL_PRD01OV_CUSTOMHEADER_CN01, for example).

  6. Go to the generated context node class and change the inheritance. Enter the class CL_PRD_HEADER_CONTEXT_NODE as the new superclass. This has the following advantages:

    • Input helps are already implemented in the superclass (method GET_V_S_STRUCT). An attribute for which you have maintained fixed values or a value table in the attribute definition therefore automatically has an input help.

    • The new fields are automatically set to ready for input or not ready for input (method GET_I_S_STRUCT of the superclass), if required. Description fields, for example, are automatically set to not ready for input. If a set type is not assigned to a category or is referenced, the field is also not ready for input.

  7. If you have changed the superclass to CL_PRD_HEADER_CONTEXT_NODE, you must implement the following methods in the generated context class:

    • New instance method CONSTRUCTOR (Public)

      Code:

      Syntax Syntax

      1. METHOD constructor.
         CALL METHOD super->constructor.
         me->base_entity_name_inst  = base_entity_name.
         me->base_entity_relation   = 'ZProdRelSetZSET1'.
        ENDMETHOD.
      End of the code.
    • Change the existing method ON_NEW_FOCUS

      New code:

      Syntax Syntax

      1. METHOD on_new_focus.
         me->create_property( focus_bo ).
        ENDMETHOD.
      End of the code.
  8. Create a new configuration for the view PRD01OV/CustomHeader, or enhance the existing configuration and add the new field (context node ZSET1, field ZZ0010).

  9. The superclass CL_PRD_HEADER_CONTEXT_NODE provides a generic input help. If this generic solution does not meet your requirements, you can implement your own getter methods for the specific field in the generated context node class and thus override the standard behavior.

    Example Example

    • Method GET_I_ZZ0010, to change the ready for input status of the field.

    • Method GET_V_ZZ0010 for your own input help.

    End of the example.