Saturday, October 11, 2008

SAP Examples of Design Objects in SAP Netweaver Managing ALV Output Areas

Table-Type Layout at the Beginning of the ALV Output

The following example shows how you insert a design object with a table-type layout at the beginning of the ALV output:

...

*... TOP_OF_LIST

data:

lr_node type ref to if_wd_context_node,

lr_grid type ref to cl_salv_form_layout_grid,

lr_text type ref to cl_salv_form_text,

lr_label type ref to cl_salv_form_label.

create object lr_grid.

lr_text = lr_grid->create_text(

text = '1.2 TEXT'

row = 1

column = 2 ).

lr_label = lr_grid->create_label(

text = '1.1 LABEL'

row = 1

column = 1

r_label_for = lr_text ).

lr_text = lr_grid->create_text(

text = '2.2 TEXT'

row = 2

column = 2 ).

lr_label = lr_grid->create_label(

text = '2.1 LABEL'

row = 2

column = 1

r_label_for = lr_text ).

lr_node = wd_context->get_child_node( name = 'TOP_OF_LIST' ).

call method lr_node->set_attribute

exporting

value = lr_grid

name = 'CONTENT'.

...

Row-Type Layout at End of ALV Output

The following example shows how you display an element of type Text at the end of the ALV output:

...

*... END_OF_LIST

data:

lr_node type ref to if_wd_context_node,

lr_flow type ref to cl_salv_form_layout_flow,

lr_text type ref to cl_salv_form_text.

create object lr_flow.

lr_text = lr_flow->create_text(

text = 'MyText').

lr_node = wd_context->get_child_node( name = 'END_OF_LIST' ).

call method lr_node->set_attribute

exporting

value = lr_flow

name = 'CONTENT'.

No comments:

Archive