Application Development 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: 

Manual Fieldcatlog Vs Using Function Module

Former Member
0 Kudos

Hi friends

Can any one give me the differences between building manually fieldcatalog and Using function module REUSE_ALV_FIELDCATALOG_MERGE. pls any one can u give sample programs for above. full points will be awarded..

Regards and Thanks

Vijaya

1 ACCEPTED SOLUTION

Former Member
0 Kudos

REUSE_ALV_FIELDCATALOG_MERGE is recommended if your final display internal table is built on a data dictionary structure (i.e. viewable from SE11).

You may want to build the fieldcatalog manually if u have few fields which reference standard data elements (to read the technical type and descriptions from). However if you have many fields, then REUSE_ALV_FIELDCATALOG_MERGE is better.

Also, often you might need a different description (column header) for the ALV output from what standard offers, in that case, you can use REUSE_ALV_FIELDCATALOG_MERGE and finally modify the field catalog table fields seltext_s/m/l.

Sample program: BCALV_TEST_MERGE

4 REPLIES 4

Former Member
0 Kudos

REUSE_ALV_FIELDCATALOG_MERGE is recommended if your final display internal table is built on a data dictionary structure (i.e. viewable from SE11).

You may want to build the fieldcatalog manually if u have few fields which reference standard data elements (to read the technical type and descriptions from). However if you have many fields, then REUSE_ALV_FIELDCATALOG_MERGE is better.

Also, often you might need a different description (column header) for the ALV output from what standard offers, in that case, you can use REUSE_ALV_FIELDCATALOG_MERGE and finally modify the field catalog table fields seltext_s/m/l.

Sample program: BCALV_TEST_MERGE

Former Member
0 Kudos

hi,

when u enter the fieldcatalogs mannually...though in the final table u have many fields u can display what fields u require to display in output.

where as if u r usinf reuse_alv_fieldcatalog_merge.

then it will loop through final table then display all the fields in the final table..

i hope this should clear ur doubt.

Reward with points if helpful.

Former Member
0 Kudos

hi,

both have their purposes but for general use use Fm field catalog for manual field catalog for following fields.

1.for manual field catalog for each field u have write code. if the table has n no of fields then we have to write n*n lines of code for it.

2. no graphical representation is possible with manual field catalog.

3. preferred for only limited or small no of fields.

4. no automatic sorting is available............

5. when we use manual field catalog its like a normal report.

we can overcome all this by using Fm field catalog as its predefined with all graphical representations and more user friendly. which makes list more interactive to users.

if helpful reward some points.

with regards,

Suresh Aluri.

Former Member
0 Kudos

This is the syntax -

* Build the Field catalog for the ALV list.
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
      I_PROGRAM_NAME               = 'ZCD0_DET_COMP'
      I_INTERNAL_TABNAME           = 'T_ALV_STB'
*   I_STRUCTURE_NAME             =
*   I_CLIENT_NEVER_DISPLAY       = 'X'
      I_INCLNAME                   = 'ZCD0_DET_COMP'
*   I_BYPASSING_BUFFER           =
*   I_BUFFER_ACTIVE              =
    CHANGING
      CT_FIELDCAT                  = T_FIELDCAT
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
      OTHERS                       = 3
              .
  IF SY-SUBRC <> 0.
*    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    CLEAR T_FIELDCAT.

  ENDIF.

This FM creates the catalog reading the internal table from your prog. Otherwise you had to manually build it. Normally it reads the referenced data elements from the dictionary and populates the related field catalog structures.

So if you want your column headers other than the statndard one - u will have to manually populate it.

For example - In my Internal table i have a field MATNR TYPE MARA-MATNR,

field catalog will fetch the column heading like Material , in case you want to make the heading "Component" then you will have to edit the field catalog yourself.

Hope it answers ur quetries.

Just make sure your prog width is less than 72 characters otherwise the above MERGE wont work.