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

REUSE_ALV_GRID_DISPLAY layout problem

Former Member
0 Likes
1,916

Hi All,

I have a report which can output two different ALV grid depending upon the option selected on selection screen.

For example say I have selection screen with option button for Vendor report and Customer report. When user select Vendor report option button then content of KNA1 is displayed in ALV grid, similarly when user select Vendor report option button then content of LFA1 is displayed.

Now when I save a layout on Vendor report, that layout is also visible on Customer report and vice versa. Both of these report share same set of layouts.

Is there any method so that both of these report have there own set of layouts?

The problem which I am facing is I have save a layout on Vendor report to display column LFA1-LIFNR only and this layout is DEFAULT layout. Now when I run report for Customer report (customer option button selected) it shows me only on column KNA1-LIFNR. Actually it select the layout which is saved with Vendor report.

Is there any solution? Thanks in advance...

Vendor

Ceus

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,364

Pawan,

In this case if you want to create two different layouts what you need to pass the values in the parameter I_VARIANT where in you specify the user name, rpeort name and HANDLE.

Now, this handle will have to be unique for customer and vendor, you probably can hard code it as CUST for customer and VEND for vendor. You will have to pass this to the function.

Then the layouts pertaining to the specific report will be displayed.

Regards,

Ravi

Note : Please mark the helpful answers

Hi All,

I have a report which can output two different ALV grid depending upon the option selected on selection screen.

For example say I have selection screen with option button for Vendor report and Customer report. When user select Vendor report option button then content of KNA1 is displayed in ALV grid, similarly when user select Vendor report option button then content of LFA1 is displayed.

Now when I save a layout on Vendor report, that layout is also visible on Customer report and vice versa. Both of these report share same set of layouts.

Is there any method so that both of these report have there own set of layouts?

The problem which I am facing is I have save a layout on Vendor report to display column LFA1-LIFNR only and this layout is DEFAULT layout. Now when I run report for Customer report (customer option button selected) it shows me only on column KNA1-LIFNR. Actually it select the layout which is saved with Vendor report.

Is there any solution? Thanks in advance...

Vendor

Ceus

6 REPLIES 6
Read only

sbhutani1
Contributor
0 Likes
1,364

Hi pawan,

You can give a parameter on selection screen for choosing the layout then it will show only the selected layout

Regards

Sumit Bhutani

Read only

Former Member
0 Likes
1,364

hii

check this out

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.

PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.

PARAMETERS: LIST RADIOBUTTON GROUP G1,

GRID RADIOBUTTON GROUP G1.

SELECTION-SCREEN END OF BLOCK B2.

FORM CHECK_OPTION.

WA_EVENTS-NAME = 'TOP_OF_PAGE'.

WA_EVENTS-FORM = 'TOP'.

APPEND WA_EVENTS TO IT_EVENTS.

CLEAR WA_EVENTS.

WA_EVENTS-NAME = 'END_OF_LIST'.

WA_EVENTS-FORM = 'END_LIST'.

APPEND WA_EVENTS TO IT_EVENTS.

CLEAR WA_EVENTS.

IF LIST = 'X'.

PERFORM LIST_DISP.

ENDIF.

IF GRID = 'X'.

PERFORM GRID_DISP.

ENDIF.

ENDFORM.

FORM CHECK_OPTION.

WA_EVENTS-NAME = 'TOP_OF_PAGE'.

WA_EVENTS-FORM = 'TOP'.

APPEND WA_EVENTS TO IT_EVENTS.

CLEAR WA_EVENTS.

WA_EVENTS-NAME = 'END_OF_LIST'.

WA_EVENTS-FORM = 'END_LIST'.

APPEND WA_EVENTS TO IT_EVENTS.

CLEAR WA_EVENTS.

IF LIST = 'X'.

PERFORM LIST_DISP.

ENDIF.

IF GRID = 'X'.

PERFORM GRID_DISP.

ENDIF.

ENDFORM.

hope this helps

Thanks&Regards

Naresh

Read only

Former Member
0 Likes
1,364

Hi pawan,

1. It cannot be done.

2. Bcos

3. ALV layouts which are stored by users,

are PROGRAM SPECIFIC.

4. So even if we try to

show more than two different kind of alv,

for the system, its only one program,

and hence, it will save all layouts,

under that ONE PROGRAM only.

5. U will have two have two different programs

for different layouts.

regards,

amit m.

Read only

Former Member
0 Likes
1,365

Pawan,

In this case if you want to create two different layouts what you need to pass the values in the parameter I_VARIANT where in you specify the user name, rpeort name and HANDLE.

Now, this handle will have to be unique for customer and vendor, you probably can hard code it as CUST for customer and VEND for vendor. You will have to pass this to the function.

Then the layouts pertaining to the specific report will be displayed.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

Former Member
0 Likes
1,364

chk these programs

BCALV_GRID_09

BCALV_GRID_10

Read only

Former Member
0 Likes
1,364

Hi,

u give a name for your variant.

u can see that in table TCVIEW.

u can also use the FM GET_USER_STANDARD, this will getback the user settings before ALV display.

If found useful, award points pls.

Thanks,

Bharadwaja R