2008 Jul 19 11:44 AM
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.
2008 Jul 19 4:40 PM
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
2008 Jul 19 11:50 AM
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
2008 Jul 19 12:51 PM
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.
2008 Jul 19 4:40 PM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |