Show TOC

Process documentationCreating a UI for Attachments

 

This document describes how to provide a UI for handling attachments of entities with the MDG Web Dynpro application USMD_OVP_GEN.

Entity types with storage and use type 1 can be configured in the MDG data model to store attachments. If the indicator Attachments is selected, you can store attachments (for example, Microsoft Word or Adobe PDF files) to entities that belong to this entity type. The system automatically provides a data store for this. The existing attachments can be displayed on the UI in a list and new attachments can be created with a dialog box.

Attachments are included in the example configuration USMD_SF_OVP_CARR of the generic MDG Web Dynpro application USMD_OVP_GEN in package MDG_FND_SAMPLE_IMPLEMENTATIONS.

Prerequisites

You have completed the following:

  1. You can use an active MDG data model with at least one entity type with storage and use type 1. You have assigned a business object type code (OTC) to this entity type.

  2. There is an entity type with the indicator Attachments selected.

  3. You have generated the required structures in the Customizing activity Generate Data Model-Specific Structures under Start of the navigation path General Settings Next navigation step Data Modeling End of the navigation path.

  4. You have set the standard data model in your user profile.

  5. The data model is in the customer namespace. If the data model is not in the customer namespace follow the description in Creating genIL Components and Transaction Handler Manually.

  6. You can use a configuration of the generic MDG Web Dynpro application USMD_OVP_GEN that includes an FPM overview page (OVP) FPM_OVP_COMPONENT to which you can add the UIBB. You can open and edit the configuration of this page in the FPM editor. Alternatively, you can create Customizing for this configuration.

For more information, see Creating User Interfaces for Single Object Processing.

Process

Attachment List

The following numbered list describes how to add the attachment list to the UI.

  1. Create a new configuration for the list component FPM_LIST_UIBB_ATS by copying the template USMD_SF_CARR_ATTACHMENT_LIST from package MDG_FND_SAMPLE_IMPLEMENTATIONS.

  2. In the configuration of the list component enter the following values for the parameters of the feeder class CL_USMD_ATTACHMENT_LIST:

    • Component

      Enter ZSP<data_model>. This is the genIL component for single-object processing that was created for your MDG data model, with <data_model> being the ID of your MDG data model.

    • Object Name:

      Enter AtthEntity Type in this field. Replace Entity Type with the name of the entity type for which you want to configure attachments. Atth stands for attachment header.

    • Editable

      Select the Edit checkbox.

  3. Add the list component to the FPM OVP on which the entity attachments should be displayed.

  4. In the wiring of the page, create a wire for the attachment list using the connector class CL_MDG_BS_CONNECTOR_BOL_REL and the following parameters:

    • Source Component: FPM_FORM_UIBB_GL2 (Example) and Source Config Name: USMD_SF_CARR_FORM (Example)

      Enter the component that displays the entity for which the attachment list should be shown. This could be a form component on the page, for example.

    • Port Type: Lead Selection and Port Identifier: Standard

      When you have entered the source component and port correctly, the parameter for Relation Name is automatically set to the corresponding Atth relation for the entity type of the source component, for example CARR2AtthCARRRel.

  5. In the toolbar schema of the FPM OVP, add the following buttons for the attachment list UIBB:

    Text

    Image Source

    Tooltip

    FPM Event ID

    Edit

    ~Icon/Edit

    Edit

    FPM_LOCAL_EDIT

    Delete

    ~Icon/Delete

    Delete Attachment

    ATT_DELETE

    File

    ~Icon/AddFile

    Add File

    ATT_FILE_ADD

    Link

    ~Icon/AddLink

    Add Link

    ATT_LINK_ADD

Dialog Boxes to Add File Attachments

The following numbered list describes how to add a dialog box to the page so that attachments of type file can be added.

  1. Create a new configuration for the form component FPM_FORM_UIBB_GL2 by copying the template USMD_SF_CARR_ATT_FILE from package MDG_FND_SAMPLE_IMPLEMENTATIONS.

  2. In the configuration of the form component enter the following values for the parameters of the feeder class CL_USMD_ENTITY_ATTACHMENT:

    • Component

      Enter ZSP<data_model>. This is the genIL component for single-object processing that was created for your MDG data model, with <data_model> being the ID of your MDG data model.

    • Object Name:

      Enter AttcEntity Type in this field. Replace Entity Type with the name of the entity type for which you want to configure attachments. Attc stands for attachment content.

    • Editable

      Select the Edit checkbox.

  3. Add a dialog box to the FPM OVP on which the entity attachments should be displayed with page ID USMD_ENTITY_ATT_FILE and description Add File.

  4. For the attributes of the dialog box, enter the following values: Button Sets: OK and Cancel (OK is default button) Width: 400 (choose a value that suits your page layout)

    • Button Sets

      OK (default value) and Cancel

    • Width

      400 (choose a value that suits your page layout)

  5. Add the form component created in step 1 to the dialog box.

Dialog Boxes to Add Link Attachments

The following numbered list describes how to add a dialog box to the page so that attachments of type link can be added.

  1. Create a new configuration for the form component FPM_FORM_UIBB_GL2 by copying the template USMD_SF_CARR_ATT_LINK from package MDG_FND_SAMPLE_IMPLEMENTATIONS.

  2. In the configuration of the form component enter the following values for the parameters of the feeder class CL_USMD_ENTITY_ATT_LINK:

    • Component

      Enter ZSP<data_model>. This is the genIL component for single-object processing that was created for your MDG data model, with <data_model> being the ID of your MDG data model.

    • Object Name:

      Enter AtthEntity Type in this field. Replace Entity Type with the name of the entity type for which you want to configure attachments. Atth stands for attachment header.

    • Editable

      Select the Edit checkbox.

  3. Add a dialog box to the FPM OVP on which the entity attachments should be displayed with page ID USMD_ENTITY_ATT_LINK and description Add Link.

  4. For the attributes of the dialog box, enter the following values: Button Sets: OK and Cancel (OK is default button) Width: 400 (choose a value that suits your page layout)

    • Button Sets

      OK (default value) and Cancel

    • Width

      400 (choose a value that suits your page layout)

  5. Add the form component created in step 1 to the dialog box.