Skip to Content
author's profile photo Former Member
Former Member

Unable to display header using REUSE_ALV_FIELDCATALOG_

Hi SDNers,

I was working on REUSE_ALV_FIELDCATALOG_MERGE.

I am able to get the output, but it is not displaying any header on the output list.

Regards,

Ranjith N

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

10 Answers

  • Posted on Jan 15, 2009 at 11:58 AM

    hi,

    check the table is activted, no errors no warnings..

    If warnings occur even then you will not get the catalogue/

    regards,

    nazeer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 12:03 PM

    Hi,

    If you want to have the header you need to call

    FORM TOP_OF_PAGE.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    • i_logo = 'ENJOYSAP_LOGO'

    IT_LIST_COMMENTARY = GIT_LIST_TOP_OF_PAGE.

    ENDFORM.

    and then

    data: GFL_XS_EVENT TYPE SLIS_ALV_EVENT.

    CLEAR GFL_XS_EVENT.

    GFL_XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.

    GFL_XS_EVENT-FORM = 'YTOP_OF_PAGE'.

    APPEND GFL_XS_EVENT TO GIT_EVENTSITEM.

    ***Header

    DATA: LFL_LINE TYPE SLIS_LISTHEADER.

    CLEAR LFL_LINE.

    LFL_LINE-TYP = 'H'.

    LFL_LINE-INFO = 'Heading'.

    APPEND LFL_LINE TO GIT_LIST_TOP_OF_PAGE_ITEM.

    In reuse_alv_grid_display

    IT_EVENTS = GIT_EVENTSITEM

    Regards,

    Venkatesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 15, 2009 at 12:07 PM

    Hi ,

    Field catalog merge is used to build fieldcatalog, header won't be cretaed by it..

    check the below link

    http://www.sapdev.co.uk/reporting/alv/alvgrid_rephead.htm

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 12:07 PM

    Hi,

    for this

    1. you have to pass 'TOP OF PAGE' event in FM reuse alv list.

    2. Write code in FORM TOP OF PAGE

    write:/ "Top of page".

    ENDFORM.

    Regards,

    Sunil

    Edited by: Sunil Reddy Sibbala on Jan 15, 2009 1:08 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 12:41 PM

    Hi,

    I am talking about ALV list or grid header

    ie header for the columns.

    Regards,

    Ranjith N

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      Sorry for the reply which i gave.. I thought of alv header..

      Can you please tell whether the fields which you are using are of standard SAP for custom fields..If it is standard SAP then by using field_catalog_merge u will get the header.. if it is not standard fields then u have to modify the fieldcatalog..

      Please check the below sample code for that ..

      • Declaration of local workareas and internal tables

      DATA: li_sort TYPE slis_t_sortinfo_alv, "For Sort ALV

      lwa_fieldcat TYPE slis_fieldcat_alv.

      • Declaration of local constants

      CONSTANTS : lc_long_text(1) TYPE c VALUE 'L'.

      *pt_fieldcat TYPE ty_fieldcat

      *--Call the functino module to get the field catalog.

      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

      EXPORTING

      i_program_name = v_repid

      i_internal_tabname = 'I_FINAL'

      i_inclname = v_repid

      CHANGING

      ct_fieldcat = i_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.

      ELSE.

      LOOP AT i_fieldcat INTO lwa_fieldcat.

      CASE lwa_fieldcat-fieldname.

      WHEN 'GRIR'.

      lwa_fieldcat-ddictxt = lc_long_text.

      lwa_fieldcat-seltext_l = text-003.

      lwa_fieldcat-do_sum = 'X'.

      MODIFY i_fieldcat FROM lwa_fieldcat

      INDEX sy-tabix TRANSPORTING ddictxt seltext_l do_sum.

      CLEAR lwa_fieldcat.

      WHEN 'GR'.

      lwa_fieldcat-ddictxt = lc_long_text.

      lwa_fieldcat-seltext_l = text-004.

      lwa_fieldcat-do_sum = 'X'.

      MODIFY i_fieldcat FROM lwa_fieldcat

      INDEX sy-tabix TRANSPORTING ddictxt seltext_l do_sum.

      CLEAR lwa_fieldcat.

      WHEN 'IR'.

      lwa_fieldcat-ddictxt = lc_long_text.

      lwa_fieldcat-seltext_l = text-005.

      lwa_fieldcat-do_sum = 'X'.

      MODIFY i_fieldcat FROM lwa_fieldcat

      INDEX sy-tabix TRANSPORTING ddictxt seltext_l do_sum.

      CLEAR lwa_fieldcat.

      WHEN 'NETWR'.

      lwa_fieldcat-do_sum = 'X'.

      MODIFY i_fieldcat FROM lwa_fieldcat

      INDEX sy-tabix TRANSPORTING do_sum.

      CLEAR lwa_fieldcat.

      ENDCASE. " CASE lwa_fieldcat-fieldname

      ENDLOOP. " LOOP AT i_fieldcat INTO lwa_fieldcat

      ENDIF. " IF sy-subrc <> 0

      Regards,

      Nagaraj

  • Posted on Jan 15, 2009 at 12:58 PM

    Hi,

    Please copy-paste your code ?

    Thanks & Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 01:08 PM

    Hi,

    I am using standard ddic fields.

    
    *&---------------------------------------------------------------------*
    *& Report  ZVIC_INTERACTIVE_TEST1
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    
    REPORT  ZVIC_INTERACTIVE_TEST1.
    
    
    type-pools : slis.
    tables : t004.
    
    
    data : begin of t_co occurs 0,
           ktopl type ktopl,
           end of t_co.
    data : w_co like line of t_co.
    
    DATA: it_fieldcat TYPE  slis_t_fieldcat_alv.
    
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
     EXPORTING
       I_PROGRAM_NAME               = sy-repid
       I_INTERNAL_TABNAME           = 'T_CO'
    *   I_STRUCTURE_NAME             =
    *   I_CLIENT_NEVER_DISPLAY       = 'X'
       I_INCLNAME                   = sy-repid
    *   I_BYPASSING_BUFFER           =
    *   I_BUFFER_ACTIVE              =
      CHANGING
        ct_fieldcat                  = it_fieldcat
    * EXCEPTIONS
    *   INCONSISTENT_INTERFACE       = 1
    *   PROGRAM_ERROR                = 2
    *   OTHERS                       = 3
              .
    SELECT ktopl FROM t004 INTO CORRESPONDING FIELDS OF w_co UP TO 20 ROWS.
    append w_co to t_co.
    endselect.
    
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
     EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = sy-repid
    *   I_CALLBACK_PF_STATUS_SET          = ' '
    *   I_CALLBACK_USER_COMMAND           = ' '
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
    *   I_GRID_TITLE                      =
    *   I_GRID_SETTINGS                   =
    *    IS_LAYOUT                         = layout
        IT_FIELDCAT                       =  it_fieldcat
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
    *   I_SAVE                            = ' '
    *   IS_VARIANT                        =
    *   IT_EVENTS                         =
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          = T_CO
    * EXCEPTIONS
    *   PROGRAM_ERROR                     = 1
    *   OTHERS                            = 2
              .
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    
    

    Regards,

    Ranjith N

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 01:31 PM

    Hi,

    Thanks it worked.

    Regards,

    Ranith N

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2009 at 01:32 PM

    Hi,

    What if we are working on custom tables

    then how do i get the list header

    Regards,

    Ranjith N

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2009 at 09:18 AM

    answered

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.