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

Display fields in two different alvgrids

Former Member
0 Likes
846

Hello all,

I want to display one table values in two different ALV grids in the same screen.

I select values from the table according to the conditions. For eg: my table has a column with char field as "m" for males and "f" for females.

How do i do this?

Waiting for your replies.

madhavi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
813

For example you have an internal table PEOPLE which has information about Males and Females.

Declare two more tables same as PEOPLE and move all the Males data into one of this and Females into the other.

Now you have data seperated into two tables.

Now create two custom controls in a screen. Pass the males intrnal table in one of it and females in the other.

Hello all,

I want to display one table values in two different ALV grids in the same screen.

I select values from the table according to the conditions. For eg: my table has a column with char field as "m" for males and "f" for females.

How do i do this?

Waiting for your replies.

madhavi.

7 REPLIES 7
Read only

Former Member
0 Likes
813

This can be achieved using custom controls.

Create two different custom controls in a screen and display the Alv grids.

Read only

0 Likes
813

Hi sudhir,

How do i code or loop the table to display in two different custom controls?

I know how to display values in one alvgrid. If I want to display the half table fields in 1 alv & other half fields in another alvgrid..

How do i do this?

Regards

madhavi.

Read only

0 Likes
813

Hi Madhavi,

The SAP program BALVBT01 provides an example of displying multiple ALV LIST reports on one page

Regards,

Azaz Ali.

Read only

Former Member
0 Likes
813

Hi,

If you are using OO Grid create another container in the screen and display the records separately..

Or

use REUSE_ALV_BLOCK_LIST_DISPLAY to create multiple ALV lists..

THanks,

Naren

Read only

Former Member
0 Likes
814

For example you have an internal table PEOPLE which has information about Males and Females.

Declare two more tables same as PEOPLE and move all the Males data into one of this and Females into the other.

Now you have data seperated into two tables.

Now create two custom controls in a screen. Pass the males intrnal table in one of it and females in the other.

Read only

0 Likes
813

Hi,

Can you please send me the code with splitter container and alvgrids in it. The 1st half container is top and 2nd is down.

My code..

SELECT * FROM zflp_cualcondpri

INTO TABLE gt_zflp_ttcualcondpri

UP TO g_max ROWS.

  • filtering the condition and alerts

LOOP AT gt_zflp_ttcualcondpri INTO gs_zflp_stcualcondpri.

IF gs_zflp_stcualcondpri-indcopr = 'C'.

APPEND gs_zflp_stcualcondpri TO gt_zflp_ttcualcond.

ELSEIF gs_zflp_stcualcondpri-indcopr = 'P'.

APPEND gs_zflp_stcualcondpri TO gt_zflp_ttcualpri.

ENDIF.

CLEAR gs_zflp_stcualcondpri.

ENDLOOP.

Looking forward for your reply.

Thanks madhavi.

Read only

Former Member
0 Likes
813

Split the values of the internal table into two global internal tables say eg. t_male and t_female. Split the container with sash position = 50 (half). Now create two grids based on the split containers w_contr_top and w_contnr_bot. Display the values.

IF cl_gui_alv_grid=>offline( ) IS INITIAL.

*Creating the container

CREATE OBJECT w_container

EXPORTING

container_name = 'container'

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

lifetime_dynpro_dynpro_link = 5

others = 6.

IF sy-subrc <> 0.

  • MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

  • WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • CREATE THE SPLITTER CONTROL

CREATE OBJECT w_split

EXPORTING

parent = w_container

orientation = 0

sash_position = 50

with_border = 0

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

others = 3.

IF sy-subrc NE 0.

ENDIF.

  • get the containers of splitter control

w_contnr_top = w_split->top_left_container.

w_contnr_bot = w_split->bottom_right_container.

ENDIF.