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: 

Two ALV grids, one above another

Former Member
0 Kudos

Hi Gurus,

I have an urgent requirement to have two ALV grids ,one above another.

For example:

Current

Prior

user total_1 total_2 total_1 total_2 End_total

name

i.e . Heading will be divided in two rows.

"Current" should come above "total_1" and " total_2".

And, Prior should come above next "total_1" and " total_2".

6 REPLIES 6

Former Member
0 Kudos

hi,

Plz See the BALVBT01 program. It has a sample code for Multiple list on one page.

Plz do not Use Words Like URGENT in your Question.

Read the Rules Of Engagement.

Regards

Sumit Agarwal

Former Member
0 Kudos

The best possible way out of this sort of a situation is by switching from function modules to THE OBJCET ORIENTED TECHNIQUE. For ALV displays there are many a standard SAP classes are available which make our life quite easy. For ALVs majority of the problems (as mentioned above) can easily be solved by using two classes: cl_gui_custom_container and cl_gui_alv_grid.

1. First define 2 custom containers in your screen as shown below and name them accordingly say u201CCONT1u201D and u201CCONT2u201D.

2. In your data declaration define the variables: -

DATA: g_container1 TYPE scrfname VALUE 'CONT1',

g_container2 TYPE scrfname VALUE 'CONT2',

grid1 TYPE REF TO cl_gui_alv_grid,

grid2 TYPE REF TO cl_gui_alv_grid,

g_custom_container1 TYPE REF TO cl_gui_custom_container,

g_custom_container2 TYPE REF TO cl_gui_custom_container.

3. IF g_custom_container1 IS INITIAL.

CREATE OBJECT g_custom_container1

EXPORTING container_name = g_container1.

----


The above code creates the custom container object and attaches itself with the screen container u2018CONT1u2019.

----


Now create the grid object: -

CREATE OBJECT grid1

EXPORTING i_parent = g_custom_container1.

----


Now call the method u2018SET_TABLE_FOR_FIRST_DISPLAYu2019 and pass the required parameters.

----


CALL METHOD grid1->set_table_for_first_display

EXPORTING

i_structure_name = 'SFLIGHT'

CHANGING

it_outtab = gt_sflight. u201CThe internal table containing the data

ENDIF.

Follow the same procedure for the other custom control also.

IF g_custom_container2 IS INITIAL.

CREATE OBJECT g_custom_container2

EXPORTING container_name = g_container2.

CREATE OBJECT grid2

EXPORTING i_parent = g_custom_container2.

CALL METHOD grid2->set_table_for_first_display

EXPORTING

i_structure_name = 'SFLIGHT'

CHANGING

it_outtab = gt_sflight.

ENDIF.

Regards,

Joy.

Former Member
0 Kudos

Hi,

You can use Splitter Container, you can refer to the example RSDEMO_SPLITTER_CONTROL.

Best Regards,

Kalyan

Former Member
0 Kudos

hi

good

Your query is bit confusing, anyway you can search for the realted functionality report using BCALV* in se38.

Thanks

mrutyun^

RoySayak
Active Participant
0 Kudos

Hi Shridhar,

>In OOP's approach you can split your container screen according to your requirements.

Best Regards,

Sayak...

"Giving points for helpful answer is always appreciating"

Former Member
0 Kudos

Hi Gurus,

Thanks for the replies.

I don't want multiple LISTs or Grids in the report output.

Is it possible in ALV GRID to have a Hierarchal Headings?