Вы находитесь на странице: 1из 179

WebDynpro for ABAP

1 ............................................................................................. 3
1.................................................................................................... 5
2 ............................................................................................. 9
2.................................................................................................. 11
3 ........................................................................................... 17
3.................................................................................................. 18
4 ........................................................................................... 25
4.................................................................................................. 27
5 ........................................................................................... 32
5.................................................................................................. 34
6 ........................................................................................... 43
6.................................................................................................. 44
7 ........................................................................................... 46
7.................................................................................................. 48
8 ........................................................................................... 52
8.................................................................................................. 54
9 ........................................................................................... 56
9.................................................................................................. 58
10 ......................................................................................... 63
10................................................................................................ 64
11 ......................................................................................... 66
11................................................................................................ 68
12 ......................................................................................... 75
12................................................................................................ 78
13 ......................................................................................... 87
13................................................................................................ 89
14 ......................................................................................... 94
14................................................................................................ 96
1

WebDynpro for ABAP


15 ....................................................................................... 100
15.............................................................................................. 102
16 ....................................................................................... 106
16.............................................................................................. 109
17 ....................................................................................... 116
17.............................................................................................. 118
18 ....................................................................................... 122
18.............................................................................................. 124
19 ....................................................................................... 128
19.............................................................................................. 130
20 ....................................................................................... 134
20.............................................................................................. 137
21 ....................................................................................... 143
21.............................................................................................. 144
22 ....................................................................................... 149
22.............................................................................................. 151
23 ....................................................................................... 153
23.............................................................................................. 155
24 ....................................................................................... 158
24.............................................................................................. 160
25 ....................................................................................... 164
25.............................................................................................. 166
26 ....................................................................................... 170
26.............................................................................................. 172

WebDynpro for ABAP

WebDynpro ,


WebDynpro WebDynpro

, Hello World

ZNET_HELLO_00

1

1. ZNET_##. BC
HOME.

2
WebDynpro
1. WebDynpro ZNET_HELLO_## W_MAIN,
V_MAIN

3
Hello World
1. V_MAIN TEXTVIEW
TXT_HELLO.
2. text .

4
WebDynpro WebDynpro

WebDynpro for ABAP


1. WebDynpro
2. WebDynpro ZNET_HELLO_##,
W_MAIN ZNET_HELLO_##
3. WebDynpro
4. .

WebDynpro for ABAP

1
1

1. ZNET_##. BC
HOME.
a. SE80,

2
WebDynpro
1. WebDynpro ZNET_HELLO_## W_MAIN,
V_MAIN
a. .
->
- -> -
b. ,
. Ok

c. .
d. ,

e. .
->

WebDynpro for ABAP

f.

g. W_MAIN. Window.
W_MAIN.
Embeded View.
h. View to Be Embedded

i.

Ok

3
Hello World
1. V_MAIN TEXTVIEW
TXT_HELLO.
a. V_MAIN Layout
b. ROOTUIELEMENTCONTAINER.
Insert Element.
c. TextView

WebDynpro for ABAP


d. Ok

WebDynpro for ABAP

2. text .

a. TXT_HELLO
b. text Hello world
c. Enter ,

4
WebDynpro WebDynpro
1. WebDynpro
a. .
.
2. WebDynpro ZNET_HELLO_##,
W_MAIN ZNET_HELLO_##
a. . >. -.
b.

3. WebDynpro
a.
4. .
a. . ,
. ,
Web-.

WebDynpro for ABAP

,
.

ZNET_HELLO_00

1
WebDynpro , .
1. WebDynpro ZNET_NAVI_## W_MAIN.
2. V_START V_END.
3. W_MAIN.

2
inbound outbound plug.
plug
1. V_START inbound plug (IN_START) outbound
plug (OUT_NEXT).
2. V_END inbound plug (IN_END) outbound plug
(OUT_PREV).
3. outbound plug (OUT_NEXT) V_START
inbound plug (IN_END) V_END.
4. outbound plug (OUT_PREV) V_END
inbound plug (IN_START) V_START.

3
, action
outbound plug

WebDynpro for ABAP


1. BUTTON BTN_NEXT
V_START
2. action DO_NEXT, .
action outbound
plug.
3. BUTTON BTN_PREV
V_END
4. action DO_PREV .
action outbound
plug.

4
WebDynpro . WebDynpro
WebDynpro
1. WebDynpro
2. WebDynpro ZNET_NAVI_##,
W_MAIN ZNET_NAVI_##,
.

10

WebDynpro for ABAP

2
1
WebDynpro , .
1. WebDynpro ZNET_NAVI_## W_MAIN.
a. ,
2. V_START V_END.
a.
V_START V_END.
3. W_MAIN.
a. Window W_MAIN
b. W_MAIN
V_START, W_END.

2
inbound outbound plug.
plug
1. V_START inbound plug (IN_START) outbound
plug (OUT_NEXT).
a. V_START Inbound plugs
b. inbound plug IN_START

11

WebDynpro for ABAP

c. Outbound plugs outbound plug


OUT_NEXT

2. V_END inbound plug (IN_END) outbound plug


(OUT_PREV).
a. V_END
3. outbound plug (OUT_NEXT) V_START
inbound plug (IN_END) V_END.
a. W_MAIN

b. outbound plug (OUT_NEXT) V_START inbound


plug (IN_END) V_END .

12

WebDynpro for ABAP

c. Window

4. outbound plug (OUT_PREV) V_END


inbound plug (IN_START) V_START.
a. ,

3
, action
outbound plug

1. BUTTON BTN_NEXT
V_START
a. V_START.
b.
ROOTUIELEMENTCONTAINER Insert Element

13

WebDynpro for ABAP

c. BTN_NEXT BUTTON

d. .
text
2. action DO_NEXT, .
action outbound
plug.
a. BTN_NEXT
b. OnAction Binding

c.
outbound plug

14

WebDynpro for ABAP

d. Actions V_START
.

e.
outbound plug

f.

outbound plug,
Edit -> Web Dynpro Code Wizard. Start
Navigation outbound plug .

15

WebDynpro for ABAP

3. BUTTON BTN_PREV
V_END
a. V_END
4. action DO_PREV .
action outbound
plug.
a. V_END

4
WebDynpro . WebDynpro
WebDynpro
1. WebDynpro
2. WebDynpro ZNET_NAVI_##,
W_MAIN ZNET_NAVI_##,
.
a.

16

WebDynpro for ABAP

ZNET_CONTEXT_00

1

1. ZNET_NAVI_##
ZNET_NAVI_00
2. ZNET_CONTEXT_##.

2
,
.
, .
1. FLIGHT_INFO,
SFLIGHT 1:1.
CARRID CONNID
2.
FLIGHT_INFO, .

3

FLIGHT_INFO, .
.

17

WebDynpro for ABAP


1. V_START
CARRID CONNID.
.
2. .
3. 1-2 V_END
4. WebDynpro , WebDynpro
.

3
1

1. ZNET_NAVI_##
ZNET_NAVI_00
a.
2. ZNET_CONTEXT_##.

2
,
.
, .
1. FLIGHT_INFO,
SFLIGHT 1:1.
CARRID CONNID
a.
Context
b. Create
Node.
c. FLIGHT_INFO,
SFLIGHT

18

WebDynpro for ABAP

19

WebDynpro for ABAP

d. Add Attributes from Structure.


CARRID CONNID. Ok.

e.

2.
FLIGHT_INFO, .
a. V_START.
Context.

20

WebDynpro for ABAP

b. FLIGHT_MODE
. .

c.

d. V_END

3

FLIGHT_INFO, .
.
1. V_START
CARRID CONNID.
.
a. V_START.
Layout. ROOTUIELEMENTCONTAINER.

21

WebDynpro for ABAP

b. .
Edit Web Dynpro Code Wizard.
(Form)

c. FLIGHT_INFO.
Ok

22

WebDynpro for ABAP

2. .
a. CAPTION,
GROUP. Text

23

WebDynpro for ABAP

3. 1-2 V_END
a. 1-2 V_END
b. readOnly
4. WebDynpro , WebDynpro
.
a. WebDynpro , WebDynpro
.

24

WebDynpro for ABAP



MIME

ZNET_GUI_SIMPLE_00

1

1. ZNET_CONTEXT_##
ZNET_CONTEXT_00
2. ZNET_ GUI_SIMPLE _##.

2
IMAGE V_START. IMAGE
demo.gif MIME SAP BC WebDynpro SAP
PUBLIC ZNET .
1. IMAGE V_START ( - IMG_DEMO).
. demo.gif
MIME SAP BC WebDynpro SAP PUBLIC ZNET

3
V_START .
.
. . ,
, .
1. ROOTUIELEMENTCONTEANER Matrix Layout.
2. ,

25

WebDynpro for ABAP


3. . -

4. , 100% .

5. , .

6. , ,
.

4
V_END .
100% . -.
1. ROOTUIELEMENTCONTEANER Matrix Layout
2. . -

3. , 100% .

5
WebDynpro , WebDynpro
.
1. WebDynpro , WebDynpro

26

WebDynpro for ABAP

4
1

1. ZNET_CONTEXT_##
ZNET_CONTEXT_00
a.
2. ZNET_ GUI_SIMPLE _##.

2
IMAGE V_START. IMAGE
demo.gif MIME SAP BC WebDynpro SAP
PUBLIC ZNET .
1. IMAGE V_START ( - IMG_DEMO).
. demo.gif
MIME SAP BC WebDynpro SAP PUBLIC ZNET
a. V_START.
Layout
b. ROOTUIELEMENTCONTAINER
Insert Element
c. Image IMG_DEMO

d. source.

27

WebDynpro for ABAP

e. MIME. demo.gif SAP BC


WebDynpro SAP PUBLIC ZNET

f.

source . ,
,

28

WebDynpro for ABAP

3
V_START .
.
. . ,
, .
1. ROOTUIELEMENTCONTEANER Matrix Layout.
a. ROOTUIELEMENTCONTEANER
b. Layout Matrix Layout
2. ,

a. LayoutData = MatrixHeadData,
MatrixData
b. vAlign = top
3. . -

a. cellBackgroundDesign = fill1
4. , 100% .

a. ROOTUIELEMENTCONTEANER
width = 100%. stretchHorizontally
b. LayoutData(Matrix Layout)
width = 1px.
.

29

WebDynpro for ABAP

c. width = 100%
5. , .

a. LayoutData(Matrix Layout)
height = 1px.

b. width = 100%
6. , ,
.
a. stretchVorizontally stretchVertically

30

WebDynpro for ABAP


b.
LayoutData = MatrixHeadData

4
V_END .
100% . -.
1. ROOTUIELEMENTCONTEANER Matrix Layout
a. Layout
ROOTUIELEMENTCONTEANER = Matrix Layout
b. LayoutData = MatrixHeadData
2. . -

a. cellBackgroundDesign = fill1
3. , 100% .
a. ROOTUIELEMENTCONTEANER
width = 100%. stretchHorizontally
b. width = 100%.
LayoutData(Matrix Layout) width = 100%.
stretchHorizontally
c.
LayoutData = MatrixHeadData

5
WebDynpro , WebDynpro
.
1. WebDynpro , WebDynpro

a.

31

WebDynpro for ABAP


Table

ZNET_GUI_TABLE_00

1
WebDynpro
1. ZNET_GUI_TABLE _## V_DISPLAY,
W_MAIN

2

BAPI_FLIGHT_GETLIST. .
1.
BAPI_FLIGHT_GETLIST
Adapt Context Context
(EXECUTE_
BAPI_FLIGHT_GETLIST)

3
BAPI_FLIGHT_GETLIST
.
1. BAPI_FLIGHT_GETLIST
.

32

WebDynpro for ABAP


4
.
50% .
.
1. ,
2. ,

3. .

5
,
. 10 .
.
1. , FLIGHT_LIST ,
ISO
2.

6
.
.
1.
2.
3.
4.



. DO_READ_FLIGHTS
.

7
WebDynpro , WebDynpro
.
1. WebDynpro , WebDynpro

33

WebDynpro for ABAP

5
1
WebDynpro
1. ZNET_GUI_TABLE _## V_DISPLAY,
W_MAIN
a.

2

BAPI_FLIGHT_GETLIST. .
1.
BAPI_FLIGHT_GETLIST
Adapt Context Context
(EXECUTE_
BAPI_FLIGHT_GETLIST)
a.

b.

34

WebDynpro for ABAP

c.

d.
e. Context

35

WebDynpro for ABAP

f.

36

WebDynpro for ABAP

g.

h.

3
BAPI_FLIGHT_GETLIST
.
1. BAPI_FLIGHT_GETLIST
.
a.

37

WebDynpro for ABAP


4
.
50% .
.
1. ,
a. .
DESTINATION_FROM.

2. ,

a. .
DESTINATION_TO.

38

WebDynpro for ABAP

3. .
a. ROOTUIELEMENTCONTEANER
Layout Matrix Layout, width = 100%.
stretchHorizontally
b. LayoutData = MatrixHeadData,
width = 100% LayoutData(Matrix Layout) width = 50%
c. LayoutData = MatrixData,
width = 100% LayoutData(Matrix Layout) width = 50%
d. LayoutData =
MatrixHeadData

5
,
. 10 .
.
1. , FLIGHT_LIST ,
ISO
a.
b.

39

WebDynpro for ABAP


c. FLIGHT_LIST
d. binding ISO

e. Ok
2.
a. LayoutData = MatrixHeadData,
width = 100%, colSpan = 2
b. selectionMode = none
c. 10 visibleRowCount = 10

6
.
.
1.
a. ROOTUIELEMENTCONTEANER

b. Button BTN_SELECT
2.
a.
3. . DO_READ_FLIGHTS
a. LayoutData = MatrixHeadData
b. text =
c. Event DO_READ_FLIGHTS
onAction
4. .
a. Actions.

40

WebDynpro for ABAP

b. WebDynpro Code Wizard (Edit - WebDynpro Code Wizard ).


c. ,

41

WebDynpro for ABAP

7
WebDynpro , WebDynpro
.
1. WebDynpro , WebDynpro

a.

42

WebDynpro for ABAP

ZNET_DEV_CONTEXT_00

1

1. ZNET_GUI_SIMPLE_##
ZNET_GUI_SIMPLE _00
2. ZNET_ DEV_CONTEXT_##.
3. Web Dynpro

2
AA V_START.
1. WDONINIT V_START. AA
FLIGHT_INFO.CARRID
2. .

3
.
LH, 0400.
1. .
2. LS_FLIGHT_INFO

43

WebDynpro for ABAP

6
1

1. ZNET_GUI_SIMPLE_##
ZNET_GUI_SIMPLE _00
a.
2. ZNET_ DEV_CONTEXT_##.
a.
3. Web Dynpro
a.

2
AA V_START.
1. WDONINIT V_START. AA
FLIGHT_INFO.CARRID
a.
method WDDOINIT .
DATA:
lo_nd_flight_info
lo_el_flight_info

TYPE REF TO if_wd_context_node,


TYPE REF TO if_wd_context_element.

navigate from <CONTEXT> to <FLIGHT_INFO> via lead selection


lo_nd_flight_info = wd_context->get_child_node( name = wd_this>wdctx_flight_info ).
*

get element via lead selection


lo_el_flight_info = lo_nd_flight_info->get_element(

).

get single attribute


lo_el_flight_info->set_attribute(
EXPORTING
name = `CARRID`
value = 'AA' ).

endmethod.

2. .
a.

44

WebDynpro for ABAP


3
.
LH, 0400.
1. .
2. LS_FLIGHT_INFO

a.
METHOD wddoinit .
DATA:
lo_nd_flight_info
lo_el_flight_info
ls_flight_info

TYPE REF TO if_wd_context_node,


TYPE REF TO if_wd_context_element,
TYPE wd_this->element_flight_info.

navigate from <CONTEXT> to <FLIGHT_INFO> via lead selection


lo_nd_flight_info = wd_context->get_child_node( name = wd_this>wdctx_flight_info ).
*

get element via lead selection


lo_el_flight_info = lo_nd_flight_info->get_element(
ls_flight_info-carrid = 'LH'.
ls_flight_info-connid = '0400'.

get single attribute


lo_el_flight_info->set_static_attributes(
static_attributes = ls_flight_info ).

ENDMETHOD.

45

).

WebDynpro for ABAP

ZNET_DEV_TABLE_00

1

1. ZNET_ DEV_CONTEXT_##
ZNET_ DEV_CONTEXT_00
2. ZNET_ DEV_TABLE_##.
3. Web Dynpro

2

SFLIGHT. V_END .
1. FLIGHTTAB,
SFLIGHT. 0..n.
CARRID, CONNID, FLDATE, PLANETYPE, SEATSMAX
SEATSOCC.
2. FLIGHTTAB V_END
..

3
V_END FLIGHTTAB .
1.
V_END.

46

WebDynpro for ABAP


4
.
ZCL_NET_MODEL=>READ_FLIGHTS() .
FLIGHTTAB
1.
(FILL_FLIGHT_TAB).
2. FLIGHT_INFO
3. LT_FLIGHT. ,
ZCL_NET_MODEL=>READ_FLIGHTS()
4. FLIGHTTAB

5
V_END
.
1. FILL_FLIGHT_TAB HANDLEIN_END
V_END.

47

WebDynpro for ABAP

7
1

1. ZNET_ DEV_CONTEXT_##
ZNET_ DEV_CONTEXT_00
a.
2. ZNET_ DEV_TABLE_##.
3. Web Dynpro
a.

2

SFLIGHT. V_END .
1. FLIGHTTAB,
SFLIGHT. 0..n.
CARRID, CONNID, FLDATE, PLANETYPE, SEATSMAX
SEATSOCC.
a.
2. FLIGHTTAB V_END
..
a.

3
V_END FLIGHTTAB .
1.
V_END.
a.
b. LayoutData = MatrixHeadData, width
= 100%

4
.
ZCL_NET_MODEL=>READ_FLIGHTS() .
FLIGHTTAB
1.
(FILL_FLIGHT_TAB).

48

WebDynpro for ABAP


a. Methods,
2. FLIGHT_INFO
a. Web Dynpro Code Wizard

b.
3. LT_FLIGHT. ,
ZCL_NET_MODEL=>READ_FLIGHTS()
a.
4. FLIGHTTAB
a.
METHOD fill_flight_tab .
DATA:
lo_nd_flight_info
TYPE REF TO if_wd_context_node,
lo_el_flight_info
TYPE REF TO if_wd_context_element,
ls_flight_info
TYPE wd_this->element_flight_info ,
lt_flight
TYPE flighttab,
lo_nd_flight_tab
TYPE REF TO if_wd_context_node.
*
navigate from <CONTEXT> to <FLIGHT_INFO> via lead selection
lo_nd_flight_info = wd_context->get_child_node( name = wd_this>wdctx_flight_info ).
*

get element via lead selection


lo_el_flight_info = lo_nd_flight_info->get_element(

).

get all declared attributes


lo_el_flight_info->get_static_attributes(
IMPORTING
static_attributes = ls_flight_info ).
CALL METHOD zcl_net_model=>read_flights
EXPORTING
i_carrid = ls_flight_info-carrid
i_connid = ls_flight_info-connid
RECEIVING
result
= lt_flight.

navigate from <CONTEXT> to <FLIGHTTAB> via lead selection


lo_nd_flight_tab = wd_context->get_child_node( name = wd_this>wdctx_flighttab ).
lo_nd_flight_tab->bind_table(
new_items = lt_flight
set_initial_elements = abap_true ).
ENDMETHOD.

49

WebDynpro for ABAP


5
V_END
.
1. FILL_FLIGHT_TAB HANDLEIN_END
V_END.
a. Web Dynpro Code Wizard

b.
method HANDLEIN_END .
wd_comp_controller->fill_flight_tab(
).
endmethod.

50

WebDynpro for ABAP

51

WebDynpro for ABAP

supply function

, ,
.
.

ZNET_DEV_SUPPLY_00

1

1. ZNET_ DEV_TABLE_##
ZNET_ DEV_TABLE_00
2. ZNET_ DEV_SUPPLY_##.
3. Web Dynpro

2
FLIGHTTA
SBOOK.
FLIGHTTA V_END.
1. BOKKINGTAB
FLIGHTTAB. SBOOK.
0..n. BOOKID, CUSTOMID,
CUSTTYPE, LUGGWEIGHT, WUNIT, CLASS PASSNAME.
2. FLIGHTTA V_END.

3
.
1.
V_END BOOKINGTAB.

52

WebDynpro for ABAP


4
supply function BOOKINGTAB
FLIGHTAB
1. supply function
BOOKINGS_READ BOOKINGTAB
2. supply function
3. . NODE
BOOKINGTAB, PARENT_ELEMENT
FLIGHTTAB. .
. NODE.
4.
ZCL_NET_MODEL=>READ_BOOKINGS()

53

WebDynpro for ABAP

8
1

1. ZNET_ DEV_TABLE_##
ZNET_ DEV_TABLE_00
a.
2. ZNET_ DEV_SUPPLY_##.
3. Web Dynpro
a.

2
FLIGHTTA
SBOOK.
FLIGHTTA V_END.
1. BOKKINGTAB
FLIGHTTAB. SBOOK.
0..n. BOOKID, CUSTOMID,
CUSTTYPE, LUGGWEIGHT, WUNIT, CLASS PASSNAME.
a.
2. FLIGHTTA V_END.
a. V_END
b. FLIGHTINFO
Update Mapping
c.

3
.
1.
V_END BOOKINGTAB.
a.
b. LayoutData = MatrixHeadData width = 100%

4
supply function BOOKINGTAB
FLIGHTAB

54

WebDynpro for ABAP


1. supply function
BOOKINGS_READ BOOKINGTAB
a. Supply function BOOKINGTAB
BOOKINGS_READ

2. supply function
3. . NODE
BOOKINGTAB, PARENT_ELEMENT
FLIGHTTAB. .
. NODE.
a. .
4.
ZCL_NET_MODEL=>READ_BOOKINGS()
a. .
METHOD bookings_read .
DATA lv_flight TYPE wd_this->element_flighttab.
DATA lt_booking TYPE wd_this->elements_bookingtab.
parent_element->get_static_attributes(
IMPORTING
static_attributes = lv_flight ).
lt_booking =
i_carrid
i_connid
i_fldate
).

zcl_net_model=>read_bookings(
= lv_flight-carrid
= lv_flight-connid
= lv_flight-fldate

node->bind_table(
new_items = lt_booking
set_initial_elements = abap_true ).
ENDMETHOD.

55

WebDynpro for ABAP

ZNET_MESSAGE_00

1

1. ZNET_ DEV_ SUPPLY _##
ZNET_ DEV_ SUPPLY _00
2. ZNET_ MESSAGE_##.
3. Web Dynpro

2
V_START ,
, ,
.
1. V_START CHECK_INPUT
, ,.
2. WDDOBEFOREACTION..

3
V_START
. .
1. V_START MR_MESSAGE_MANADGER
IF_WD_MESSAGE_MANAGER .
2. WDDOINIT V_START

56

WebDynpro for ABAP


4
CHECK_INPUT.
ZNET_##
1. ZNET_##
2.
3. V_START
, .
,
.
,
ZCL_NET_MODEL=>CHECK_CONNECTION
.

57

WebDynpro for ABAP

9
1

1. ZNET_ DEV_SUPPLY_##
ZNET_ DEV_ SUPPLY _00
a.
2. ZNET_ MESSAGE_##.
3. Web Dynpro
a.

2
V_START ,
, ,
.
1. V_START CHECK_INPUT
, ,
a.
2. WDDOBEFOREACTION.
a.
method WDDOBEFOREACTION .
wd_this->check_input(
).
endmethod.

3
V_START
. .
1. V_START MR_MESSAGE_MANADGER
IF_WD_MESSAGE_MANAGER .
a. Attributes

58

WebDynpro for ABAP

59

WebDynpro for ABAP


2. WDDOINIT V_START

a.
METHOD wddoinit .
DATA:
lo_nd_flight_info
lo_el_flight_info
ls_flight_info
DATA: l_current_controller

TYPE
TYPE
TYPE
TYPE

REF TO if_wd_context_node,
REF TO if_wd_context_element,
wd_this->element_flight_info.
REF TO if_wd_controller.

navigate from <CONTEXT> to <FLIGHT_INFO> via lead selection


lo_nd_flight_info = wd_context->get_child_node( name = wd_this>wdctx_flight_info ).
*

get element via lead selection


lo_el_flight_info = lo_nd_flight_info->get_element(

).

ls_flight_info-carrid = 'LH'.
ls_flight_info-connid = '0400'.
*

get single attribute


lo_el_flight_info->set_static_attributes(
static_attributes = ls_flight_info ).

get message manager


l_current_controller ?= wd_this->wd_get_api( ).
wd_this->mr_message_manager = l_current_controller->get_message_manager( ).

ENDMETHOD.

4
CHECK_INPUT.
ZNET_##
1. ZNET_##
a.
2.
a.
b.

60

WebDynpro for ABAP

3. V_START
, .
,
.
,
ZCL_NET_MODEL=>CHECK_CONNECTION
.
a.
METHOD check_input .
DATA:
lo_nd_flight_info
lo_el_flight_info
ls_flight_info
DATA lv_message
DATA lv_ret

TYPE
TYPE
TYPE
TYPE
TYPE

REF TO if_wd_context_node,
REF TO if_wd_context_element,
wd_this->element_flight_info.
symsg.
boolean.

navigate from <CONTEXT> to <FLIGHT_INFO> via lead selection


lo_nd_flight_info = wd_context->get_child_node( name = wd_this>wdctx_flight_info ).
*

get element via lead selection


lo_el_flight_info = lo_nd_flight_info->get_element(

).

get all declared attributes


lo_el_flight_info->get_static_attributes(
IMPORTING
static_attributes = ls_flight_info ).
IF ls_flight_info-carrid IS INITIAL
AND ls_flight_info-connid IS INITIAL.

CALL METHOD wd_this->mr_message_manager->report_t100_message


EXPORTING
msgid
= 'ZNET_00'
msgno
= '001'
msgty
= 'E'
cancel_navigation = 'X'.
ELSEIF ls_flight_info-carrid IS INITIAL.
CLEAR lv_message.
lv_message-msgid = 'ZNET_00'.
lv_message-msgno = '002'.
lv_message-msgty = 'E'.
lv_message-msgv1 = 'CARRID'.
*
report message
CALL METHOD wd_this->mr_message_manager->report_attribute_t100_message
EXPORTING
msg
= lv_message
element
= lo_el_flight_info
attribute_name = 'CARRID'.
ELSEIF ls_flight_info-connid IS INITIAL.
CLEAR lv_message.
lv_message-msgid = 'ZNET_00'.
lv_message-msgno = '002'.
lv_message-msgty = 'E'.
lv_message-msgv1 = 'CONNID'.
*
report message
CALL METHOD wd_this->mr_message_manager->report_attribute_t100_message

61

WebDynpro for ABAP


EXPORTING
msg
= lv_message
element
= lo_el_flight_info
attribute_name = 'CARRID'.
ELSE.
lv_ret = zcl_net_model=>check_flight(
i_carrid = ls_flight_info-carrid
i_connid = ls_flight_info-connid ).
IF lv_ret = abap_false.
clear lv_message.
lv_message-msgv1 = ls_flight_info-carrid.
lv_message-msgv2 = ls_flight_info-connid.
CALL METHOD wd_this->mr_message_manager->report_t100_message
EXPORTING
msgid
= 'ZNET_00'
msgno
= '003'
msgty
= 'E'
p1
= lv_message-msgv1
p2
= lv_message-msgv2
cancel_navigation = 'X'.
ENDIF.
ENDIF.
ENDMETHOD.

62

WebDynpro for ABAP

10

ZNET_VALUE_00

1

1. ZNET_MESSAGE_##
ZNET_ MESSAGE_00
2. ZNET_VALUE_##.
3. Web Dynpro

2
FLIGHT_INFO.CARRID.
1. FILL_CARRID_DDL
2. WDDOINIT.
3. FLIGHT_INFO,
get_node_info()
4. ZCL_NET_MODEL=>GET_CARR_VS

5. TEXT
6. set_attribute_value_set()

3
.
1. .
DROPDOWN_BY_KEY. ,

63

WebDynpro for ABAP

10
1

1. ZNET_MESSAGE_##
ZNET_ MESSAGE_00
a.
2. ZNET_VALUE_##.
3. Web Dynpro
a.

2
FLIGHT_INFO.CARRID.
1. FILL_CARRID_DDL
a.
2. WDDOINIT.
a.
b.
method WDDOINIT .
wd_this->fill_carrid_ddl(
).
endmethod.

3. FLIGHT_INFO,
get_node_info()
a. .
4. ZCL_NET_MODEL=>GET_CARR_VS

a. .
5. TEXT
a. .

64

WebDynpro for ABAP

6. set_attribute_value_set()

a.
METHOD
DATA
DATA
DATA

fill_carrid_ddl .
lo_nd_flight_info
lo_nd_info
lt_value_set

TYPE REF TO if_wd_context_node.


TYPE REF TO if_wd_context_node_info.
TYPE wdr_context_attr_value_list.

navigate from <CONTEXT> to <SCARR> via lead selection


lo_nd_flight_info = wd_context>get_child_node( name = wd_this->wdctx_flight_info ).
lo_nd_info = lo_nd_flight_info->get_node_info( ).
lt_value_set = zcl_net_model=>get_carr_vs( ).
lo_nd_info->set_attribute_value_set(
name = 'CARRID'
value_set = lt_value_set ).
ENDMETHOD.

3
.
1. .
DROPDOWN_BY_KEY. ,

a.
b.
DROPDOWN_BY_KEY
c. FLIGHT_INFO.CARRID
d.
e.

65

WebDynpro for ABAP

11

WebDynpro


,
.

ZNET_COMP1_00, ZNET_COMP2_00

1

1. ZNET_VALUE_##
ZNET_ VALUE_00
2. ZNET_ COMP1_##.
3. Web Dynpro

2
WebDynpro ZNET_COMP2_##.
ZNET_COMP1_##.
1. V_CUST_DATA,
W_MAIN.

3
ZNET_COMP2_##.
.
, .
.
1. SHOWCUSTOMER,
.

66

WebDynpro for ABAP


2. IV_CUST_ID SCUSTOM-ID
3.
SCUSTOM ( CUSTOM_DATA) ID,
NAME, STREET, POSTBOX, POSTCODE, CITY, COUTRY TELEPHONE.
1..1
4. V_CUST_DATA

5.
6. SHOWCUSTOMER.

ZCL_NET_MODEL=>READ_CUSTOMER().

4
ZNET_COMP2_## ZNET_COMP1_##.
.
.
1. ZNET_COMP1_##.
ZNET_COMP2_## (
CUST_COMP_USAGE)
2. .
CUST_COMP_USAGE
3. CUSTOMER_READ.

4. .
. ,
.

5. V_END.
ViewContainerUIElement
6.
7. V_END.
, .
CUSTOMER_READ.

67

WebDynpro for ABAP

11
1

1. ZNET_VALUE_##
ZNET_ VALUE_00
a.
2. ZNET_ COMP1_##.
3. Web Dynpro
a.

2
WebDynpro ZNET_COMP2_##.
ZNET_COMP1_##.
1. V_CUST_DATA,
W_MAIN.
a.

3
ZNET_COMP2_##.
.
, .
.
1. SHOWCUSTOMER,
.
a. Methods
Interface

68

WebDynpro for ABAP

2. IV_CUST_ID SCUSTOM-ID
a.
IV_CUST_ID SCUSTOM-ID

3.
SCUSTOM ( CUSTOM_DATA) ID,
NAME, STREET, POSTBOX, POSTCODE, CITY, COUTRY TELEPHONE.
1..1
a.

4. V_CUST_DATA

a.
5.
a. ROOTUIELEMENTCONTAINER Layout =
Matrix Layot, width = 100% stretchHorizontally
b. ,
c. LayoutData = MatrixHeadData, width =
100%, cellBackgroundDesign = fill1 width (LayoutData
(MatrixHeadData)) = 100%
d. .
LayoutData = MatrixHeadData
e. readOnly

69

WebDynpro for ABAP

6. SHOWCUSTOMER.

ZCL_NET_MODEL=>READ_CUSTOMER().

a.
METHOD showcustomer .
DATA lo_nd_custom_data TYPE REF TO if_wd_context_node.
DATA lv_custom
TYPE wd_this->element_custom_data.
lo_nd_custom_data =
wd_context->get_child_node( name = wd_this->wdctx_custom_data ).
lv_custom = zcl_net_model=>read_customer( i_cust_id = iv_cust_id
lo_nd_custom_data->bind_structure(
new_item = lv_custom
set_initial_elements = abap_true ).
ENDMETHOD.

4
ZNET_COMP2_## ZNET_COMP1_##.
.
.
1. ZNET_COMP1_##.
ZNET_COMP2_## (
CUST_COMP_USAGE)
a.

70

).

WebDynpro for ABAP

2. .
CUST_COMP_USAGE
a. ,

3. CUSTOMER_READ.

a.
4. .
. ,
.

a.
CUSTOMID BOOKINGTAB
b.
CUST_COMP_USAGE

71

WebDynpro for ABAP

c. SHOWCUSTOMER

d.
METHOD customer_read .
DATA:
lo_nd_bookingtab
lo_el_bookingtab
lv_customid
DATA lo_cmp_usage
DATA lo_interfacecontroller

TYPE
TYPE
TYPE
TYPE
TYPE

REF TO if_wd_context_node,
REF TO if_wd_context_element,
wd_this->element_bookingtab-customid.
REF TO if_wd_component_usage.
REF TO ziwci_net_comp2_00 .

lo_nd_bookingtab =
wd_context->path_get_node( path = 'FLIGHTTAB.BOOKINGTAB' ).
*

get element via lead selection


lo_el_bookingtab = lo_nd_bookingtab->get_element(

).

get single attribute


lo_el_bookingtab->get_attribute(
EXPORTING
name = `CUSTOMID`
IMPORTING
value = lv_customid ).
lo_cmp_usage =
wd_this->wd_cpuse_cust_comp_usage( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
lo_interfacecontroller =
wd_this->wd_cpifc_cust_comp_usage( ).
lo_interfacecontroller->showcustomer(
iv_cust_id = lv_customid
).

ENDMETHOD.

5. V_END.
ViewContainerUIElement
a.
6.
a. W_MAIN

72

WebDynpro for ABAP


b. . ,
, Embeded
View.

73

WebDynpro for ABAP

c. W_MAIN
ZNET_COMP2_00

7. V_END.
, .
CUSTOMER_READ.
a. V_END.
b. Actions. SHOW_CUSTOMER
c.
CUSTOMER_READ
method ONACTIONSHOW_CUSTOMER .
wd_comp_controller->customer_read(
).
endmethod.

d. onLeadSelect

e. Inbound Plugs. plug IN_END

CUSTOMER_READ
METHOD handlein_end .
wd_comp_controller->fill_flight_tab(
).
wd_comp_controller->customer_read(
).
ENDMETHOD.

74

WebDynpro for ABAP

12



WebDynpro

,
.

ZNET_CONF_00

1

1. ZNET_COMP1_##
ZNET_ COMP1_00
2. ZNET_CONF_##.
3. Web Dynpro

2
.
,

1. (custom controller)
CONFIG_CTRL
2.
MESSAGE_SETTINGS DISPLAY_MESSAGE
WDY_BOOLEAN.
3. MESSAGE_SETTINGS
.
4.
V_START . .
WDDOINIT

75

WebDynpro for ABAP


V_START WDDOINIT .
CHECK_INPUT, .

5.

FILL_FLIGHT_TAB.
,
. ,
MESSAGE_SETTINGS.DISPLAY_MESSAGE = abap_true.

76

WebDynpro for ABAP

3
.
V_END. .

V_START
V_END

Button
Image
Button

Design
Visible
Design
Design
readOnly

Next
None
Back
Alternating
X

1. c ZNET_CONF_##_COMP1

4

1. ZNET_CONF_##_APPL1.

5

1. ZNET_CONF_##_APPL1
WDCONFIGURATIONID\

77

WebDynpro for ABAP

12
1

1. ZNET_COMP1_##
ZNET_ COMP1_00
a.
2. ZNET_CONF_##.
3. Web Dynpro
a.

2
.
,

1. (custom controller)
CONFIG_CTRL
a. .
Custom-

b.

78

WebDynpro for ABAP

c. .

2.
MESSAGE_SETTINGS DISPLAY_MESSAGE
WDY_BOOLEAN.
a.
3. MESSAGE_SETTINGS
.
a.
.

b. Context

79

WebDynpro for ABAP


4.
V_START . .
WDDOINIT
V_START WDDOINIT .
CHECK_INPUT, .
a.
V_START . .
b. V_START
c.
WDDOINIT V_START WDDOINIT
. WDDOINIT
V_START
method WDDOINIT .
DATA: l_current_controller TYPE REF TO if_wd_controller.
*
get message manager
l_current_controller ?= wd_this->wd_get_api( ).
wd_this->mr_message_manager = l_current_controller>get_message_manager( ).
wd_this->fill_carrid_ddl(
).
endmethod.

d. CHECK_INPUT,
.
METHOD check_input .
DATA:
lo_nd_flight_info
ext_node,
lo_el_flight_info
ext_element,
ls_flight_info
>element_flight_info.
DATA lv_message
DATA lv_ret

TYPE REF TO if_wd_cont


TYPE REF TO if_wd_cont
TYPE wd_thisTYPE symsg.
TYPE boolean.

navigate from <CONTEXT> to <FLIGHT_INFO> via lead selection


lo_nd_flight_info = wd_context>get_child_node( name = wd_this->wdctx_flight_info ).
*

get element via lead selection


lo_el_flight_info = lo_nd_flight_info->get_element(

).

get all declared attributes


lo_el_flight_info->get_static_attributes(
IMPORTING
static_attributes = ls_flight_info ).
IF ls_flight_info-carrid IS INITIAL
AND ls_flight_info-connid IS INITIAL.

CALL METHOD wd_comp_controller->mr_message_manager>report_t100_message


EXPORTING
msgid
= 'ZNET_00'
msgno
= '001'

80

WebDynpro for ABAP


msgty
= 'E'
cancel_navigation = 'X'.
ELSEIF ls_flight_info-carrid IS INITIAL.
CLEAR lv_message.
lv_message-msgid = 'ZNET_00'.
lv_message-msgno = '002'.
lv_message-msgty = 'E'.
lv_message-msgv1 = 'CARRID'.
*
report message
CALL METHOD wd_comp_controller->mr_message_manager>report_attribute_t100_message
EXPORTING
msg
= lv_message
element
= lo_el_flight_info
attribute_name = 'CARRID'.
ELSEIF ls_flight_info-connid IS INITIAL.
CLEAR lv_message.
lv_message-msgid = 'ZNET_00'.
lv_message-msgno = '002'.
lv_message-msgty = 'E'.
lv_message-msgv1 = 'CONNID'.
*
report message
CALL METHOD wd_comp_controller->mr_message_manager>report_attribute_t100_message
EXPORTING
msg
= lv_message
element
= lo_el_flight_info
attribute_name = 'CARRID'.
ELSE.
lv_ret = zcl_net_model=>check_flight(
i_carrid = ls_flight_info-carrid
i_connid = ls_flight_info-connid ).
IF lv_ret = abap_false.
clear lv_message.
lv_message-msgv1 = ls_flight_info-carrid.
lv_message-msgv2 = ls_flight_info-connid.
CALL METHOD wd_comp_controller->mr_message_manager>report_t100_message
EXPORTING
msgid
= 'ZNET_00'
msgno
= '003'
msgty
= 'E'
p1
= lv_message-msgv1
p2
= lv_message-msgv2
cancel_navigation = 'X'.
ENDIF.
ENDIF.
ENDMETHOD.

5. FILL_FLIGHT_TAB. ,
, ,
. ,
MESSAGE_SETTINGS.DISPLAY_MESSAGE = abap_true.
METHOD fill_flight_tab .
DATA:
lo_nd_flight_info
de,
lo_nd_message_settings
de,

81

TYPE REF TO if_wd_context_no


TYPE REF TO if_wd_context_no

WebDynpro for ABAP


lo_el_flight_info
ement,
lo_el_message_settings
ement,
ls_flight_info
>element_flight_info ,
lt_flight
lv_display_message
lo_nd_flight_tab
de.

TYPE REF TO if_wd_context_el


TYPE REF TO if_wd_context_el
TYPE wd_thisTYPE flighttab,
TYPE wdy_boolean,
TYPE REF TO if_wd_context_no

lo_nd_flight_info = wd_context->get_child_node( name = wd_this>wdctx_flight_info ).


lo_nd_message_settings = wd_context>get_child_node( name = wd_this->wdctx_message_settings ).
*

get element via lead selection


lo_el_flight_info = lo_nd_flight_info->get_element( ).
lo_el_message_settings = lo_nd_message_settings->get_element(
get all declared attributes
lo_el_flight_info->get_static_attributes(
IMPORTING
static_attributes = ls_flight_info ).
lo_el_message_settings->get_attribute(
EXPORTING
name
= 'DISPLAY_MESSAGE'
IMPORTING
value = lv_display_message
).

CALL METHOD zcl_net_model=>read_flights


EXPORTING
i_carrid = ls_flight_info-carrid
i_connid = ls_flight_info-connid
RECEIVING
result
= lt_flight.
IF lv_display_message EQ abap_true.
IF lt_flight IS INITIAL.
wd_this->mr_message_manager->report_t100_message(
msgid
= 'ZNET'
msgno
= '004'
msgty
= 'W'
).
ELSE.
wd_this->mr_message_manager->report_t100_message(
msgid
= 'ZNET'
msgno
= '005'
msgty
= 'S'
).
ENDIF.
ENDIF.
*
navigate from <CONTEXT> to <FLIGHTTAB> via lead selection
lo_nd_flight_tab = wd_context->get_child_node( name = wd_this>wdctx_flighttab ).
lo_nd_flight_tab->bind_table(
new_items = lt_flight
set_initial_elements = abap_true ).
ENDMETHOD.

82

).

WebDynpro for ABAP

83

WebDynpro for ABAP

3
.
V_END. .

V_START
V_END

Button
Image
Button

Design
Visible
Design
Design
readOnly

Next
None
Back
Alternating
X

1. c ZNET_CONF_##_COMP1
a.

b. ,
Create

84

WebDynpro for ABAP

c. Explicit Configuration
DISPLAY_MESSAGE X.

d. Web Dynpro Build-In.



e. Save. ,

f. .

85

WebDynpro for ABAP


4

1. ZNET_CONF_##_APPL1.
a.

b. Create
c. Structure
.
d.
e. .

5

1. ZNET_CONF_##_APPL1
WDCONFIGURATIONID\
a. Parameters
b. ZNET_CONF_##_APPL1
WDCONFIGURATIONID

86

WebDynpro for ABAP

13

ZNET_DYN_00

1
.
. .
1. ZNET_DYN_##, W_MAIN.
2. V_INPUT V_OUTPUT. inbound
outbound plug
3. , plug
4. ,
, plug.
5. table_name
tablename DDOBJNAME
6. V_INPUT V_OUTPUT
7. tabname V_INPUT
8. CHECK_USER_INPUT
WDDOBEFOREACTION V_INPUT.
9. ,
.
10.

2
inbound plug V_OUTPUT

1. inbound plug V_OUTPUT
2.
lv_tabname.

87

WebDynpro for ABAP


3.
4. DB_TABLE.
.
5. ADD_NEW_CHILD_MODE()
.
STATIC_ELEMENT_TYPE .
DB_TABLE.
6.
:
DATA lt_tab_data TYPE REF TO data.
FIELD-SYMBOLS: <fs_tab_data> TYPE ANY TABLE.
** Create table in memory
CREATE DATA lt_tab_data TYPE TABLE OF (lv_tabname).
ASSIGN lt_tab_data->* TO <fs_tab_data>.
** Read data from DB
SELECT * FROM (lv_tabname)
INTO TABLE <fs_tab_data>
UP TO 100 ROWS.

7.
8.


,
BIND_TABLE.

3
V_OUTPUT
.
1. WDDOMODIFYVIEW. ,

2. LO_TABLE CL_WD_TABLE.

3. LO_ND_DYN
IF_WD_CONTEXT_NODE.
.
4.
CL_WD_DYNAMIC_TOOL=>CREATE_TABLE_FROM_NODE()

88

WebDynpro for ABAP

13
1
.
. .
1. ZNET_DYN_##, W_MAIN.
a.
2. V_INPUT V_OUTPUT. inbound
outbound plug
a.
3. , plug
a.
4. ,
, plug.
a.
5. table_name
tablename DDOBJNAME
a.
6. V_INPUT V_OUTPUT
a.
7. tabname V_INPUT
a.
8. CHECK_USER_INPUT
WDDOBEFOREACTION V_INPUT.
a. .
*** Check input
wd_this->CHECK_USER_INPUT( ).

9. ,
.
a. .
DATA
DATA
DATA
DATA
DATA
DATA
DATA

lo_nd_table_name TYPE REF TO if_wd_context_node.


lo_el_table_name TYPE REF TO if_wd_context_element.
ls_table_name TYPE wd_this->element_table_name.
lv_tablename LIKE ls_table_name-tablename.
lv_ddic_type
TYPE dd02v-tabclass.
lo_api_controller
TYPE REF TO if_wd_controller.
lo_message_manager
TYPE REF TO if_wd_message_manager.

navigate from <CONTEXT> to <TABLE_NAME> via lead selection


lo_nd_table_name = wd_context>get_child_node( name = wd_this->wdctx_table_name ).
*

get element via lead selection


lo_el_table_name = lo_nd_table_name->get_element(

89

).

WebDynpro for ABAP


*

get single attribute


lo_el_table_name->get_attribute(
EXPORTING
name = `TABLENAME`
IMPORTING
value = lv_tablename ).

***
translate lv_tablename to upper case.
lv_ddic_type = cl_ws_helper=>get_ddobjtype( tabname = lv_tabl
ename ).
IF lv_ddic_type NE 'TRANSP'.
*
get message manager
lo_api_controller ?= wd_this->wd_get_api( ).
lo_message_manager = lo_api_controller>get_message_manager( ).
*

report message
lo_message_manager->raise_fatal_error_message(
message_text = ' '
*
params
= params
*
msg_user_data = msg_user_data
).
EXIT.
ENDIF.

10.
a.

2
inbound plug V_OUTPUT

1. inbound plug V_OUTPUT
2.
lv_tabname.
a.
3.
a. .
4. DB_TABLE.
.
a. .
5. ADD_NEW_CHILD_MODE()
.
STATIC_ELEMENT_TYPE .
DB_TABLE.
a. .
6.
:
DATA lt_tab_data TYPE REF TO data.

90

WebDynpro for ABAP


FIELD-SYMBOLS: <fs_tab_data> TYPE ANY TABLE.
** Create table in memory
CREATE DATA lt_tab_data TYPE TABLE OF (lv_tabname).
ASSIGN lt_tab_data->* TO <fs_tab_data>.
** Read data from DB
SELECT * FROM (lv_tabname)
INTO TABLE <fs_tab_data>
UP TO 100 ROWS.

7.


a. .

8.

,
BIND_TABLE.
a.
DATA lo_nd_table_name
TYPE REF TO if_wd_context_node.
DATA lo_nd_dyn
TYPE REF TO if_wd_context_node.
DATA lo_el_table_name
TYPE REF TO if_wd_context_element.
DATA ls_table_name
TYPE wd_this->element_table_name.
DATA lv_tablename
LIKE ls_table_name-tablename.
DATA lo_nd_root_info
TYPE REF TO if_wd_context_node_info.
DATA lo_nd_table_info
TYPE REF TO if_wd_context_node_info.
DATA lt_child_nodes
TYPE wdr_context_child_info_map.
DATA lv_string
TYPE string.
DATA lt_tab_data
TYPE REF TO data.
FIELD-SYMBOLS: <fs_tab_data> TYPE ANY TABLE.
*

navigate from <CONTEXT> to <TABLE_NAME> via lead selection


lo_nd_table_name = wd_context->get_child_node( name = wd_this>wdctx_table_name ).
*

get element via lead selection


lo_el_table_name = lo_nd_table_name->get_element(

).

get single attribute


lo_el_table_name->get_attribute(
EXPORTING
name = `TABLENAME`
IMPORTING
value = lv_tablename ).

*** Get root metadata


lo_nd_root_info = wd_context->get_node_info( ).
*** remove previous table node
lt_child_nodes = lo_nd_root_info->get_child_nodes( ).
READ TABLE lt_child_nodes
TRANSPORTING NO FIELDS
WITH KEY name = 'DB_TABLE'.
IF sy-subrc EQ 0.
lo_nd_root_info->remove_child_node( 'DB_TABLE' ).
ENDIF.
*** Create new node with attributes
lv_string = lv_tablename.
lo_nd_table_info = lo_nd_root_info->add_new_child_node(

91

WebDynpro for ABAP


static_element_type
name
is_static
).

= lv_string
= 'DB_TABLE'
= ABAP_FALSE

** Create table in memory


CREATE DATA lt_tab_data TYPE TABLE OF (lv_tablename).
ASSIGN lt_tab_data->* TO <fs_tab_data>.
** Read data from DB
SELECT * FROM (lv_tablename)
INTO TABLE <fs_tab_data>
UP TO 100 ROWS.
*** Fill context
lo_nd_dyn = wd_context->get_child_node( name = 'DB_TABLE' ).
lo_nd_dyn->bind_table( new_items = <fs_tab_data> ).

3
V_OUTPUT
.
1. WDDOMODIFYVIEW. ,

a. .
2. LO_TABLE CL_WD_TABLE.

a. .
3. LO_ND_DYN
IF_WD_CONTEXT_NODE.
.
a. .
4.
CL_WD_DYNAMIC_TOOL=>CREATE_TABLE_FROM_NODE()

a.
DATA
DATA
DATA
DATA

lo_ui_root TYPE REF TO if_wd_view_element.


lo_container TYPE REF TO cl_wd_uielement_container.
lo_table TYPE REF TO cl_wd_table.
lo_nd_dyn TYPE REF TO if_wd_context_node.

IF wd_this->gv_invalidate = abap_true.
wd_this->gv_invalidate = abap_false.
*** Get reference to any node
lo_ui_root ?= view->get_element(
id = 'ROOTUIELEMENTCONTAINER' ).
** casting to container
lo_container ?= lo_ui_root.
lo_container->remove_child( id = 'TABLE_ELEMENT' ).

92

WebDynpro for ABAP


lo_nd_dyn = wd_context>get_child_node( name = 'DB_TABLE' ).
lo_table = cl_wd_dynamic_tool=>create_table_from_node(
ui_parent
= lo_container
table_id
= 'TABLE_ELEMENT'
node
= lo_nd_dyn
).
lo_table->set_width( '100%' ).
ENDIF.

93

WebDynpro for ABAP

14

SAP ALV

, SAP ALV

ZNET_SALV_00

1

1. ZNET_CONF_## ZNET_
CONF_00
2. ZNET_SALV_##.
3. Web Dynpro

2
SALV_WD_TABLE .
V_END SALV
1. SALV_WD_TABLE
2. V_END
TABLE SSALV
3. SALV

4. PROCESS_ALV_FLIGHT .
.
FLIGHTTAB. , ,
SALV. SET_DATA() ALV
FLIGHTTAB
5. PROCESS_ALV_FLIGHT
V_END

94

WebDynpro for ABAP


6.
3

1. .

95

WebDynpro for ABAP

14
1

1. ZNET_CONF_## ZNET_
CONF_00
a.
2. ZNET_SALV_##.
3. Web Dynpro
a.

2
SALV_WD_TABLE .
V_END SALV
1. SALV_WD_TABLE
a. Used components
b. SALV_WD_TABLE
ALV_FLIGHTS.

2. V_END
TABLE SALV
a. V_END
b. ViewContainerElement
c. W_MAIN TABLE
SALV

96

WebDynpro for ABAP

97

WebDynpro for ABAP

3. SALV

a. Properties
SALV

4. PROCESS_ALV_FLIGHT .
.
FLIGHTTAB. , ,
SALV. SET_DATA() ALV
FLIGHTTAB
a.
DATA lo_nd_flights TYPE REF TO if_wd_context_node.
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_nd_flights = wd_context->get_child_node( name = wd_this>wdctx_flighttab ).
lo_cmp_usage =
wd_this->wd_cpuse_alv_flights( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.

lo_interfacecontroller =

wd_this->wd_cpifc_alv_flights( ).

lo_interfacecontroller->set_data(
only_if_new_descr =
r_node_data = lo_nd_flights
).

" wdy_boolean

5. PROCESS_ALV_FLIGHT
V_END
a. Inbound plug IN_END
wd_comp_controller->fill_flight_tab(
).
wd_comp_controller->customer_read(
).
wd_comp_controller->process_alv_flight(
).

98

WebDynpro for ABAP


6.
3

1. .
a.

99

WebDynpro for ABAP

15

ZNET_DIALOG_00

1

1. ZNET_ DIALOG_TEMPLATE
2. ZNET_DIALOG_##.
3. Web Dynpro

2
. ,
.
1. BOOKINGS
FLIGHTS. SBOOK.
0..n. BOOKID, CUSTOMID,
CUSTTYPE, LUGGWEIGHT, WUNIT, CLASS PASSNAME.
2. supply function
GET_BOOKINGS BOOKINGS. Singleton.
3. Supply_function.
ZCL_NET_MODEL=>READ_BOOKINGS()

3
, .
.
1. POPUP_VIEW. BOOKINGS

100

WebDynpro for ABAP


2. , .
10
3. POPUP_WINDOW POPUP_VIEW.

4
POPUP_WINDOW .
MAIN_VIEW.
onLeadSelect .
POPUP_WINDOW. ..
, .
1. GO_WINDOW
IF_WD_VINDOW
2. DISP_DETAILS MAIN_VIEW.
onLeadSelect .
3. . ,
.
GO_WINDOW. :
OK.

OK

5
OK.
POPUP_VIEW. OK.
: OK . .. API
POPUP_VIEW , .
WDDOINIT().
1. BUTTON_ACTION POPUP_VIEW
2. REGISTER_BUTTONS() POPUP_VIEW.
3. GO_API_POPUP_VIEW
IF_WD_VIEW_CONTROLLER
4. GO_API_POPUP_VIEW WDDOINIT()
5. REGISTER_BUTTONS() WDDOINIT()
6. REGISTER_BUTTONS() .
BUTTON_ACTION OK
7. BUTTON_ACTION.
BUTTON string. BUTTON,
OK. OK .

101

WebDynpro for ABAP

15
1

1. ZNET_ DIALOG_TEMPLATE
a.
2. ZNET_DIALOG_##.
3. Web Dynpro
a.

2
. ,
.
1. BOOKINGS
FLIGHTS. SBOOK.
0..n. BOOKID, CUSTOMID,
CUSTTYPE, LUGGWEIGHT, WUNIT, CLASS PASSNAME.
a.
2. supply function
GET_BOOKINGS BOOKINGS. Singleton.
a.
3. Supply_function.
ZCL_NET_MODEL=>READ_BOOKINGS()
a.
METHOD get_bookings .
DATA ls_flight TYPE wd_this->element_flights.
DATA lt_booking TYPE wd_this->elements_bookings.
parent_element->get_static_attributes(
IMPORTING
static_attributes = ls_flight ).
lt_booking
i_carrid
i_connid
i_fldate
).

=
=
=
=

zcl_net_model=>read_bookings(
ls_flight-carrid
ls_flight-connid
ls_flight-fldate

node->bind_table(
new_items
= lt_booking
set_initial_elements = abap_true ).
ENDMETHOD.

102

WebDynpro for ABAP


3
, .
.
1. POPUP_VIEW. BOOKINGS

a.
2. , .
10
a.
3. POPUP_WINDOW POPUP_VIEW.
a.

4
POPUP_WINDOW .
MAIN_VIEW.
onLeadSelect .
POPUP_WINDOW. ..
, .
1. GO_WINDOW
IF_WD_VINDOW
a.
2. DISP_DETAILS MAIN_VIEW.
onLeadSelect .
a.
3. . ,
.
GO_WINDOW. :
OK.

OK


a.
method ONACTIONDISPLAY_DETAILS .
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
wd_comp_controller->go_window = lo_window_manager->create_window(
window_name
= 'POPUP_WINDOW'
title
= ' '
close_in_any_case
= abap_false
message_display_mode
= if_wd_window=>co_msg_display_mode_selected
close_button
= abap_false
button_kind
= if_wd_window=>co_buttons_ok
message_type
= if_wd_window=>co_msg_type_none
default_button
= if_wd_window=>co_button_ok

103

WebDynpro for ABAP


).
wd_comp_controller->go_window

->open( ).

endmethod.

5
OK.
POPUP_VIEW. OK.
: OK . .. API
POPUP_VIEW , .
WDDOINIT().
1. BUTTON_ACTION POPUP_VIEW
a.
2. REGISTER_BUTTONS() POPUP_VIEW.
a.
3. GO_API_POPUP_VIEW
IF_WD_VIEW_CONTROLLER
a.
4. GO_API_POPUP_VIEW WDDOINIT()
a.
5. REGISTER_BUTTONS() WDDOINIT()
a.
METHOD wddoinit .
wd_this->go_api_popup_view = wd_this->wd_get_api( ).
wd_this->register_button( ).
ENDMETHOD.

6. REGISTER_BUTTONS() .
BUTTON_ACTION OK
a.
METHOD register_button .
wd_comp_controller->go_window ->subscribe_to_button_event(
button
= if_wd_window=>co_button_ok
*
button_text
= button_text
*
tooltip
= tooltip
action_name
= 'BUTTON_ACTION'
action_view
= wd_this->go_api_popup_view
*
is_default_button = ABAP_FALSE
).
ENDMETHOD.

7. BUTTON_ACTION.
BUTTON string. BUTTON,
OK. OK .
a.
METHOD onactionbutton_action .
IF button = if_wd_window=>co_button_ok.
wd_comp_controller->go_window->close( ).
ENDIF.

104

WebDynpro for ABAP


ENDMETHOD.

105

WebDynpro for ABAP

16

WebDynpro
WebDynpro

,
.
, .

ZNET_COMPLEX_00
ZNET_COMPLEX_00_U1 ZNET_COMPLEX_00_U2

1

1. ZNET_DIALOG_## ZNET_DIALOG_00.
2. ZNET_COMPLEX_##.
3. Web Dynpro

2
WebDynpro .
SFLIGHT .
1. WebDynpro ZNET_##_IF.
2. DETAILS_WINDOW.
3. DISPLAY_DETAILS()
IS_SLIGHT SFLIGHT.
4.

3
DETAILS _VIEW.
ZNET_##_IF . DETAILS _VIEW
DETAILS_WINDOW.

106

WebDynpro for ABAP


1. ZNET_COMPLEX_##_U1
MAIN_WINDOW DETAILS _VIEW.
MAIN_WINDOW.
2. ZNET_##_IF ZNET_COMPLEX_##_U1
3. DETAILS _VIEW ,
4. ZNET_COMPLEX_##_U1
5. ZNET_COMPLEX_##_U2

4
ZNET_COMPLEX_##_U1.
.
1. BOOKINGS (0..n)
SBOOK BOOKID, CUSTOMID, CUSTTYPE,
SMOKER, CLASS, FORCURAM. FORCURKEY ORDER_DATE
2. DETAILS_VIEW
3. BOOKINGS
DETAILS_VIEW. 10 .
4. DISPLAY_DETAILS()
. READ_BOOKINGS
ZCL_NET_MODEL. BOOKINGS

5
ZNET_COMPLEX_##_U2.
.
1. FLIGHT (1..1)
SFLIGHT
2. DETAILS_VIEW
3. FLIGHT
DETAILS_VIEW, CLIENT. .
4. DISPLAY_DETAILS() .
READ_FLIGHT ZCL_NET_MODEL.
FLIGHT

6
ZNET_COMPLEX_##
WebDynpro .
.
1. WebDynpro ZNET_##_IF
ZNET_COMPLEX_## . DETAILS_COMP
2. SUB_COMP_INFO
NAME string. Default value
ZNET_COMPLEX_##_U1.

107

WebDynpro for ABAP


3. DETAILS_COMP
.
4. PROCESS_SUB_COMP() .
.
FLIGHTS.
SUB_COMP_INFO.NAME.
,
DISPLAY_DETAILS
5. DISP_DETAILS_SUBCOMP MAIN_VIEW.
onLeadSelect
6. DISP_DETAILS_SUBCOMP
PROCESS_SUB_COMP()

DETAILS_WINDOW
CREATE_WINDOW_FOR_CMP_USAGE()
IF_WD_WINDOW_MANAGER.
GO_WINDOW
CLOSE_IN_ANY_CASE abap_true

7
.
1.
SUB_COMP_INFO.NAME

108

WebDynpro for ABAP

16
1

1. ZNET_DIALOG_## ZNET_DIALOG_00.
a.
2. ZNET_COMPLEX_##.
3. Web Dynpro
a.

2
WebDynpro .
SFLIGHT .
1. WebDynpro ZNET_##_IF.
a. -
()

b.
WebDynpro component interface

109

WebDynpro for ABAP

2. DETAILS_WINDOW.
a.

b.

3. DISPLAY_DETAILS()
IS_SLIGHT SFLIGHT.
a. Methods

4.
a.

110

WebDynpro for ABAP

3
DETAILS _VIEW.
ZNET_##_IF . DETAILS _VIEW
DETAILS_WINDOW.
1. ZNET_COMPLEX_##_U1
MAIN_WINDOW DETAILS _VIEW.
MAIN_WINDOW.
a.
2. ZNET_##_IF ZNET_COMPLEX_##_U1
a. Implemented Interfaces
b. ZNET_##_IF
Reimplement

3. DETAILS _VIEW ,
a.
4. ZNET_COMPLEX_##_U1
a.
5. ZNET_COMPLEX_##_U2
a.

4
ZNET_COMPLEX_##_U1.
.
1. BOOKINGS (0..n)
SBOOK BOOKID, CUSTOMID, CUSTTYPE,
SMOKER, CLASS, FORCURAM. FORCURKEY ORDER_DATE
a.
2. DETAILS_VIEW
a.
3. BOOKINGS
DETAILS_VIEW. 10 .
a.

111

WebDynpro for ABAP

4. DISPLAY_DETAILS()
. READ_BOOKINGS
ZCL_NET_MODEL. BOOKINGS
a.
METHOD display_details .
DATA lo_nd_booking TYPE REF TO if_wd_context_node.
DATA lt_booking TYPE wd_this->elements_bookings.
lt_booking =
i_carrid
i_connid
i_fldate
).

zcl_net_model=>read_bookings(
= is_flight-carrid
= is_flight-connid
= is_flight-fldate

lo_nd_booking = wd_context->get_child_node(
name = wd_this->wdctx_bookings ).
lo_nd_booking->bind_table( new_items = lt_booking ).
ENDMETHOD.

5
ZNET_COMPLEX_##_U2.
.
1. FLIGHT (1..1)
SFLIGHT
a.
2. DETAILS_VIEW
a.
3. FLIGHT
DETAILS_VIEW, CLIENT. .
a.
4. DISPLAY_DETAILS() .
READ_FLIGHT ZCL_NET_MODEL.
FLIGHT
a.
METHOD display_details .
DATA lo_nd_flight TYPE REF TO if_wd_context_node.
DATA ls_flight TYPE wd_this->element_flight.
*

navigate from <CONTEXT> to <FLIGHT> via lead selection


lo_nd_flight = wd_context->get_child_node(
name = wd_this->wdctx_flight ).
ls_flight = zcl_net_model=>read_flight(
i_carrid = is_flight-carrid
i_connid = is_flight-connid
i_fldate = is_flight-fldate
).
lo_nd_flight->bind_structure(

112

WebDynpro for ABAP


new_item
).

= ls_flight

ENDMETHOD.

6
ZNET_COMPLEX_##
WebDynpro .
.
1. WebDynpro ZNET_##_IF
ZNET_COMPLEX_## . DETAILS_COMP
a. Used components

2. SUB_COMP_INFO
NAME string. Default value
ZNET_COMPLEX_##_U1.
a.
3. DETAILS_COMP
.
a. Properties

113

WebDynpro for ABAP

4. PROCESS_SUB_COMP() .
.
FLIGHTS.
SUB_COMP_INFO.NAME.
,
DISPLAY_DETAILS
a.
METHOD
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA

process_sub_comp .
lo_nd_flights TYPE REF TO if_wd_context_node.
lo_el_flights TYPE REF TO if_wd_context_element.
ls_flights TYPE wd_this->element_flights.
lo_nd_sub_comp_info TYPE REF TO if_wd_context_node.
lo_el_sub_comp_info TYPE REF TO if_wd_context_element.
lv_name TYPE wd_this->element_sub_comp_info-name.
lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_interfacecontroller TYPE REF TO ziwci_net_00_if .

navigate from <CONTEXT> to <FLIGHTS> via lead selection


lo_nd_flights = wd_context->get_child_node( name = wd_this>wdctx_flights ).
*

get element via lead selection


lo_el_flights = lo_nd_flights->get_element(

).

get all declared attributes


lo_el_flights->get_static_attributes(
IMPORTING
static_attributes = ls_flights ).

* navigate from <CONTEXT> to <SUB_COMP_INFO> via lead selection


lo_nd_sub_comp_info = wd_context>get_child_node( name = wd_this->wdctx_sub_comp_info ).
* get element via lead selection
lo_el_sub_comp_info = lo_nd_sub_comp_info->get_element( ).
* get single attribute
lo_el_sub_comp_info->get_attribute(
EXPORTING
name = `NAME`
IMPORTING
value = lv_name ).
*** Create usage
lo_cmp_usage =
wd_this->wd_cpuse_details_comp( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( component_name = lv_name ).
ENDIF.
*** Call interface method
lo_interfacecontroller =

wd_this->wd_cpifc_details_comp( ).

lo_interfacecontroller->display_details(
is_flight = ls_flights
).
ENDMETHOD.

114

WebDynpro for ABAP


5. DISP_DETAILS_SUBCOMP MAIN_VIEW.
onLeadSelect
a.
6. DISP_DETAILS_SUBCOMP
PROCESS_SUB_COMP()

DETAILS_WINDOW
CREATE_WINDOW_FOR_CMP_USAGE()
IF_WD_WINDOW_MANAGER.
GO_WINDOW
CLOSE_IN_ANY_CASE abap_true
a.
METHOD onactiondisp_details_subcomp .
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
wd_comp_controller->process_sub_comp( ).
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
wd_comp_controller->go_window
=
lo_window_manager->create_window_for_cmp_usage(
interface_view_name
= 'DETAILS_WINDOW'
component_usage_name
= 'DETAILS_COMP'
title
= ''
close_in_any_case
= abap_true
message_display_mode
= if_wd_window=>co_msg_di
splay_mode_selected
).
wd_comp_controller->go_window->open( ).
ENDMETHOD.

7
.
1.
SUB_COMP_INFO.NAME
a.

115

WebDynpro for ABAP

17

,
,

ZNET_CUST_00
ZNET_COMPLEX_00_U1 ZNET_COMPLEX_00_U2

1

1. ZNET_COMPLEX_## ZNET_COMPLEX_00.
2. ZNET_CUST_##.
3. Web Dynpro

2
.
SUB_COMP_INFO.
1.
(CONFIG_CTLR).
2. SUB_COMP_INFO
.

3
ZNET_CONFIG_##_U1 ZNET_CONFIG_##_U2,

1.
2.
3.
4.

(ZNET_CONFIG_##_U1).
SUB_COMP_INFO.NAME = ZNET_COMPLEX_##_U1

ZNET_CONFIG_##_U2

116

WebDynpro for ABAP


4
ZNET_CUST_##.
ZNET_CONFIG_APPL_##_1 ZNET_CONFIG_APPL_##_2.

1.
2.
3.
4.

ZNET_CUST_##.
ZNET_CONFIG_APPL_##_1
ZNET_CONFIG_##_U1
ZNET_CONFIG_APPL_##_2

5
.
1. WDCONFIGURATIONID.

117

WebDynpro for ABAP

17
1

1. ZNET_COMPLEX_## ZNET_COMPLEX_00.
a.
2. ZNET_CUST_##.
3. Web Dynpro
a.

2
.
SUB_COMP_INFO.
1.
(CONFIG_CTLR).
a. Custom

2. SUB_COMP_INFO
.

a. ,

b.

118

WebDynpro for ABAP

c. SUB_COMP_INFO
d. . Context

e.
SUB_COMP_INFO SUB_COMP_INFO

3
ZNET_CONFIG_##_U1 ZNET_CONFIG_##_U2,

1. (ZNET_CONFIG_##_U1).
a.
2. SUB_COMP_INFO.NAME = ZNET_COMPLEX_##_U1
a. . Create.
Explicit Configuration

119

WebDynpro for ABAP

3.
4. ZNET_CONFIG_##_U2
a.

4
ZNET_CUST_##.
ZNET_CONFIG_APPL_##_1 ZNET_CONFIG_APPL_##_2.

1. ZNET_CUST_##.
a.

2. ZNET_CONFIG_APPL_##_1
a.
3. ZNET_CONFIG_##_U1
a. . Create.

120

WebDynpro for ABAP

4. ZNET_CONFIG_APPL_##_2
a.

5
.
1. WDCONFIGURATIONID.

a. Parameters

121

WebDynpro for ABAP

18

ZNET_ENHANCE_00

1

1. ZNET_COMPLEX_##_U2(
ZNET_COMPLEX_00_U2) ZNET_ENHANCE_##_U2
2. ZNET_CUST_## ZNET_CUST_00.
3. ZNET_ENCHANCE_##.
4.
SUB_COMP_INFO.NAME
5. Web Dynpro

2
.
.
1. .
ZNET_##_ENH.
2. SEATSMAX_B.
SEATSOCC_B PAYMENTSUM FLIGHT
3. MAIN_VIEW.
4.
5.

3
,

1. ZNET_ENHANCE_##_U2.
ZNET_##_ENH_U2.

122

WebDynpro for ABAP


2. PLANE (1..1) SAPLANE
FLIGHT. , MANDT
3. supply function GET_PLANE_DETAILS()
PLANE
4. supply function GET_PLANE_DETAILS().
READ_PLANE ZCL_NET_MODEL.
5. FLIGHT DETAILS_VIEW.
6. DETAILS_VIEW.
PLANE.
7.

123

WebDynpro for ABAP

18
1

1. ZNET_COMPLEX_##_U2(
ZNET_COMPLEX_00_U2) ZNET_ENHANCE_##_U2
a.
2. ZNET_CUST_## ZNET_CUST_00.
a.
3. ZNET_ENCHANCE_##.
4.
SUB_COMP_INFO.NAME
5. Web Dynpro
a.

2
.
.
1. .
ZNET_##_ENH.
a.
b. Controller
Enhance
c.

2. SEATSMAX_B.
SEATSOCC_B PAYMENTSUM FLIGHTS
a.

124

WebDynpro for ABAP


b.
3. MAIN_VIEW.
a. MAIN_VIEW
b. FLIGHTS

125

WebDynpro for ABAP

4.
a. .
Create binding
b.

5.

3
,

1. ZNET_ENHANCE_##_U2.
ZNET_##_ENH_U2.
a.
2. PLANE (1..1) SAPLANE
FLIGHT. , MANDT
a.
3. supply function GET_PLANE_DETAILS()
PLANE
a.
4. supply function GET_PLANE_DETAILS().
READ_PLANE ZCL_NET_MODEL.
a.
METHOD get_plane_details .
DATA ls_parent_attributes TYPE wd_this->element_flight.

126

WebDynpro for ABAP


DATA ls_plane TYPE wd_this->element_plane.
parent_element->get_static_attributes(
IMPORTING
static_attributes = ls_parent_attributes ).
ls_plane = zcl_net_model=>read_plane(
i_planetype = ls_parent_attributes-planetype

).

node->bind_structure(
new_item
= ls_plane
set_initial_elements = abap_true ).
*
ENDMETHOD.

5. FLIGHT DETAILS_VIEW.
a.
6. DETAILS_VIEW.
PLANE.
a.
7.
a.

127

WebDynpro for ABAP

19

WebDynpro

ZNET_PORTAL_1, ZNET_PORTAL_2

1

1.
2.
3.
4.

ZNET_PORTAL_TEMP_A_00 ZNET_PORTAL_A_##
ZNET_PORTAL_TEMP_B_00 ZNET_PORTAL_B_##

Web Dynpro

2
iView
1.
2. WebDynpro ##
3. iView Portal A ##
ZNET_PORTAL_A_##,
4. iView Portal B ##
ZNET_PORTAL_B_##,
5. iView

3
Page iView
1. Page ## iView.
1 , FULL_PAGE,
800 px.

128

WebDynpro for ABAP


4

1. V_DISPLAY ZNET_PORTAL_A_##.
2. ON_LINE_SELECT

3. ,
SHOW_BOOKINGS, ,
, ;.

4

1. V_BOOKINGS ZNET_PORTAL_B_##.
2. 'GET_BOOKINGS'.
3. PORTAL_EVENT_NAME,
PORTAL_EVENT_NAMESPACE PORTAL_EVENT_PARAMETER
STRING
4.
PORTAL_EVENT_PARAMETER ;.
READ_BOOKINGS ZCL_NET_MODEL

5. WDDOINIT
SHOW_BOOKINGS,

5

1. Page ##
2.

129

WebDynpro for ABAP

19
1

1. ZNET_PORTAL_TEMP_A_00 ZNET_PORTAL_A_##
a.
2. ZNET_PORTAL_TEMP_B_00 ZNET_PORTAL_B_##
a.
3.
a.
4. Web Dynpro
a.

2
iView
1.
a. -
-
b. .
2. WebDynpro ##
a.
3. iView Portal A ##
ZNET_PORTAL_A_##,
a. , iView
iView.
b. iView. iView
. .
c. 1 - iView SAP Web iView
WebDynpro. .
d. 2 - Iview .
.
e. 3 - ABAP. .
f. 4 backend ,
WebDynpro . SAP.
WebDynpro backend .
,
. , .
4. iView Portal B ##
ZNET_PORTAL_B_##,
a.

130

WebDynpro for ABAP


5. iView
a. iView ,
iView

3
Page iView
1. Page ## iView.
1 , FULL_PAGE,
800 px.
a. ,
.
b.
c.
d. . ,
e.
f. iView, .
iView
iView -
.
g.
h. = FULL_PAGE.

i.

4

1. V_DISPLAY ZNET_PORTAL_A_##.
2. ON_LINE_SELECT

a.
3. ,
SHOW_BOOKINGS, ,
, ;.
a.
data
data
data
data
data
data

lv_nd_flight_list
lv_el_flight_list
ls_flight
lv_api
lv_portal_manager
lv_string

type
type
type
type
type
type

ref to if_wd_context_node.
ref to if_wd_context_element.
wd_this->Element_Flight_List.
ref to if_wd_component.
ref to if_wd_portal_integration.
string.

lv_nd_flight_list = wd_context>PATH_GET_NODE( path = 'BAPI_FLIGHT_GETLIST.CHANGING.FLIGHT_LIST' )


.
lv_el_flight_list = lv_nd_flight_list->get_element( ).

131

WebDynpro for ABAP


lv_el_flight_list->get_static_attributes(
importing
static_attributes = ls_flight ).
concatenate ls_flight-AIRLINEID ls_flight-CONNECTID ls_flightFLIGHTDATE
into lv_string
separated by ';'.
lv_api = wd_comp_controller->wd_get_api( ).
lv_portal_manager = lv_api->get_portal_manager( ).
CALL METHOD lv_portal_manager->fire
EXPORTING
portal_event_namespace = 'SAP'
portal_event_name
= 'SHOW_BOOKINGS'
portal_event_parameter = lv_string
.

4

1. V_BOOKINGS ZNET_PORTAL_B_##.
2. 'GET_BOOKINGS'.
a.
3. PORTAL_EVENT_NAME,
PORTAL_EVENT_NAMESPACE PORTAL_EVENT_PARAMETER
STRING
a.

4.
PORTAL_EVENT_PARAMETER ;.
READ_BOOKINGS ZCL_NET_MODEL

a.
DATA
DATA
DATA
DATA
DATA

lv_carrid TYPE sflight-carrid.


lv_connid TYPE sflight-connid.
lv_fldate TYPE sflight-fldate.
lo_nd_bookings TYPE REF TO if_wd_context_node.
lt_booking TYPE wd_this->elements_bookings.

navigate from <CONTEXT> to <BOOKINGS> via lead selection


lo_nd_bookings = wd_context->get_child_node( name = wd_this>wdctx_bookings ).
SPLIT portal_event_parameter

132

AT ';'

WebDynpro for ABAP


INTO lv_carrid lv_connid lv_fldate.
lt_booking =
i_carrid
i_connid
i_fldate

zcl_net_model=>read_bookings(
= lv_carrid
= lv_connid
= lv_fldate ).

lo_nd_bookings->bind_table(
new_items = lt_booking
set_initial_elements = abap_true ).

5. WDDOINIT
SHOW_BOOKINGS,
a.
DATA lv_api_component TYPE REF TO if_wd_component.
DATA lv_portal_manager TYPE REF TO if_wd_portal_integration.
DATA lv_api_controller TYPE REF TO if_wd_view_controller.
lv_api_component = wd_comp_controller->wd_get_api( ).
lv_portal_manager = lv_api_component->get_portal_manager( ).
lv_api_controller = wd_this->wd_get_api( ).
CALL METHOD lv_portal_manager->subscribe_event
EXPORTING
portal_event_namespace = 'SAP'
portal_event_name
= 'SHOW_BOOKINGS'
view
= lv_api_controller
action
= 'GET_BOOKINGS'.

5

1. Page ##
2.
a.

133

WebDynpro for ABAP

20

NavigationList

NavigationList.

ZNET_UI_NAVLIST_00

1

1. ZNET_DIALOG_TEMPLATE ZNET_UI_NAVLIST_##
2. Web Dynpro

2
Singleton TEXT,
SELECTABLE, CARRID CONNID .
NavigationList
1. NAVI_LIST (0..n). ,
lead selection Singleton
2. TEXT ( STRING), SELECTABLE (
WDY_BOOLEAN), CARRID ( S_CARR_ID) CONNID( S_CONN_ID)
NAVI_LIST
3. NAVI_REC_NODE NAVI_LIST.
NAVI_LIST.

3
NAVI_LIST.

.
, .
8. DEFINE_NAV_LIST().
:

134

WebDynpro for ABAP


READ_CONNECTIONS() ZCL_NET_MODEL

CARRID CONNID


NAVI_LIST. TEXT = CARRID,
.
NAVI_REC_NODE
NAVI_LIST
BIND_STRUCTURE
NAVI_REC_NODE
get_child_node()

NAVI_REC_NODE. SELECTABLE = abap_true
. CARRID CONNID
. ,
TEXT
9. DEFINE_NAV_LIST() WDDOINIT

4
NAVI_LIST
NavigationList MAIN_VIEW.
PageHeader NET . NavigationList (
) ,

1. NAVI_LIST MAIN_VIEW
2. page header MAIN_VIEW. Page header
100%
3. MAIN_VIEW.
30% page header
4. .

5. .

5
,
.
.
1. MAIN_VIEW

135

WebDynpro for ABAP


2. GET_DETAILS SELECT
NavigationList
3. .
CONTEXT_ELEMENT (TYPE REF TO IF_WD_CONTEXT_ELEMENT).

.
GET_FLIGHTS().

136

WebDynpro for ABAP

20
1

1. ZNET_DIALOG_TEMPLATE ZNET_UI_NAVLIST_##
a.
2. Web Dynpro
a.

2
Singleton TEXT,
SELECTABLE, CARRID CONNID .
NavigationList
1. NAVI_LIST (0..n). ,
lead selection Singleton
a.
2. TEXT ( STRING), SELECTABLE (
WDY_BOOLEAN), CARRID ( S_CARR_ID) CONNID( S_CONN_ID)
NAVI_LIST
a.
3. NAVI_REC_NODE NAVI_LIST.
NAVI_LIST.
a. NAVI_LIST Create Recursion
Node

b. NAVI_REC_NODE
NAVI_LIST

137

WebDynpro for ABAP

3
NAVI_LIST.

.
, .
1. DEFINE_NAV_LIST().
:
READ_CONNECTIONS() ZCL_NET_MODEL

CARRID CONNID


NAVI_LIST. TEXT = CARRID,
.
NAVI_REC_NODE
NAVI_LIST
BIND_STRUCTURE
NAVI_REC_NODE
get_child_node()

NAVI_REC_NODE. SELECTABLE = abap_true
. CARRID CONNID
. ,
TEXT
a.
METHOD
DATA
DATA
DATA
DATA
DATA
DATA
DATA

define_nav_list .
lt_conn TYPE spfli_tab.
lv_conn LIKE LINE OF lt_conn.
lv_conn_prev LIKE lv_conn.
lo_nd_navi_list TYPE REF TO if_wd_context_node.
lo_nd_navi_rec TYPE REF TO if_wd_context_node.
lo_el_navi_list TYPE REF TO if_wd_context_element.
ls_navi_list TYPE wd_this->element_navi_list.

*** get NAVI_LIST node


lo_nd_navi_list = wd_context->get_child_node(
name = wd_this->wdctx_navi_list ).

138

WebDynpro for ABAP


*** Get connections
lt_conn = zcl_net_model=>read_connections( ).
SORT lt_conn BY carrid connid.
*** Fill navigation list
LOOP AT lt_conn
INTO lv_conn.
IF lv_conn_prev-carrid NE lv_conn-carrid.
*** New carrier
CLEAR ls_navi_list.
ls_navi_list-text = lv_conn-carrid.
lo_el_navi_list = lo_nd_navi_list->bind_structure(
new_item = ls_navi_list
set_initial_elements = abap_false ).
lo_nd_navi_rec = lo_el_navi_list->get_child_node(
name = 'NAVI_REC_NODE' ).
ENDIF.
CLEAR ls_navi_list.
ls_navi_list-carrid = lv_conn-carrid.
ls_navi_list-connid = lv_conn-connid.
ls_navi_list-selectable = abap_true.
CONCATENATE lv_conn-connid
lv_conn-cityfrom '-'
lv_conn-cityto
INTO ls_navi_list-text
SEPARATED BY space.
lo_nd_navi_rec->bind_structure(
new_item = ls_navi_list
set_initial_elements = abap_false ).
lv_conn_prev = lv_conn.
ENDLOOP.
ENDMETHOD.

2. DEFINE_NAV_LIST() WDDOINIT

a.
METHOD wddoinit .
wd_this->define_nav_list( ).
ENDMETHOD.

4
NAVI_LIST
NavigationList MAIN_VIEW.
PageHeader NET . NavigationList (
) ,

1. NAVI_LIST MAIN_VIEW
a.
2. page header MAIN_VIEW. Page header
100%

139

WebDynpro for ABAP


a. ROOTUIELEMENTCONTAINER

b. Page Header

c. .
LayoutData = MatrixHeadData. title.
width = 100%, colSpan = 2

140

WebDynpro for ABAP

3. MAIN_VIEW.
30% page header
a. ROOTUIELEMENTCONTAINER

b. Navigation List

c. Navigation List page header


d. LayoutData = MatrixHeadData, contentHeight =
450, vAlign = top, width = 30%.
e.
itemSelectable = NAVI_LIST.SELECTABLE
itemSource = NAVI_LIST
itemText = NAVI_LIST.TEXT
4. .

a. NavigationList insert
Header

b. title
5. .

a. layoutData =
MatrixHeadData, vAlign = top, width (LayoutData) = 70%

5
,
.
.

141

WebDynpro for ABAP


1. MAIN_VIEW
a.
2. GET_DETAILS SELECT
NavigationList
a. GET_DETAILS
b. SELECT NavigationList
3. .
CONTEXT_ELEMENT (TYPE REF TO IF_WD_CONTEXT_ELEMENT).

.
GET_FLIGHTS().
a.
METHOD onactionget_details .
DATA ls_navi_list TYPE wd_this->element_navi_list.
* get all declared attributes
context_element->get_static_attributes(
IMPORTING
static_attributes = ls_navi_list ).
wd_comp_controller->get_flights(
i_carrid = ls_navi_list-carrid
i_connid = ls_navi_list-connid
).
ENDMETHOD.

142

WebDynpro for ABAP

21

Tabstrip

Tabstrip,

ZNET_UI_TABSTRIP_00

1

1. ZNET_UI_NAVLIST_## ZNET_UI_NAVLIST_00
ZNET_UI_TABSTRIP_##
2. Web Dynpro

2
TabStrip MAIN_VIEW.
.
, .
1. TabStrip MAIN_VIEW
2. Tab .
.
3. .
4. Image, demo.gif
MIME SAP BC WebDynpro SAP PUBLIC ZNET.
5.

143

WebDynpro for ABAP

21
1

1. ZNET_UI_NAVLIST_## ZNET_UI_NAVLIST_00
ZNET_UI_TABSTRIP_##
a.
2. Web Dynpro
a.

2
TabStrip MAIN_VIEW.
.
, .
1. TabStrip MAIN_VIEW
a. ROOTUIELEMENTCONTAINER

b. TabStrip

2. Tab .
.
a. TabStrip Insert Tab.

b. text Caption
3. .
a.
4. Image, demo.gif
MIME SAP BC WebDynpro SAP PUBLIC ZNET.
a. TAB
Add Element
b. Image IMG_DEMO

144

WebDynpro for ABAP

c. source.

145

WebDynpro for ABAP

d. MIME. demo.gif SAP BC


WebDynpro SAP PUBLIC ZNET

e. source . ,
,

146

WebDynpro for ABAP

147

WebDynpro for ABAP

5.
a. height = 450, vAlign = top, width =
100%, width (layoutData) = 70%

148

WebDynpro for ABAP

22


ZNET_UI_TABLE_A_00

1

1. ZNET_UI_TABSTRIP_##
ZNET_UI_TABSTRIP_00 ZNET_UI_TABLE_A_##
2. Web Dynpro

2
.
ICON_WS_PLANE.
1.

3
.
4. , .
,
.
().
1. .
4.
2. , .
3.
, .

149

WebDynpro for ABAP


4. ()

4
,
.
1. FLIGHTS
. .
2. MAIN_VIEW.
3. ,

150

WebDynpro for ABAP

22
1

1. ZNET_UI_TABSTRIP_##
ZNET_UI_TABSTRIP_00 ZNET_UI_TABLE_A_##
a.
2. Web Dynpro
a.

2
.
ICON_WS_PLANE.
1.

a. MAIN_VIEW
b. Insert Header,
Caption
c. Caption

151

WebDynpro for ABAP

3
.
4. , .
,
.
().
1. .
4.
a. fixedPosition = left
TableColumn
b.
scrollableColCount Table
2. , .
a. Table fixetTableLayout = X
3.
, .
a. groupingValue TableColumn
FLIGHTS.CARRID.
b. groupingValue TableColumn
FLIGHTS.CONNID.
4. ()
a. Table design = alternative.
read_only = abap_true.

4
,
.
1. FLIGHTS
. .
a. .
FLIGHTS Create from Wizard Add
attributes from Structure. , MANDT,
Ok.
2. MAIN_VIEW.
a. MAIN_VIEW.
3. ,
a. MAIN_VIEW.
b. Create Binding
c.

152

WebDynpro for ABAP

23

ZNET_UI_TABLE_B_00

1

1. ZNET_UI_TABLE_A_## ZNET_UI_TABLE_A_00
ZNET_UI_TABLE_B_##
2. Web Dynpro

2
.
: , ,
. .
1. MAIN_VIEW
FILTER (1..1) STRING DATE SEATOCC
2. FILTER onFilter
.
3.
filterValue TableColumn
FILTER. = 100px
( )
4.
GO_TABLE_M_HNDL
5.
. : , ,
. DEFINE_FILTER_VALUES()
MAIN_VIEW .
WDDOINIT()

153

WebDynpro for ABAP

3
.
: , .
1. SORT onSort .
2. APPLY_SORTING()
3. , , ,
.

154

WebDynpro for ABAP

23
1

1. ZNET_UI_TABLE_A_## ZNET_UI_TABLE_A_00
ZNET_UI_TABLE_B_##
a.
2. Web Dynpro
a.

2
.
: , ,
. .
1. MAIN_VIEW
FILTER (1..1) STRING DATE SEATOCC
a.
2. FILTER onFilter

a.
3.
filterValue TableColumn
FILTER. = 100px
( )
a. MAIN_VIEW.
b. filterValue
TableColumn FILTER
c.
filterValue TableColumn
FILTER
d. = 100px
4.
GO_TABLE_M_HNDL
a. MAIN_VIEW
GO_TABLE_M_HNDL
IF_WD_TABLE_METHOD_HNDL
b. WDDOMODIFYVIEW()
MAIN_VIEW

155

WebDynpro for ABAP


c. view->get_element() ID
.
CL_WD_TABLE ( lo_table)
d. _method_handler lo_table
GO_TABLE_M_HNDL
e. , GO_TABLE_M_HNDL
: FIRST_TIME
f.
METHOD wddomodifyview .
DATA lo_table TYPE REF TO cl_wd_table.
CHECK first_time = abap_true.
lo_table ?= view->get_element( id = 'TABLE'
).
wd_this->go_table_m_hndl ?= lo_table->_method_handler.
ENDMETHOD.

g. onFilter.
APPLY_FILTER GO_TABLE_M_HNDL

METHOD onactionfilter .
wd_this->go_table_m_hndl->apply_filter( ).
ENDMETHOD.

5.
. : , ,
. DEFINE_FILTER_VALUES()
MAIN_VIEW .
WDDOINIT()
a. MAIN_VIEW
b. DEFINE_FILTER_VALUES()
c. WD_CONTEXT,
FILTER
d. SET_ATTRIBUTE_VALUE_SET FLDATE
,
e. DEFINE_FILTER_VALUES()
WDDOINIT MAIN_VIEW/
method WDDOINIT .
wd_this->DEFINE_FILTER_VALUES( ).
endmethod.

f.


METHOD
DATA
DATA
DATA
DATA
DATA

define_filter_values .
lo_nd_filter TYPE REF TO if_wd_context_node.
lo_nd_info TYPE REF TO if_wd_context_node_info.
lv_date_value(10).
lt_value TYPE wdr_context_attr_value_list.
lv_value LIKE LINE OF lt_value.

navigate from <CONTEXT> to <FILTER> via lead selection


lo_nd_filter = wd_context->get_child_node( name = wd_this>wdctx_filter ).
lo_nd_info = lo_nd_filter->get_node_info( ).
WRITE sy-datum TO lv_date_value.

156

WebDynpro for ABAP


CLEAR lv_value.
lv_value-text = ' '.
APPEND lv_value TO lt_value.
CLEAR lv_value.
CONCATENATE '<' lv_date_value INTO lv_value-value.
lv_value-text = ' '.
APPEND lv_value TO lt_value.
CLEAR lv_value.
CONCATENATE '>=' lv_date_value INTO lv_value-value.
lv_value-text = ' '.
APPEND lv_value TO lt_value.
lo_nd_info->set_attribute_value_set(
name
= 'FLDATE'
value_set = lt_value
).

ENDMETHOD.

3
.
: , .
1. SORT onSort .
a.
2. APPLY_SORTING()
a. APPLY_SORTING() GO_TABLE_M_HNDL
method ONACTIONSORT .
wd_this->GO_TABLE_M_HNDL->APPLY_SORTING( ).
endmethod.

3. , , ,
.
a. sortState
nonSortable.

157

WebDynpro for ABAP

24

(popin)

ZNET_UI_TABLE_C_00

1

1. ZNET_UI_TABLE_B_## ZNET_UI_TABLE_B_00
ZNET_UI_TABLE_C_##
2. Web Dynpro

2
table popin. Popin .
popin ,
. popin
.
1. table popin, , popin
.
2. |CLOSE_POPIN onClose
Table popin.
3. .
() .
TablePopinToggleCell .
POPIN.
selectedCellVariant TableColumn
4. TOGGLE_POPIN onToggle
TablePopinToggleCell
5. ,
popin, POPIN_NAME

158

WebDynpro for ABAP


. selectedPopin

6. popin .
FLIGHTS. POPIN_NAME
.
CONTEXT_ELEMENT WDEVENT->PARAMETERS

3

. 50% - , 50%-95% - ,
.
1. COLOR .
WDUI_TABLE_CELL_DESIGN.
2. DEFINE_COLORS() .
FLIGHTS.
. COLOR
( CL_WD_TABLE_COLUMN).
FLIGHT.
3. DEFINE_COLORS()

4. FLIGHTS MAIN_VIEW
5. design
FLIGHTS.COLOR.

159

WebDynpro for ABAP

24
1

1. ZNET_UI_TABLE_B_## ZNET_UI_TABLE_B_00
ZNET_UI_TABLE_C_##
a.
2. Web Dynpro
a.

2
table popin. Popin .
popin ,
. popin
.
1. table popin, , popin
.
a. MAIN_VIEW
b. Insert Table popin
popin
c. TablePopin (
Insert Content).
TextView Text
2. |CLOSE_POPIN onClose
Table popin.
a. |CLOSE_POPIN
onClose Table popin.
3. .
() .
TablePopinToggleCell .
POPIN.
selectedCellVariant TableColumn
a. Insert Table Column

b. fixedPosition = left, sortState =
notSortable
c.
d. Insert cell Variant
TablePopinToggleCell
e. POPIN variantKey

160

WebDynpro for ABAP


f.

selectedCellVariant
TableColumn
4. TOGGLE_POPIN onToggle
TablePopinToggleCell
a. TOGGLE_POPIN
onToggle TablePopinToggleCell
5. ,
popin, POPIN_NAME
. selectedPopin

a.
b. Distionary Structure FLIGHTS

c. POPIN_NAME STRING
d. FLIGHT MAIN_VIEW
e. MAIN_VIEW selectedPopin

6. popin .
FLIGHTS.POPIN_NAME
.
CONTEXT_ELEMENT WDEVENT->PARAMETERS
a. CLOSE_POPIN MAIN_VIEW.
b. CONTEXT_ELEMENT
IF_WD_CONTEXT_ELEMENT
c. , POPIN_NAME
METHOD onactionclose_popin .
context_element->set_attribute(
value = ''
name
= 'POPIN_NAME'
).
ENDMETHOD.

3

. 50% - , 50%-95% - ,
.
1. COLOR .
WDUI_TABLE_CELL_DESIGN.
a.
b. COLOR FLIGHTS.
WDUI_TABLE_CELL_DESIGN
2. DEFINE_COLORS() .
FLIGHTS.
. COLOR

161

WebDynpro for ABAP


( CL_WD_TABLE_COLUMN).
FLIGHT.
METHOD
DATA
DATA
DATA
DATA

define_colors
lo_nd_flights
lt_flights
ls_flights
lv_ratio

.
TYPE REF TO if_wd_context_node.
TYPE
wd_this->elements_flights.
TYPE
wd_this->element_flights.
TYPE
i.

lo_nd_flights = wd_context->get_child_node( name = wd_this>wdctx_flights ).


lo_nd_flights>get_static_attributes_table( IMPORTING table = lt_flights ).
LOOP AT lt_flights INTO ls_flights.
lv_ratio = 100 * ls_flights-seatsocc / ls_flights-seatsmax.
IF lv_ratio > 95.
ls_flights-color =
cl_wd_table_column=>e_cell_design-badvalue_medium.
ELSEIF lv_ratio > 50.
ls_flights-color =
cl_wd_table_column=>e_cell_design-criticalvalue_medium.
ELSE.
ls_flights-color =
cl_wd_table_column=>e_cell_design-goodvalue_medium.
ENDIF.
MODIFY lt_flights FROM ls_flights.
ENDLOOP.
lo_nd_flights->bind_table( lt_flights ).
ENDMETHOD.

3. DEFINE_COLORS()

a. ONACTIONGET_DETAILS
MAIN_VIEW
METHOD onactionget_details .
DATA ls_navi_list TYPE wd_this->element_navi_list.
* get all declared attributes
context_element->get_static_attributes(
IMPORTING
static_attributes = ls_navi_list ).
wd_comp_controller->get_flights(
i_carrid = ls_navi_list-carrid
i_connid = ls_navi_list-connid
).
wd_comp_controller->DEFINE_COLORS( ).
ENDMETHOD.

4. FLIGHTS MAIN_VIEW
a. FLIGHTS MAIN_VIEW
5. design
FLIGHTS.COLOR.
a. MAIN_VIEW

162

WebDynpro for ABAP


b. design
FLIGHTS.COLOR.

163

WebDynpro for ABAP

25

Tree

Tree

ZNET_UI_TREE_00

1

1. ZNET_UI_TABLE_C_## ZNET_UI_TABLE_C_00
ZNET_UI_TREE_##
2. Web Dynpro

2
.
.
.
1. NODES
TEXT STRING EXPANDED WDY_BOOLEAN.
leadSelection.
2. Singletone ITEMS NODES TEXT
STRING, CARRID (S_CARR_ID) CONNID (S_CONN_ID) .
leadSelection.
3. DEFINE_NAV_LIST DEFINE_TREE
. AA LH

4. DEFINE_NAV_LIST DEFINE_TREE WDDOINIT
.
5. NAVI_LIST DEFINE_NAV_LIST

3
Tree.

164

WebDynpro for ABAP


1. NODES
MAIN_VIEW
2. NavigationList MAIN_VIEW.
3. Tree TAbStrip. Tree
30% 450px. ,
.
ICON_FLIGHT
4. TreeNodeType.
NODES .
NODES.TEXT .
NODES.EXPANDED .
5. TreeItemType.
ITEMS .
NODES.ITEMS.TEXT .
6. GET_DETAILS onAction
TreeItemType
7. GET_DETAILS

165

WebDynpro for ABAP

25
1

1. ZNET_UI_TABLE_C_## ZNET_UI_TABLE_C_00
ZNET_UI_TREE_##
a.
2. Web Dynpro
a.

2
.
.
.
1. NODES
TEXT STRING EXPANDED WDY_BOOLEAN.
leadSelection.
a.
2. Singletone ITEMS NODES TEXT
STRING, CARRID (S_CARR_ID) CONNID (S_CONN_ID) .
leadSelection.
a.
3. DEFINE_NAV_LIST DEFINE_TREE
. AA LH

a.
method
DATA
DATA
DATA
DATA
DATA
DATA
DATA
DATA

DEFINE_TREE .
lt_connections
ls_connection
lv_carrid_old
lo_nd_nodes
lo_el_nodes
ls_nodes
lo_nd_items
ls_items

TYPE
spfli_tab.
TYPE
spfli.
TYPE
s_carr_id.
TYPE REF TO if_wd_context_node.
TYPE REF TO if_wd_context_element.
TYPE
wd_this->element_nodes.
TYPE REF TO if_wd_context_node.
TYPE
wd_this->element_items.

* Get internal table containing all flight connections


lt_connections = zcl_net_model=>read_connections( ).
SORT lt_connections BY carrid connid.
* Get reference to node to store carriers
lo_nd_nodes = wd_context->get_child_node( name = wd_this->wdctx_nodes ).
* Build up navigation list

166

WebDynpro for ABAP


LOOP AT lt_connections INTO ls_connection.
*** If connections for a new carrier are processed ***********************
IF ls_connection-carrid <> lv_carrid_old.
lv_carrid_old = ls_connection-carrid.
*

Define content of new context element


ls_nodes-text = ls_connection-carrid.
IF ls_connection-carrid = 'AA' OR ls_connection-carrid = 'LH'.
ls_nodes-expanded = abap_true.
ELSE.
ls_nodes-expanded = abap_false.
ENDIF.

Create new context element, keep reference to context element


lo_el_nodes
= lo_nd_nodes->bind_structure(
new_item
= ls_nodes
set_initial_elements = abap_false ).
*
Create dependent element collection to store connections
lo_nd_items = lo_el_nodes->get_child_node(
name = wd_this->wdctx_items ).
ENDIF.
**************************************************************************
*** For all elements: Define content of new context element **************
CONCATENATE ls_connection-connid
ls_connection-cityfrom
'>'
ls_connection-cityto
INTO ls_items-text
SEPARATED BY space.
ls_items-carrid
= ls_connection-carrid.
ls_items-connid
= ls_connection-connid.
*
Create new context element
lo_nd_items->bind_structure(
new_item
= ls_items
set_initial_elements = abap_false ).
**************************************************************************
ENDLOOP.
endmethod.

4. DEFINE_NAV_LIST DEFINE_TREE WDDOINIT


.
5. NAVI_LIST DEFINE_NAV_LIST

3
Tree.
1. NODES
MAIN_VIEW
a.
2. NavigationList MAIN_VIEW.
a. MAIN_VIEW
NavigationList

167

WebDynpro for ABAP


3. Tree TAbStrip. Tree
30% 450px. ,
.
ICON_FLIGHT
a. ROOTUIELEMENTCONTAINER
Insert Element
b. Tree
c.
d. : LayoutData =
MatrixHeadData, minHeight = 450px, width = 100%, width (LayiutData)
= 30%, title = , DefaultItemIconSource =
ICON_WS_FLIGHT
e. NODES dataSource
4. TreeNodeType.
NODES .
NODES.TEXT .
NODES.EXPANDED .
a. Insert Node Type Tree
TreeNodeType
b. dataSource Nodes,
text - NODES.TEXT, expanded - NODES.EXPANDED
5. TreeItemType.
ITEMS .
NODES.ITEMS.TEXT .
a. Insert Node Type Tree
TreeItemType
b. dataSource
Nodes.Items, text - NODES.ITEMS.TEXT
6. GET_DETAILS onAction
TreeItemType
7. GET_DETAILS

a.
METHOD onactionget_details .
DATA ls_items TYPE wd_this->element_items.
* get all declared attributes
context_element->get_static_attributes(
IMPORTING
static_attributes = ls_items ).
wd_comp_controller->get_flights(
i_carrid = ls_items-carrid
i_connid = ls_items-connid
).
wd_comp_controller->DEFINE_COLORS( ).
ENDMETHOD.

168

WebDynpro for ABAP

169

WebDynpro for ABAP

26

Excel XML

Excel

ZNET_OFFICE_XML_00, ZNET_FLIGHT_XSLT

1

1. ZNET_OFFICE_XML_TEMP_00
ZNET_OFFICE_XML_##
2. Web Dynpro

2
XML
1. Excel Example.xls MIME SAP BC
WebDynpro SAP PUBLIC ZNET.
2. XML 2003
3. XML
4.
5. .
. , .
, .
6. ,
.

3
XSLT , SFLIGHT
Excel.
1. XSLT ZNET_FLIGHT_XSLT_##
2.
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sap="http://www.sap.com/sapxsl" version="1.0">

170

WebDynpro for ABAP

<xsl:strip-space elements="*"/>
<xsl:template match="TABLE">
<xsl:processing-instruction name="mso-application">
<xsl:text>progid="Excel.Sheet"</xsl:text>
</xsl:processing-instruction>
</xsl:template>
</xsl:transform>
3. xsl:processing-instruction XML
, ( Workbook)
4.

<xsl:for-each select="item">
</xsl:for-each>
5. .
<xsl:value-of select="__ __"/>
6.

4
Excel
1. Excel V_END.
2. .
XSLT ZNET_FLIGHT_XSLT_##
CALL TRANSFORMATION, ,
.
CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE

171

WebDynpro for ABAP

26
1

1. ZNET_OFFICE_XML_TEMP_00
ZNET_OFFICE_XML_##
a.
2. Web Dynpro
a.

2
XML
1. Excel Example.xls MIME SAP BC
WebDynpro SAP PUBLIC ZNET.
2. XML 2003
3. XML
4.
5. .
. , .
, .
6. ,
.
a. , ,

3
XSLT , SFLIGHT
Excel.
1. XSLT ZNET_FLIGHT_XSLT_##
a. SE80
--
b. XSLT-
2.
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
<xsl:strip-space elements="*"/>
<xsl:template match="TABLE">

172

WebDynpro for ABAP


<xsl:processing-instruction name="mso-application">
<xsl:text>progid="Excel.Sheet"</xsl:text>
</xsl:processing-instruction>
</xsl:template>
</xsl:transform>
a.
3. xsl:processing-instruction XML
, ( Workbook)
a.
4.

<xsl:for-each select="item">
</xsl:for-each>
a.
5. .
<xsl:value-of select="__ __"/>
a.
<!-- -->
<xsl:for-each select="item">
<Row ss:AutoFitHeight="1" >
<Cell ss:StyleID="s_table_item_key"> <Data ss:Type="String"><xsl:value-of
select="CARRID"/></Data> </Cell>
<Cell ss:StyleID="s_table_item"> <Data ss:Type="String"><xsl:value-of
select="CONNID"/></Data> </Cell>
<Cell ss:StyleID="s_table_item"> <Data ss:Type="String"><xsl:value-of
select="FLDATE"/></Data> </Cell>
<Cell ss:StyleID="s_table_item"> <Data ss:Type="String"><xsl:value-of
select="PLANETYPE"/></Data> </Cell>
<Cell ss:StyleID="s_table_item"> <Data ss:Type="String"><xsl:value-of
select="SEATSMAX"/></Data> </Cell>
<Cell ss:StyleID="s_table_item"> <Data ss:Type="String"><xsl:value-of
select="SEATSOCC"/></Data> </Cell>
</Row>
</xsl:for-each>

6.
a.
b.
ZNET_FLIGHT_XSLT

4
Excel
1. Excel V_END.
a.
2. .
XSLT ZNET_FLIGHT_XSLT_##
CALL TRANSFORMATION, ,

173

WebDynpro for ABAP


.
CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE
a.
DATA
DATA
DATA
data
data
data

lo_nd_flighttab TYPE REF TO if_wd_context_node.


lo_el_flighttab TYPE REF TO if_wd_context_element.
lt_flight TYPE wd_this->elements_flighttab.
lv_xml_content type xstring.
lv_filename type string.
lv_mimetype type string.

navigate from <CONTEXT> to <FLIGHTTAB> via lead selection


lo_nd_flighttab = wd_context>get_child_node( name = wd_this->wdctx_flighttab ).
*

get all declared attributes


lo_nd_flighttab->get_static_attributes_table(
IMPORTING
table = lt_flight ).

CALL TRANSFORMATION ZNET_FLIGHT_XSLT


SOURCE TABLE = lt_flight
RESULT XML lv_xml_content.
lv_filename = 'output.xml'.
lv_mimetype = 'EXCEL'.
CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE(
I_FILENAME
= lv_FILENAME
I_CONTENT
= lv_XML_CONTENT
I_MIME_TYPE
= lv_MIMETYPE
*
I_IN_NEW_WINDOW = ABAP_true
*
I_INPLACE
= ABAP_FALSE
).

174

WebDynpro for ABAP

27

PDF


PDF

ZNET_PDF_00

1

1. ZNET_NAVI_00 ZNET_PDF_##
2. Web Dynpro

2

1. INFO
NACHN VORNA PS0002.
2. V_START
3. INFO V_START

3
PDF V_END
1. INFO V_END
2. InteractiveForm
3.
Height = 600px
Width = 600px
dataSource = INFO
enable = X
displayType = active
templateSource = ZNET_PDF_FRM_##
4. ZNET_PDF_INT_## PDF ZNET_PDF_FRM_##
INFO

175

WebDynpro for ABAP


5. ZNET_PDF_FRM_##.

6.
7. SUBMIT
8.
9. DO_PREV Submit PDF

10.

176

WebDynpro for ABAP

27
1

1. ZNET_NAVI_00 ZNET_PDF_##
a.
2. Web Dynpro
a.

2

1. INFO
NACHN VORNA PS0002.
a.
2. V_START
a.
3. INFO V_START
a.

3
PDF V_END
1. INFO V_END
a.
2. InteractiveForm
a. InteractiveForm

3.
Height = 600px
Width = 600px
dataSource = INFO
enable = X
displayType = active
templateSource = ZNET_PDF_FRM_##
a.

177

WebDynpro for ABAP

4. ZNET_PDF_INT_## PDF ZNET_PDF_FRM_##


INFO
a. templateSource
b.

c. Context ,

d. INFO
5. ZNET_PDF_FRM_##.

a. .
b. xACF-

6.
a. Palettes Data View
b. Design View
c. Data View
Design View

7. SUBMIT
a. Palettes Object Library
b. WebDynpro ActiveX

178

WebDynpro for ABAP

c. Submit Design View

8.
a.
9. DO_PREV Submit PDF

a.
10.
a. PDF

179