14.01.2020 Views

ABAP_to_the_Future

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

12

Web Dynpro ABAP and Floorplan Manager

You don’t have to code the firing method (FIRE_OP_TO_DIS_MONSTER_PLG) yourself

(the framework takes care of it), but you do have to code the method in the target

view that responds to the inbound plug. In V_DISPLAY_MONSTER, note that a

method ( HANDLEIP_FROM_HEADER_TABLE) was generated when you created the

inbound plug; you now have to fill that method.

The code for this is shown in Listing 12.4, where (as will come as no surprise by

now) you’ll start by looking for nodes an d elements. This time, you’ll find the

header record, which you’ll then fill up with the structure that was passed as a

parameter into this method. The second half of the listing is all about getting the

node where the ALV grid for the item tabl e lives, asking the controller for the

item data, and filling up that grid.

METHOD handleip_from_header_table .

* Get the node where the header record lives

DATA lo_node_monster_header TYPE REF TO if_wd_context_node.

lo_node_monster_header =

wd_context->get_child_node( name = wd_this->wdctx_monster_header ).

CHECK lo_node_monster_header IS NOT INITIAL.

* Get the element that lives in that node

DATA lo_element_monster_header TYPE REF TO if_wd_context_element.

lo_element_monster_header =

lo_node_monster_header->get_element( ).

CHECK lo_element_monster_header IS NOT INITIAL.

* Fill a structure with the values that were passed in

DATA ls_monster_header TYPE wd_this->element_monster_header.

ls_monster_header = is_monster_header.

* Pass those values into the node element

lo_element_monster_header->set_static_attributes(

static_attributes = ls_monster_header ).

* You’re done with the header record. Time for the items

* Get the node you want to fill

DATA lo_node_monster_item_table TYPE REF TO if_wd_context_node.

lo_node_monster_item_table =

wd_context->get_child_node( name = wd_this->wdctx_monster_item_table ).

544

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

Saved successfully!

Ooh no, something went wrong!