cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Rows as Columns in a table

Former Member
0 Kudos

I have a column STATUS and the values of that columns are  new, in progress, due to day, overdue, completed and cancelled, I want to display this rows as column headers in a table , could any one please let me know how to do this

Advance Thanks

Vijaya

NewIn ProgressDue todayCompletedOverdueCancelled
551234

Accepted Solutions (0)

Answers (1)

Answers (1)

amy_king
Active Contributor
0 Kudos

Hi Vijaya,

You'll need to define a context node having this structure and a Table UI element whose data source is bound to the context node. You can use the Table Wizard to create the Table. Loop through the initial data table to build a row of status data and bind this row to the context node. For example...

LOOP AT data_table ASSIGNING <data>.
     CASE <data>-status.
         WHEN 'NEW'.
               ADD 1 TO ls_status_data-new.
         WHEN 'IN PROGRESS'.
               ADD 1 TO ls_status_data-in_progress.
         WHEN 'DUE'.
               ADD 1 TO ls_status_data-due.
        ...etc...
     ENDCASE.
ENDLOOP.

* Fetch the context node bound to the Table UI element
   lo_nd_status_table = wd_context->get_child_node(
       name = wd_this->wdctx_status_table
   ).

* Bind the status data
   lo_nd_status_table->bind_structure(
       new_item = ls_status_data
   ).

Cheers,

Amy