Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to add Top of Page for ALV

Hi

How to add Top of page for ALV

replied

Hi,

What i mean is,you are displaying lable field for this you should mention to which field you are showing lable.

you assign textview reference to the R_LABLE_FOR.

your code is correct nothing wrong is there.i dont know why your not getting.Once again i am posting my complete code here check once again and do as it is.

the below is code written in the WD_DOINIT of my view.

*ALV Component usage
data: l_ref_cmp_usage type ref to if_wd_component_usage.

l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
  l_ref_cmp_usage->create_component( ).
endif.

*Call Get_model() of Interface Controller to set changes to the output
*table

data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .
l_ref_interfacecontroller =   wd_this->wd_cpifc_alv( ).
  data:
    l_value type ref to cl_salv_wd_config_table.

  l_value = l_ref_interfacecontroller->get_model(
  ).
*TOP_OF_LIST in ALV
  DATA:
    node_top_of_list  TYPE REF TO if_wd_context_node,
    elem_top_of_list  TYPE REF TO if_wd_context_element,
    stru_top_of_list  TYPE if_search=>element_top_of_list .


data: lr_flow type ref to cl_salv_form_layout_grid,
      r_value type ref to cl_salv_form_label,
      r_value1 type ref to cl_salv_form_text.

*create object lr_flow.

CREATE OBJECT lr_flow
*  EXPORTING
*    COLUMNS =
    .

 r_value1 = lr_flow->create_text(
              row     = 1
              column  = 2
*              ROWSPAN = ROWSPAN
*              COLSPAN = COLSPAN
               TEXT    = 'TEXT1'
*              TOOLTIP = TOOLTIP
                 ).

 r_value =  lr_flow->create_label(
                  row         = 1
                  column      = 1
*                  ROWSPAN     = ROWSPAN
*                  COLSPAN     = COLSPAN
                   TEXT        = 'Lable1'
*                  TOOLTIP     = TOOLTIP
                   R_LABEL_FOR = R_value1
                     ).

r_value1 = lr_flow->create_text(
              row     = 2
              column  = 2
*              ROWSPAN = ROWSPAN
*              COLSPAN = COLSPAN
               TEXT    = 'TEXT2'
*              TOOLTIP = TOOLTIP
                 ).

 r_value =  lr_flow->create_label(
                  row         = 2
                  column      = 1
*                  ROWSPAN     = ROWSPAN
*                  COLSPAN     = COLSPAN
                   TEXT        = 'Lable2'
*                  TOOLTIP     = TOOLTIP
                   R_LABEL_FOR = R_value1
                     ).
* navigate from <CONTEXT> to <TOP_OF_LIST> via lead selection
  node_top_of_list = wd_context->get_child_node( 'TOP_OF_LIST' ).

node_top_of_list->set_attribute(
*    INDEX  = USE_LEAD_SELECTION
     VALUE  = lr_flow
    name   = 'CONTENT'
       ).


*Set top of list
l_value->if_salv_wd_table_settings~set_top_of_list_visible(
    value  = abap_true
       ).

Thanks

Suman

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question