cancel
Showing results for 
Search instead for 
Did you mean: 

How to display CDS View data through Program in Gui view (design, layout) or ALV

0 Kudos

Hallo Everybody,

I want to display CDS view through Program with Selection options. Following program is working

REPORT zconsume_02_cds_test.
DATA  spart TYPE spart.
SELECT-OPTIONS Division for  spart.
Select *
from ZI_SAC_VERKAUFSDETAILS
where spart IN @Division
into table @data(Salesdata) .
cl_demo_output=>display_data( Salesdata ).
* cl_salv_gui_table_ida=>create_for_cds_view(`Salesdata`)->fullscreen( )->display( ).

but output design is like that (pleases see attached file, program output design

)

I want to have following output design (Please see attached file, Expected output design)

what should i do?

From the following program i am getting expected output design but can not include Selection options. Can i add select options here?

REPORT zconsume_02_cds.
class lcl_main definition create private.
  public section.
    CLASS-METHODS create
      RETURNING
        value(r_result) TYPE REF TO lcl_main.
    methods run.
  protected section.
  private section.
endclass.
class lcl_main implementation.
  method create.
    create object r_result.
  endmethod.
  method run.
cl_salv_gui_table_ida=>create_for_cds_view(`ZI_SAC_VERKAUFSDETAILS`)->fullscreen( )->display( ).
  endmethod.
endclass.
start-of-selection. lcl_main=>create( )->run( ).

Any suggestion is highly appreciated.

Thanking You

Kazi

Accepted Solutions (0)

Answers (2)

Answers (2)

maheshpalavalli
Active Contributor
0 Kudos

Hello Mahesh,

Thanks for your reply. Do you know how to add selection options in the following code?

REPORT zconsume_02_alv.
start-of-selection.
DATA(o_data) = cl_salv_gui_table_ida=>create_for_cds_view( iv_cds_view_name = `ZI_SAC_VERKAUFSDETAILS` ) .
o_data->fullscreen( )->display( ).

Thanks Kazi

maheshpalavalli
Active Contributor
0 Kudos

kazi.m.geam

, it's there in the blogpost, please check it
ThorstenHoefer
Active Contributor

Hi,

try this:

data: lt_range = IF_SALV_SERVICE_TYPES=>YT_NAMED_RANGES.

lt_range = value #( ( name = 'FIELD1' sign = 'I' option='EQ' low='ABC' ) ).

data(lr_alv) = cl_salv_gui_table_ida=>create_for_cds_view( iv_cds_view_name = `ZI_SAC_VERKAUFSDETAILS` ).

lr_alv->SET_SELECT_OPTIONS( it_range = lt_range ).
lr_alv->fullcreen( )->display( ).