2 Replies Latest reply: Jan 27, 2006 10:50 AM by Guest RSS

Sorting option in WebDynPro ABAP UI Table

Currently Being Moderated

Hi,

I would like to know that how to implement the Sorting Option in WebDynPro UI Table Element . A code snippet will help on the same issue .

 

Regards

Sid

  • Re: Sorting option in WebDynPro ABAP UI Table
    Ralf Geiger
    Currently Being Moderated

    Hi Siddarth,

     

    1. You need to assign an action (e.g. 'DO_SORT') to the UI table you want to sort.

    2. Within the action 'DO_SORT' you have to get the context node of your table, the column and the current sort direction.

     

      lr_node = wd_context->get_child_node( <table_context_node> ).
      l_col_name = wdevent->get_string( 'COLUMN' ).
      l_sort_direction = wdevent->get_string( 'DIRECTION' ).

     

    3. Get the context value table

     

      lr_node->get_static_attributes_table( IMPORTING table = <value_table> ) 
    

     

    4. Now do the sorting of the context node depending on the sort direction and bind it back to the context node.

     

      CASE l_sort_direction.
    
        WHEN CL_WD_TABLE_COLUMN=>E_SORT_STATE-UP. " Ascending
          SORT <value_table> ASCENDING BY (l_col_name).
        WHEN CL_WD_TABLE_COLUMN=>E_SORT_STATE-DOWN. " Descending
          SORT <value_table> DESCENDING BY (l_col_name).
      ENDCASE.
    
      lr_node->bind_table( <value_table> ).  
    

     

    That's it

     

    Regards,

     

    Ralf

     

     

    Message was edited by: Armin Reichert

    Points assigned

  • Re: Sorting option in WebDynPro ABAP UI Table
    Currently Being Moderated

    Hi Ralf ,

    Thanks a lot for the code snippet .

    It is really helpful and it is working properly .

     

     

    Thanks and Regards

    Sid

Actions