05-04-2017 1:48 PM
Hello,
I have a requirement where in i want to add the standard count functionality which is available for SAP standard report into my Z report using CL_SALV_LAYOUT/factory method.
Inputs will be appreaciated.
Thank You.
05-04-2017 1:50 PM
Hi.
I suppose your goal is to activate standard functions. Hope to help. Bye
DATA: lr_alv TYPE REF TO cl_salv_table,
lr_functions TYPE REF TO cl_salv_functions.
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = lr_alv
CHANGING
t_table = gt_out_data.
lr_functions = lr_alv->get_functions( ).
lr_functions->set_all( abap_true ).
lr_alv->display( ).
CATCH cx_salv_msg .
ENDTRY.
05-05-2017 8:26 AM
Hello,
Thanks for your reply. I have already done that but that doesnt provide the standard functionality of Count.
I hope I'm clear.
05-05-2017 8:46 AM
Hello Ajinkya Ket,
Which is the Count function? Do you mean the summarize one?
05-05-2017 8:01 PM
Don't you have the "Sum" button? Did you make sure that you have at least one true numeric column? (packed or float, but neither integer, nor numeric text)
If you have the Sum button and a numeric field, then it MUST work.
05-05-2017 8:53 AM
Hi Ajinkya,
I think you must do that on your own.
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = gt_sflight
).
DATA(lo_functions) = lo_alv->get_functions( ).
lo_functions->set_all( abap_true ).
DATA(lo_settings) = lo_alv->get_display_settings( ).
lo_settings->set_list_header( |Number of Records: { lines( gt_sflight ) }| ).
lo_alv->display( ).
CATCH cx_salv_msg .
ENDTRY.
So you have it in your header. If you want it dynamically you must pass the events for changing the ALV and refresh the header with your actual count.
05-05-2017 7:12 PM
Google -> SALV record count -> 344K results. Were none of them helpful?