10-21-2010 5:05 PM
Hi Experts,
By using SORT-SUBTOT = 'X' and FIELDCATALOG-DO_SUM = 'X', I will get subtotal and Main total.
My requiremnt is I need be calculate values manually and pass the calculated values to subtotal and maintotal.
is it possible in ALV GRID?
By adding extra row we will do this but I am looking standard subtotal and maintotal row change.
Thanks in advance,
Mahe
10-21-2010 7:22 PM
Hi,
With function REUSE_ALV_GRID_DISPLAY you cannot do this.
It´s possible if you create a class inherited from cl_gui_alv_grid and rewrite the method set_data_table, you can do this. Like:
CLASS xgrid DEFINITION INHERITING FROM cl_gui_alv_grid.
PROTECTED SECTION.
METHODS: set_data_table REDEFINITION.
ENDCLASS. "xgrid DEFINITION
CLASS xgrid IMPLEMENTATION.
METHOD set_data_table.
* ....MODIFY data_table ...
CALL METHOD super->set_data_table
CHANGING
data_table = data_table.
ENDMETHOD. "set_data_table
ENDCLASS. "xgrid IMPLEMENTATION
DATA: grid TYPE REF TO xgrid.
CREATE OBJECT custom_container EXPORTING container_name = mycontainer.
CREATE OBJECT grid EXPORTING i_parent = custom_container.
CALL METHOD grid1->set_table_for_first_display ...
Best regards,
Leandro Mengue
10-21-2010 7:15 PM
Hi,
I don't think you can do that with normal effort. Because you might need to manipulate some standard methods.
Why don't you try in this way.. add one extra row at each subtotal level and to get required values in standard subtotal line. And hide added row by using layout option.
When I am answering this question, I felt... 'You must be working for interesting client!'.
Thanks,
Naveen.I
10-21-2010 7:22 PM
Hi,
With function REUSE_ALV_GRID_DISPLAY you cannot do this.
It´s possible if you create a class inherited from cl_gui_alv_grid and rewrite the method set_data_table, you can do this. Like:
CLASS xgrid DEFINITION INHERITING FROM cl_gui_alv_grid.
PROTECTED SECTION.
METHODS: set_data_table REDEFINITION.
ENDCLASS. "xgrid DEFINITION
CLASS xgrid IMPLEMENTATION.
METHOD set_data_table.
* ....MODIFY data_table ...
CALL METHOD super->set_data_table
CHANGING
data_table = data_table.
ENDMETHOD. "set_data_table
ENDCLASS. "xgrid IMPLEMENTATION
DATA: grid TYPE REF TO xgrid.
CREATE OBJECT custom_container EXPORTING container_name = mycontainer.
CREATE OBJECT grid EXPORTING i_parent = custom_container.
CALL METHOD grid1->set_table_for_first_display ...
Best regards,
Leandro Mengue
11-16-2010 3:29 AM
Hi,
I am having a similar requirement. I am trying to edit the ALV total & subtotal lines. I am half successful but stuck with the packet size problem.
Please find the details of my problem in the thread
Can you please share how you solved this?
Regards,
Immanuel