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.

12

Web Dynpro ABAP and Floorplan Manager

view’s job description. (If it tried to handle the response itself, then it would find

itself surrounded by a picket line of angry members of the controllers union

accusing it of trying to put honest, hardworking controllers out of a job.)

Defining the View for the List of Monsters

Now turn to the V_HEADER_GRID view, which is the view on which users will find

themselves when your application starts (the default view). You want two things

on this screen: the selection options and the ALV grid with the results. (In normal

ALV reports, the selection criteria are on a different screen, but users love having

the selection fields at the top of the result list to remind them what they were

actually searching for.)

Navigate to the V_HEADER_GRID view, and click the Layout tab. Your cursor is on

the ROOTUIELEMENTCONTAINER once again; right-click, and create two elements,

one after the other. This time, they will both be of the type ViewContainerUIElement,

which means that other UI elements will be living inside them. Name them

with the element type at the start, followed by what the container is going to contain

(i.e., VCUIE_SELECT_OPTIONS and VCUIE_MONSTER_HEADER_TABLE).

Note

In WDA, there are lots of options for how the system will automatically arrange the various

elements on the screen. There is not spac e in this book to go into all the various

options and what they mean, but they are all documented in great detail throughout

the Internet. For example, visit http://sapuniversity.eu/usage-and-significance-of-various-layouts-in-webdynpro-abap.

Here on the V_HEADER_GRID screen, you’re going to have the selections at the top

with the Select Monster button just to the right of the selection options, and the

grid showing the selected monster header records directly under those selection

fields. To achieve this, select the ROOTUIELEMENTCONTAINER node on the Layout

tab, and change the layout property to MatrixLayout. Then, go to the monster

table node and change the layout to MatrixHeadData (if you don’t do this, then

the grid appears to the right of the selections). If the field to change the layout of

the monster header table layout data is not there, click the Save button, and it will

magically appear.

While you’re here, you’re also going to add a button to display the monster

record that is currently highlighted in the ALV grid of monster headers. The

526

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

Saved successfully!

Ooh no, something went wrong!