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

reducing the alv columns

syed_ibrahim5
Active Participant
0 Likes
752

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
716

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

5 REPLIES 5
Read only

Former Member
0 Likes
717

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.  

Read only

Clemenss
Active Contributor
0 Likes
716

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

Read only

0 Likes
716

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

Read only

rathishr_nair
Explorer
0 Likes
716

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.

Read only

Former Member
0 Likes
716

Hi,

Use the FM LVC_FIELDCATALOG_MERGE