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

alv list using classes

Former Member
0 Likes
606

hi,

I am using CL_SALV_TABLE to alv list

cl_salv_table=>factory(

EXPORTING

list_display = if_salv_c_bool_sap=>true

IMPORTING

r_salv_table = gr_table

CHANGING

t_table = it_final2 ).

gr_functions = gr_table->get_functions( ).

gr_functions->set_all( abap_true ).

gr_table->display( ).

please tell me how to get top-of-page in this

regards,

kushagra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
565

Hi,

Here you are some code for top of list.

*&----


*

*& Form process_top_of_list

*&----


*

  • text

*----


*

FORM process_top_of_list.

DATA:

lr_grid TYPE REF TO cl_salv_form_layout_grid,

lr_grid_1 TYPE REF TO cl_salv_form_layout_grid,

lr_flow TYPE REF TO cl_salv_form_layout_flow,

lr_label TYPE REF TO cl_salv_form_label,

lr_text TYPE REF TO cl_salv_form_text,

l_text TYPE string.

CREATE OBJECT lr_grid.

lr_grid->create_header_information( row = 1

column = 1

text = sy-repid

tooltip = sy-repid ).

*... in the cell create a grid

lr_grid_1 = lr_grid->create_grid( row = 2

column = 1 ).

*... in the cell of the second grid create a label

lr_text = lr_grid_1->create_text( row = 1

column = 1

colspan = 2

text = 'Création de Marc Frenay '(ki1)

tooltip = 'Création de Marc Frenay'(ki1) ).

lr_flow = lr_grid_1->create_flow( row = 2

column = 1 ).

lr_label = lr_flow->create_label( text = 'Program:'(t02)

tooltip = 'Program: '(t02) ).

lr_text = lr_flow->create_text( text = sy-cprog

tooltip = sy-cprog ).

lr_flow = lr_grid_1->create_flow( row = 3

column = 1 ).

lr_label = lr_flow->create_label( text = 'System:'(t03)

tooltip = 'System:'(t03) ).

lr_text = lr_flow->create_text( text = sy-sysid

tooltip = sy-sysid ).

lr_flow = lr_grid_1->create_flow( row = 4

column = 1 ).

lr_label = lr_flow->create_label( text = 'Client:'(t04)

tooltip = 'Client:'(t04) ).

lr_text = lr_flow->create_text( text = sy-mandt

tooltip = sy-mandt ).

o_alv_table->set_top_of_list( lr_grid ).

ENDFORM. "process_top_of_list

2 REPLIES 2
Read only

Former Member
0 Likes
566

Hi,

Here you are some code for top of list.

*&----


*

*& Form process_top_of_list

*&----


*

  • text

*----


*

FORM process_top_of_list.

DATA:

lr_grid TYPE REF TO cl_salv_form_layout_grid,

lr_grid_1 TYPE REF TO cl_salv_form_layout_grid,

lr_flow TYPE REF TO cl_salv_form_layout_flow,

lr_label TYPE REF TO cl_salv_form_label,

lr_text TYPE REF TO cl_salv_form_text,

l_text TYPE string.

CREATE OBJECT lr_grid.

lr_grid->create_header_information( row = 1

column = 1

text = sy-repid

tooltip = sy-repid ).

*... in the cell create a grid

lr_grid_1 = lr_grid->create_grid( row = 2

column = 1 ).

*... in the cell of the second grid create a label

lr_text = lr_grid_1->create_text( row = 1

column = 1

colspan = 2

text = 'Création de Marc Frenay '(ki1)

tooltip = 'Création de Marc Frenay'(ki1) ).

lr_flow = lr_grid_1->create_flow( row = 2

column = 1 ).

lr_label = lr_flow->create_label( text = 'Program:'(t02)

tooltip = 'Program: '(t02) ).

lr_text = lr_flow->create_text( text = sy-cprog

tooltip = sy-cprog ).

lr_flow = lr_grid_1->create_flow( row = 3

column = 1 ).

lr_label = lr_flow->create_label( text = 'System:'(t03)

tooltip = 'System:'(t03) ).

lr_text = lr_flow->create_text( text = sy-sysid

tooltip = sy-sysid ).

lr_flow = lr_grid_1->create_flow( row = 4

column = 1 ).

lr_label = lr_flow->create_label( text = 'Client:'(t04)

tooltip = 'Client:'(t04) ).

lr_text = lr_flow->create_text( text = sy-mandt

tooltip = sy-mandt ).

o_alv_table->set_top_of_list( lr_grid ).

ENDFORM. "process_top_of_list

Read only

ak_upadhyay
Contributor
0 Likes
565

Hi,

Here are a few classes used in ALV, just read through their documentation or look at how they've been implemented in your system and you'll get a good idea on how to use them:

CL_ALV_EVENT_DATA (Changing Data Container for Events)

CL_ALV_EVENT_TOOLBAR_SET (ALV Context menu)

CL_ALV_TABLE_CREATE (Dynamic Creation of ALV Data Table)

CL_ALV_TREE_BASE (Basis Class ALV Tree Control)

CL_CK_ALVTREE_NKEY_2_OBJECT (Converter Node Key Object)

CL_COST_COSTINGVERSION_ALV (Display Costing Versions)

CL_GUI_ALV_GRID (List Viewer)

CL_GUI_ALV_GRID_BASE (Basis Class for ALV grid)

CL_GUI_ALV_TREE (ALV Tree Control)

CL_GUI_ALV_TREE_SIMPLE (Simple ALV Tree)

Sample:


DATA: lcl_alv TYPE REF TO cl_gui_alv_grid,
      t_flights TYPE STANDARD TABLE OF FLIGHTS.
 
SELECT * FROM flights INTO TABLE t_flights.
 
CREATE OBJECT lcl_alv
    EXPORTING I_PARENT = cl_gui_container=>screen0.
 
CALL METHOD lcl_alv->set_table_for_first_display
    EXPORTING
       I_STRUCTURE_NAME = 'FLIGHTS'
    CHANGING
       IT_OUTTAB = t_flights.
 
CALL SCREEN 100.

Reward points if useful....

Regards

AK