2010 Oct 10 2:23 PM
hi experts,
i am displaying report where i have to display the budget for an year and it 6 sub columns for every month .so that makes it for 72 alv columns.can i reduce the pain of writing the field catalogue for 72 columns by any alternative approach
with thanks in advance.
syed
2010 Oct 10 4:10 PM
Syed faced with the same prob,
You could use field symbols to solve this
Just a short snap of how it is done( Only in display)
LOOP AT t_t001 INTO wa_t001.
CONCATENATE wa_t001-bukrs '_' INTO l_headertext.
CONCATENATE l_headertext 'TOTAL1' INTO l_field.
CONCATENATE l_headertext c_withaff INTO l_headertext.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_ALV' l_field space c_x l_headertext w_pos.
ENDLOOP.
hi experts,
i am displaying report where i have to display the budget for an year and it 6 sub columns for every month .so that makes it for 72 alv columns.can i reduce the pain of writing the field catalogue for 72 columns by any alternative approach
with thanks in advance.
syed
2010 Oct 10 4:10 PM
Syed faced with the same prob,
You could use field symbols to solve this
Just a short snap of how it is done( Only in display)
LOOP AT t_t001 INTO wa_t001.
CONCATENATE wa_t001-bukrs '_' INTO l_headertext.
CONCATENATE l_headertext 'TOTAL1' INTO l_field.
CONCATENATE l_headertext c_withaff INTO l_headertext.
PERFORM fill_fields_of_fieldcatalog
TABLES t_fieldcatalog
USING 'T_ALV' l_field space c_x l_headertext w_pos.
ENDLOOP.
2010 Oct 10 6:57 PM
Hi Syed,
if you created the table width 72 columns in dictionary, creation of field catalog is easy. If you use SALV, you never need a field catalog. If you use RTTS you can create the table using ABAP.
Obviously you were not able to search before post - try google.
Regards
Clemens
2010 Oct 11 4:13 PM
hi ,
thanks alot for your answers.
i used the following code since i dint hav the dictionary for the 72 columns.
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
PROGRAM = 'ZITR_NUTRABUDGETDISPLAYYEAR'
FIELDNAME = 'FINALI'
TABLES
COMPONENTS = FIELDLIST
.
LOOP AT FIELDLIST.
TAB = SY-TABIX.
PERFORM FIELD_DISPLAY USING FIELDLIST-NO-COMPNAME TAB FIELDLIST-NO-OLEN FIELDLIST-NO-TYPE.
ENDLOOP.
FORM FIELD_DISPLAY USING P_NO_COMPNAM
P_NO_LEVEL
P_NO_OLEN
P_NO_TYPE.
g_fieldcatch-fieldname = P_NO_COMPNAM.
g_fieldcatch-tabname = 'FINALI'.
g_fieldcatch-col_pos = P_NO_LEVEL.
g_fieldcatch-seltext_l = P_NO_COMPNAM.
g_fieldcatch-emphasize = P_NO_TYPE.
g_fieldcatch-outputlen = P_NO_OLEN.
APPEND g_fieldcatch TO gt_fieldcatch.
CLEAR g_fieldcatch.
ENDFORM.
after a point the alv column is getting truncated and getting displayed in the nesxt line..tried increasin the line size but in vain..
is something wrong with the code.
thanks in advance,
syed
Edited by: SYED_ibbu on Oct 12, 2010 12:55 PM
2010 Oct 11 5:31 AM
If you have a dictionary structure with this 72 columns, then you can use the Function Module LVC_FIELDCATALOG_MERGE for building the field catalog.
2010 Oct 12 11:58 AM