Creating 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
.
You have completed the following:
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.
There is an entity type with the indicator Attachments
selected.
You have generated the required structures in the Customizing activity Generate Data Model-Specific Structures
under .
You have set the standard data model in your user profile.
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.
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.
Attachment List
The following numbered list describes how to add the attachment list to the UI.
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
.
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 Atth
Entity 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.
Add the list component to the FPM OVP on which the entity attachments should be displayed.
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
.
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 |
|
Delete | ~Icon/Delete | Delete Attachment |
|
File | ~Icon/AddFile | Add File |
|
Link | ~Icon/AddLink | Add Link |
|
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.
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
.
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 Attc
Entity 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.
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
.
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)
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.
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
.
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 Atth
Entity 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.
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
.
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)
Add the form component created in step 1 to the dialog box.