Application Development 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: 

ALV HEADER with INPUT FIELDS

Former Member
0 Kudos

Hi friends,

I have a problem with ALV Header (Top Of Page). The user wants to input data in the alv header and in the alv grid. In the alv grid is too easy to do, but I don't know how to do it in the header?

Any suggestion?

Regards.

Lisandro.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Lisandro,

There are a few ways of doing this.

1. Put in the input fields in the screen itself. This only works if you are using the control classes. If you are using the FM, it does not work. This is by far the simplest.

2. You can register the top_of_page event for the grid control, and build the html control. The sample code would be something like this

classs lcl_event_receiver defintion.

public section.

methods:

top_of_page for event top_of_page of cl_gui_alv_grid

importing e_dyndoc_id.

private section.

endclass.

class lcl_event_receiver implementation.

method top_of_page.

perform build_top_of_page using e_dyndoc_id.

endmethod.

endclass.

create object grid1

exporting i_parent = o_parent_grid.

create object event_receiver.

set handler event_receiver->top_of_page for grid1.

call method grid1->set_table_for_first_display

.

.

.

call method o_dyndoc_id->initialize_document

exporting

background_color = cl_dd_area=>col_textarea.

  • Processing events

call method grid1->list_processing_events

exporting

i_event_name = 'TOP_OF_PAGE'

i_dyndoc_id = o_dyndoc_id.

form build_top_of_page using e_dyndoc_id type ref to cl_dd_document.

data : lcl_form type ref to CL_DD_FORM_AREA.

call method e_dyndoc_id->initialize_document.

call method e_dyndoc_id->ADD_FORM

importing

formarea = lcl_form.

*You can build the form by calling appropriate methods of the class CL_DD_FORM_AREA.

endform.

3. You can use any of the splitter control, and split your container one to have an HTML control and another to display your ALV, and use the above approach to build the form.

Albert

4 REPLIES 4

naimesh_patel
Active Contributor
0 Kudos

I don't think it is possible.

Regards,

Naimesh Patel

Former Member
0 Kudos

Hello,

I think the only way to do it is creating an auxiliar dynpro....inside create something like a form allowing changes...save and exit...and create again the catalog based on that info...

Might work...

bye

Dont forget to reward

0 Kudos

Hi,

Go for ALV grid using objects and put your container below the screen and use upper area of the screen as header and there u can give input/output fields and u can use that part of the screen for your input.

Message was edited by:

Rajesh

Former Member
0 Kudos

Hi Lisandro,

There are a few ways of doing this.

1. Put in the input fields in the screen itself. This only works if you are using the control classes. If you are using the FM, it does not work. This is by far the simplest.

2. You can register the top_of_page event for the grid control, and build the html control. The sample code would be something like this

classs lcl_event_receiver defintion.

public section.

methods:

top_of_page for event top_of_page of cl_gui_alv_grid

importing e_dyndoc_id.

private section.

endclass.

class lcl_event_receiver implementation.

method top_of_page.

perform build_top_of_page using e_dyndoc_id.

endmethod.

endclass.

create object grid1

exporting i_parent = o_parent_grid.

create object event_receiver.

set handler event_receiver->top_of_page for grid1.

call method grid1->set_table_for_first_display

.

.

.

call method o_dyndoc_id->initialize_document

exporting

background_color = cl_dd_area=>col_textarea.

  • Processing events

call method grid1->list_processing_events

exporting

i_event_name = 'TOP_OF_PAGE'

i_dyndoc_id = o_dyndoc_id.

form build_top_of_page using e_dyndoc_id type ref to cl_dd_document.

data : lcl_form type ref to CL_DD_FORM_AREA.

call method e_dyndoc_id->initialize_document.

call method e_dyndoc_id->ADD_FORM

importing

formarea = lcl_form.

*You can build the form by calling appropriate methods of the class CL_DD_FORM_AREA.

endform.

3. You can use any of the splitter control, and split your container one to have an HTML control and another to display your ALV, and use the above approach to build the form.

Albert