2009 Feb 27 6:17 AM
Hi all,
I need to place the details of select options on the top of page.
Iam using grid with classes.
pls suggest any method for that..
and also how to get average for a column.
Regards,
Anil kumar y.
2009 Feb 27 6:25 AM
2009 Feb 27 6:25 AM
2009 Feb 27 6:26 AM
2009 Feb 27 7:05 AM
2009 Feb 27 7:24 AM
Hi,
You can get avarage for a column by passing DO_SUM = 'C' for field cataolg internal table.
--Naveen Inuganti
2009 Feb 27 7:32 AM
2009 Feb 27 9:39 AM
yes Naveen I got the average.
Requrement is that we have three columns,
we got the total by do_sum = 'X' ,for first two colums and the third one is
percentage of the second in first.
ex : o/p is
5 2.5 50
10 2.5 25
-
15 5 33
how to get 33 there.
pls help me out
Thanks,
Anil.
2009 Feb 27 6:27 AM
Hi,
---> You can do this by ALV List display.
---> It is not possible through the ALV Grid Display.
Thanks,
Neelima.
2009 Feb 27 6:27 AM
2009 Feb 27 6:28 AM
2009 Feb 27 6:39 AM
Hi,
Follow these steps,
1. Declare one local class, with two methods,
class lcl_event_handler definition .
public section.
* Event Handler for Top of page
methods: top_of_page for event top_of_page of cl_gui_alv_grid importing e_dyndoc_id,
display,
endclass.3. Declare these Objects,
data: g_handler type ref to lcl_event_handler,
o_dyndoc_id type ref to cl_dd_document,
o_html_cntrl type ref to cl_gui_html_viewer,
go_parent_top type ref to cl_gui_container,
go_grid type ref to cl_gui_alv_grid,2. In the class inplimentation, impliment these two methods,
2.1: 1 st method:
class lcl_event_handler implementation.
method top_of_page.
call method o_dyndoc_id->add_gap
exporting
width = 99. <----99th position of the top of page
dl_text = 'Make your text'. <----here you can concatenate any variable also
call method o_dyndoc_id->add_text
exporting
text = dl_text
call method o_dyndoc_id->new_line. <----to add new line in the top of page
call method g_handler->display. <---call the display method
endmethod.2.2: 2nd method:
method display.
* * Creating html control
if o_html_cntrl is initial.
create object o_html_cntrl
exporting
parent = go_parent_top.
endif.
call method o_dyndoc_id->merge_document.
o_dyndoc_id->html_control = o_html_cntrl.
* Display document
call method o_dyndoc_id->display_document
exporting
reuse_control = 'X'
parent = go_parent_top
exceptions
html_display_error = 1.
if sy-subrc ne 0.
message i041 with 'Error in displaying top-of-page'(037)
space
space
space.
endif.
sap_emphasis = cl_dd_area=>heading.
endmethod.
endclass. <-----end class implimetation.4. before calling the method set tabel for first dsiplay,
set handler g_handler->top_of_page for go_grid.--Naveen Inuganti