14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Building the WDA Application 12.2

procedure for creating the button is exactly the same as before; right click on the

ROOTUIELEMENTCONTAINER node, choose Create Element 폷 Button and call it

SHOW_MONSTER. Once the element is created you can change the attributes to create

the corresponding action and add a text description and an icon. (This example

uses the Deceased Patient icon, as it has a gravestone on it. This seems appropriate

for a monster.) The layout data pr operty button for the button has to be

changed to MatrixHeadData as well. The result is shown in Figure 12.13.

Figure 12.13 V_HEADER_GRID View to Show Table of Monster Headers

Then, move to the Context tab of the V_HEADER _GRID view. Just as you did earlier,

map the data structures in the controller to the ones in your view; this time,

you will be mapping both the monster he ader table as well as the selection

options. That is, you drag both those nodes from the right-hand side of the screen

to the left-hand side. You will get a confirmation prompt when you drag the table

definition over to the view part of the context to ask if you actually do want to

map the data from one node to the other. Once the nodes are mapped, if you click

on a target node (on the left-hand side), you will see a field called Mapping Path

at the bottom of the screen; this says where the source data is coming from.

Defining the View for the Selected Monster

There is a final view, V_DISPLAY_MONSTER, in which you’ll see the header record of

the selected monster and, below it, an ALV grid showing a table of that monster’s

items (components). The process for defining the context and view is exactly the

same as before. Select the ZWDA_MONSTER_MONITOR root node and choose Create 폷

View. This view will be called V_DISPLAY_MONSTER.

Now go to the Layout view and create two ViewContainerUIElements; call them

VCUIE_MONSTER_HEADER and VCUIE_MONSTER_ITEM_TABLE. This time, you can keep

the default flow layout that the syste m proposes—this means that the header

fields of the selected monster will be di splayed one per line, with the item table

at the bottom after the list of fields.

527

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!