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

Covert the Simple list program into ALV

Former Member
0 Likes
530

Hi Guy's,

Please help me present requirement like convert the simple list report to ALV format.

I worked to convert the simple to ALV but i struck up at : in selection screen contain 2 radio buttons

1.Detailed 2. summary.

when select the Detailed it displays the 8 fields information.

when select the Summary it displays the 3 fields information.

how to work this senario.

Thanks,

Sai.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
506

Hello Sai

Assuming that both lists - detailed and summary - have the same fieldcatalog but should display different numbers of columns the correct approach is as following:


FORM build_fieldcatalog.
* define local data
  data: ls_fcat    TYPE lvc_s_fcat.

" NOTE: GT_FCAT contains the columns of your ALV list.

" User chooses detailed list (p_opt1 = 'X') -> display all columns
" User chooses summary list (p_opt2 = 'X') -> display only three columns

  CHECK  ( p_opt2 = 'X' ).

  LOOP AT gt_fcat INTO ls_fcat
                            WHERE ( fieldname = 'COLUMN4'   or
                                           fieldname = 'COLUMN5'   or
                                          ... ).  " list columns to be hidden
    ls_fcat-tech = 'X'.  " completely hide from user
    MODIFY gt_fcat FORM ls_fcat INDEX syst-tabix.
  ENDLOOP.

ENDFORM.

Regards

Uwe

Hello Sai

Assuming that both lists - detailed and summary - have the same fieldcatalog but should display different numbers of columns the correct approach is as following:


FORM build_fieldcatalog.
* define local data
  data: ls_fcat    TYPE lvc_s_fcat.

" NOTE: GT_FCAT contains the columns of your ALV list.

" User chooses detailed list (p_opt1 = 'X') -> display all columns
" User chooses summary list (p_opt2 = 'X') -> display only three columns

  CHECK  ( p_opt2 = 'X' ).

  LOOP AT gt_fcat INTO ls_fcat
                            WHERE ( fieldname = 'COLUMN4'   or
                                           fieldname = 'COLUMN5'   or
                                          ... ).  " list columns to be hidden
    ls_fcat-tech = 'X'.  " completely hide from user
    MODIFY gt_fcat FORM ls_fcat INDEX syst-tabix.
  ENDLOOP.

ENDFORM.

Regards

Uwe

3 REPLIES 3
Read only

Former Member
0 Likes
506

Hi ,

u have to change the Field Catalog only ,

if p_sum eq 'X'.

fcat-1field.

fcat-2field

fcat-3field

else.

field-4

apppend fcat.

like this u need to maintain the FCAT.

regards

Prabhu

Read only

vinod_vemuru2
Active Contributor
0 Likes
506

HI Sai,

It is simple. I hope u have two internal tables like details and summary.

END-OF -SELECTION.

IF po_details EQ 'X'.

Build field catelog for 8 fields(Those displayed when u select details radio button).

Now call reuse ALV fm with details internal table.

ELSE.

Build field catelog for 3 fields(Those displayed when u select summary radio button).

Now call reuse ALV fm with summary internal table.

ENDIF.

If u dont have two internal tables then u have to change the logic such that u have two internal tables. One for details and other for summary.

Thanks,

Vinod.

Read only

uwe_schieferstein
Active Contributor
0 Likes
507

Hello Sai

Assuming that both lists - detailed and summary - have the same fieldcatalog but should display different numbers of columns the correct approach is as following:


FORM build_fieldcatalog.
* define local data
  data: ls_fcat    TYPE lvc_s_fcat.

" NOTE: GT_FCAT contains the columns of your ALV list.

" User chooses detailed list (p_opt1 = 'X') -> display all columns
" User chooses summary list (p_opt2 = 'X') -> display only three columns

  CHECK  ( p_opt2 = 'X' ).

  LOOP AT gt_fcat INTO ls_fcat
                            WHERE ( fieldname = 'COLUMN4'   or
                                           fieldname = 'COLUMN5'   or
                                          ... ).  " list columns to be hidden
    ls_fcat-tech = 'X'.  " completely hide from user
    MODIFY gt_fcat FORM ls_fcat INDEX syst-tabix.
  ENDLOOP.

ENDFORM.

Regards

Uwe