Skip to Content
0
Former Member
Mar 19, 2009 at 07:40 PM

Color a selected row and save it to local context

19 Views

Hey folks,

I was looking for a document that shows how to color a selected row but all what i found is a document about columns so I 'm wondering how can I accomplish that in ALV, also save it permanently to my

context.

right now I m reading my context, got the selection lead, created a componenet

and got the model.

This is what I have so far in term of my code:

  • navigate from <CONTEXT> to <SELECT_TESTERTAB> via lead selection

lo_nd_select_testertab = wd_context->get_child_node( name = wd_this->wdctx_select_testertab ).

lo_el_select_testertab = lo_nd_select_testertab->get_element( ).

lo_el_select_testertab->get_static_attributes(

IMPORTING

static_attributes = ls_select_testertab ).

  • import table

lo_nd_select_testertab = wd_context->get_child_node( name = wd_this->wdctx_select_testertab ).

CHECK NOT lo_nd_select_testertab IS INITIAL.

CALL METHOD lo_nd_select_testertab->get_static_attributes_table

IMPORTING

table = lt_select_testertab.

  • Get access to the desired context node

wd_node = wd_context->get_child_node( name = 'SELECT_TESTERTAB' ).

  • Get the lead selection of the ALV

lr_element = wd_node->get_lead_selection( ).

  • create a component

data lo_cmp_usage type ref to if_wd_component_usage.

lo_cmp_usage = wd_this->wd_cpuse_alv( ).

if lo_cmp_usage->has_active_component( ) is initial.

lo_cmp_usage->create_component( ).

endif.

  • get model

DATA lo_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .

lo_INTERFACECONTROLLER = wd_this->wd_cpifc_alv( ).

DATA lo_value TYPE ref to cl_salv_wd_config_table.

lo_value = lo_interfacecontroller->get_model(

).

Thanks in advance

Edited by: Abdul kourani on Mar 19, 2009 8:53 PM