Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How can we retrieve the data from table using cl_salv_table

Former Member
0 Likes
4,056
NumberNameTypeType 118050100303030
Type 21209030
Type 3100070303030
Type 41000000
Total410140200606060

I can get the data till type 1-4 but how can we attach internal table to cl_salv_table disply and also the total in the last row ?

1 ACCEPTED SOLUTION
Read only

rosenberg_eitan
Active Contributor
0 Likes
2,180

Hi,

Please looks at program SALV_DEMO_METADATA .

form set_aggregations.

Please check out the demo programs in Package SALV_OBJECTS for more goodies....

Regards.

NumberNameTypeType 118050100303030
Type 21209030
Type 3100070303030
Type 41000000
Total410140200606060

I can get the data till type 1-4 but how can we attach internal table to cl_salv_table disply and also the total in the last row ?

4 REPLIES 4
Read only

Former Member
0 Likes
2,180

Hi Ravi

You can call the method SET_DATA of cl_salv_table with passing the internal table and call DISPLAY method of cl_salv_table of display the table.

if you want to "Total" row in your table display. than take a structure of like internal table and loop at internal table,add the value of column wise records in others local varible, afte loop assign these local var values to your structure elements corresponding and than append this structure to your internal table.

Afte that call the REFRESH method of cl_salv_table class.

Regards

Amit Verma    

Read only

Former Member
0 Likes
2,180

Share your exact code of calling CL_SALV_TABLE and also if there is any usage of class CL_SALV_COLUMNS.

For totals in last row, sort the data using CL_SALV_SORT.

Cheers!

Abhinab

Read only

0 Likes
2,180

method GENERATE_OUTPUT.

     DATA: lx_msg TYPE REF TO cx_salv_msg.

     DATA: lr_salv_sorts              TYPE REF TO cl_salv_sorts.

     data: gr_funct type ref to cl_salv_functions.

     data: gr_columns type ref to cl_salv_columns_table.

     data: gr_column type ref to CL_SALV_COLUMN_table.

     TRY.

         CALL METHOD cl_salv_table=>factory

           IMPORTING

             r_salv_table = o_alv

           CHANGING

             t_table      = t_intab.

       CATCH cx_salv_msg INTO lx_msg.

     ENDTRY.

     gr_funct = o_alv->get_functions( ).

     gr_funct->set_all( Abap_True ).

     o_alv->display( ).

   endmethod.

1. The dynamic transparent table is giving data from column 1 to column 4 as shown above in table. And also need to merge the rows with similar data from column 1 to 3.

2. Another internal table is to be shown simultaneously giving the total both right and down side of the internal table like in above table from column 5 to 10.

At this moment I am getting the display from column 1 to 4 using above code without merge. but now how we can attach the internal table with such total on both sides ?

Read only

rosenberg_eitan
Active Contributor
0 Likes
2,181

Hi,

Please looks at program SALV_DEMO_METADATA .

form set_aggregations.

Please check out the demo programs in Package SALV_OBJECTS for more goodies....

Regards.