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: 

Layout2 its not overwriting the Layout1 in the output of the ALV report

Former Member
0 Kudos

Hi Gurus,

I have developed an ALV report and displaying the Output of the report by using the Standard Function module 'REUSE_ALV_GRID_DISPLAY',The report is getting displayed corectly but the problem is that i have created two Layouts(Ex:Layout1 & Layout2) in the Output of the ALV report.

Layout1 - By using this Layout1 the ALV report can be seen with 23 columns(8 feilds are Hidden).

Layout2 - By Using this, the ALV report can be seen with all the 31 columns.

By Default Layout1 will be shown in the output of the ALV report.So when ever i am selecting the Layout2 then its not overwriting the Layout1 in the output of the ALV report,so can you please let me know how to overcome this issue.

Thanks & Regards,

Sridhar.

13 REPLIES 13

former_member188685
Active Contributor
0 Kudos

it should show the layout2. what is the layout2 type , is it user specific or what type of layout..?

0 Kudos

Hi Vijay,

Thanks for your reply,The Layout1 & Layout2 both are user specific,in which the users can restrict the feilds for displaying it in the Output of ALV report that is the reason i have created two Layouts,in which layout1 will have restricted feilds & the layout2 will have all the feilds to be displayed in the ALV output.But in my case bydefault the ALV output of my report will be of Layout1,once the layout1 is displayed then i will select the Layout2 in the ALV output and which overwrites the Layout1,Now if i select the Layout1 once again then its not overwriting the Layout2,Even tough i am getting the message in the Status bar saying that it was overwritten but actually its not overwriting.

So can you please help me how to overcome this issue.

Thanks & Regards,

Sridhar.

0 Kudos

this may be some buffer related issue. i am not really sure of it. i am not able to create the same situation in my system.

0 Kudos

Hi Vijay,

There is some wrong comunication in my earlier message,the Layouts are not user specific its "All".

Thanks & Regards ,

Sridhar

0 Kudos

run this report BCALV_BUFFER_DELETE before going for next layout and see.

0 Kudos

Hi Vijay,

I tried with this program for regresh the Buffer also, but still the problem is not resolved.

Thanks & Regards,

Sridhar

Former Member
0 Kudos

Hi,

I am sure that your are passing the Layout variable in FM Reuse_alv.....

Can you please share the FM call...

0 Kudos

Hi Ajay,

Below is the FM Code which is the part of my ALV report Program

IF NOT i_alv_output[] IS INITIAL.

PERFORM f_create_field_catalogue. "ALV form that creates output screen

PERFORM f_create_events.

ls_variant-report = sy-repid.

CLEAR wa_alv_output.

IF NOT i_alv_output[] IS INITIAL.

PERFORM f_create_field_catalogue. "ALV form that creates output screen

PERFORM f_create_events.

ls_variant-report = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-repid

  • i_callback_pf_status_set = lv_formname1

  • i_callback_user_command = lv_formname1

is_layout = ls_layout

it_fieldcat = lt_fieldcat

  • it_excluding = lt_extab[]

it_sort = lt_sort

i_callback_top_of_page = c_formname_top_of_page

i_save = c_a

is_variant = ls_variant

is_print = ls_print

  • it_events = it_events

TABLES

t_outtab = i_alv_output.

ELSE.

  • MESSAGE s999 WITH text-035.

ENDIF.

Thanks & Regards,

Sridhar.

0 Kudos

Hi Ajay,

Below is the FM Code.

IF NOT i_alv_output[] IS INITIAL.

PERFORM f_create_field_catalogue. "ALV form that creates output screen

PERFORM f_create_events.

ls_variant-report = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-repid

  • i_callback_pf_status_set = lv_formname1

  • i_callback_user_command = lv_formname1

is_layout = ls_layout

it_fieldcat = lt_fieldcat

  • it_excluding = lt_extab[]

it_sort = lt_sort

i_callback_top_of_page = c_formname_top_of_page

i_save = c_a

is_variant = ls_variant

is_print = ls_print

  • it_events = it_events

TABLES

t_outtab = i_alv_output.

ELSE.

  • MESSAGE s999 WITH text-035.

ENDIF.

Thanks & Regards,

Sridhar.

0 Kudos

Hi,

One quick Catch......May not work...but still no harm to try the same...

I observed that in the FM Reuse_ALV_GRID_DISPLAY ....u r passing the report name as sy-repid.......inspite of passing sy-repid.....store its value in a Local Variable and pass that local variable as report name in the Function Module..

Current Code

i_callback_program = sy-repid

Should be modified as:

Data v_repid like sy-repid.

v_repid = sy-repid.

i_callback_program = V_repid

Let me know the result once u r done....

0 Kudos

Hi Ajay,

Thanks for your reply,even this all doesnt worked for me.

I found one strange thing is that if i do the displaying of Layouts in revers order(First : Layout1 & then Second: Layout2) then the layout1 is getting overwritten by Layout2 and vice versa,In which Layout1 contains all the 31 feilds and Layout2 contains only 23 feilds and the remaining 8 feilds are hidden.

I dont what the reason behind this.

Thanks & Regards,

Sridhar.

0 Kudos

Hi,

Quite strange......

The only Option left is you need to share the complete code....Then only I can help you..

0 Kudos

Hey Ajay,

As i explained you its working fine with vice versa ,i think its fine with the End User,Any how thanks a lot for your help.

Thanks & Regards,

Sridhar.