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

ALV layout

Former Member
0 Likes
712

Hi all,

How do I allow user to enter the desired ALV layout in a report.

THanks and Regards

JM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
691

hi Johann,

For that place a radio button for each lay out and based on the selection make use of your final table to display differnet layout.

if rad1 = 'X'.
* List Display
elseif rad2 = 'X'
* Grid Display
endif.

Message was edited by:

Santosh Kumar Patha

6 REPLIES 6
Read only

Former Member
0 Likes
692

hi Johann,

For that place a radio button for each lay out and based on the selection make use of your final table to display differnet layout.

if rad1 = 'X'.
* List Display
elseif rad2 = 'X'
* Grid Display
endif.

Message was edited by:

Santosh Kumar Patha

Read only

0 Likes
691

Hi Santosh,

Thanks for the quick response. What I want is I have this Layout field on my selection screen, so that when the user can have the option of selecting his own layout....say if he want to see only 2 or 3 columns in a report.

Thanks

JM

Read only

former_member196280
Active Contributor
0 Likes
691

Give all the layout in your selection screen, with radio button..

IF <LAYOUT1> selected

EXECUTE LAYOUT one code

ENDIF.

IF <LAYOUT2> selected

EXECUTE LAYOUT two code.

ENDIF.

-


-


Regards,

SaiRam

Read only

former_member194669
Active Contributor
0 Likes
691

Hi,

Declare a selection parameter in your program


parameters: p_vari        like ltdx-variant.

then <<<

at selection-screen on value-request for p_vari.
  perform f_variant_f4 using p_vari.

then  <<<

form f_variant_f4 using  p_vari.
* private variables
  data : v_exit    type c.
  clear gs_variantt.
  v_variant_save = 'U'.
  call function 'LVC_VARIANT_F4'
    exporting
      is_variant    = gs_variant
      i_save        = v_variant_save
    importing
      e_exit        = v_exit
      es_variant    = gs_variantt
    exceptions
      not_found     = 1
      program_error = 2
      others        = 3.
  if sy-subrc ne c_0.
*  & & & & &
    message i999(yscc) with text-064.    " No Layout Available for F4
  endif.
  if v_exit is initial.
    gs_variant-variant = gs_variantt-variant.
    p_vari             = gs_variantt-variant.
  endif.
endform.                                 " F_variant_f4


then   <<< pass gs_variant to call method

    call method grid1->set_table_for_first_display
      exporting
        is_layout                     = gs_layout
        is_variant                    = gs_variant
        i_save                        = 'A'
        it_toolbar_excluding          = i_exclude[]
      changing
        it_outtab                     = i_output[]
        it_fieldcatalog               = i_fieldcat[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.


otherwise if you are using REUSE fm then pass the variant name

aRs

Message was edited by:

a®

Read only

0 Likes
691

Hi,

Can you please giv me the full code, bcos am getting a lot of errors.

JM

Read only

former_member194669
Active Contributor
0 Likes
691

Johann,

I am not near to my system. i am traveling. sorry.

aRs