7 Replies Latest reply: May 4, 2012 10:44 AM by Krupa Janiji RSS

Subtitle in alv report

Mahipalsinh Parmar
Currently Being Moderated

Dear all,

   i am creating an alv report i want to create a subtitle in alv header is it possible???????????????????

for eg.

 

sub1

sub2
mark1mark2mark3mark1mark2mark3

Here Sub1 is my perent title and mark1 mark2 and mark3 is its child title .............

  • Re: Subtitle in alv report
    Preethi Pushparaj
    Currently Being Moderated

    Hi Mahipalsinh,

     

    1. The parent title can be given in the TOP-OF-PAGE Event

    2. And the sub title such as

    mark1mark2mark3mark1mark2mark3

    can be displayed using ALV.

     

    Please refer the below Thread which has the similar requirement as yours

     

    http://scn.sap.com/thread/1410263

  • Re: Subtitle in alv report
    Rajesh Kumar
    Currently Being Moderated

    Hello ,

     

    You can aslo use  'REUSE_ALV_HIERSEQ_LIST_DISPLAY'  to display two levels of Alv titles with conecnts. You will need to populate header and item details accordingly.

     

    *ALV output

       CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

         EXPORTING

           i_callback_program       = sy-cprog

           i_callback_pf_status_set = 'PF_STATUS_SET'

           i_callback_user_command  = 'USER_ACTION'

           is_layout                = gt_layout

           it_fieldcat              = gt_fieldcat

           i_tabname_header         = 'GT_HEADER'

           i_tabname_item           = 'GT_ITEM'

           is_keyinfo               = gs_key

         TABLES

           t_outtab_header          = gt_header

           t_outtab_item            = gt_item.

     

     

    Regards,

    Rajesh

  • Re: Subtitle in alv report
    Harshad Bhingarkar
    Currently Being Moderated

    You can use FM call "REUSE_ALV_COMMENTARY_WRITE" to write the additonal Header details for your ALV.

    call this FM in "TOP-OF-PAGE" event of the ALV.

  • Re: Subtitle in alv report
    Krupa Janiji
    Currently Being Moderated

    pl read following thread    and  your issue most of similar .

    http://scn.sap.com/thread/3159254

     

    Example:

     

    TYPE-POOLS: slis, icon.

    DATA: ld_fieldcat  TYPE  slis_fieldcat_alv.
    DATA: t_alv_fieldcat      TYPE slis_t_fieldcat_alv WITH HEADER LINE,
    Alv_Layout TYPE SLIS_LAYOUT_ALV .
    DATA : it_fld TYPE slis_t_fieldcat_alv ,
            it_evt TYPE slis_t_event     ,
            wa_fld TYPE slis_fieldcat_alv   ,
            wa_evt TYPE slis_alv_event      ,
            wa_lay TYPE slis_layout_alv     .

    data:
           BEGIN OF itab OCCURS 0,
             carrid like sflight-carrid,
             connid like sflight-connid,
             planetype like sflight-planetype,
             seatsmax like sflight-seatsmax,
           END OF itab.

    START-OF-SELECTION.

    SELECT carrid connid planetype seatsmax
            FROM sflight
            INTO TABLE itab.

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
         IMPORTING
           et_events = it_evt.

       READ TABLE it_evt INTO wa_evt
            WITH KEY name = slis_ev_after_line_output .
       wa_evt-form = slis_ev_after_line_output .
       MODIFY it_evt FROM wa_evt INDEX sy-tabix .

       READ TABLE it_evt INTO wa_evt
            WITH KEY name = slis_ev_top_of_page .
       wa_evt-form = slis_ev_top_of_page .
       MODIFY it_evt FROM wa_evt INDEX sy-tabix .

       CLEAR: ld_fieldcat.
       ld_fieldcat-tabname       = 'ITAB'.
       ld_fieldcat-fieldname     = 'CARRID'.
       ld_fieldcat-ref_tabname   = 'SFLIGHT'.
       ld_fieldcat-outputlen     = '10'.
       APPEND ld_fieldcat TO t_alv_fieldcat.
       CLEAR ld_fieldcat.

       CLEAR: ld_fieldcat.
       ld_fieldcat-tabname       = 'ITAB'.
       ld_fieldcat-fieldname     = 'CONNID'.
       ld_fieldcat-ref_tabname   = 'SFLIGHT'.
       ld_fieldcat-outputlen     = '10'.
       APPEND ld_fieldcat TO t_alv_fieldcat.
       CLEAR ld_fieldcat.

         CLEAR: ld_fieldcat.
       ld_fieldcat-tabname       = 'ITAB'.
       ld_fieldcat-fieldname     = 'PLANETYPE'.
       ld_fieldcat-ref_tabname   = 'SFLIGHT'.
       ld_fieldcat-outputlen     = '10'.
       APPEND ld_fieldcat TO t_alv_fieldcat.
       CLEAR ld_fieldcat.

       CLEAR: ld_fieldcat.
       ld_fieldcat-tabname       = 'ITAB'.
       ld_fieldcat-fieldname     = 'SEATSMAX'.
       ld_fieldcat-ref_tabname   = 'SFLIGHT'.
       ld_fieldcat-outputlen     = '10'.
       APPEND ld_fieldcat TO t_alv_fieldcat.
       CLEAR ld_fieldcat.

    "This is where we exclude the standard ALV columns

    ALV_LAYOUT-no_colhead = 'X' .

       CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
         EXPORTING
           IS_LAYOUT = ALV_LAYOUT
           i_bypassing_buffer = 'X'
           i_callback_program = sy-repid
           it_fieldcat        = t_alv_fieldcat[]
           it_events          it_evt
           i_save             = 'A'
         TABLES
           t_outtab           = ITAB. "internal table

       IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.

     

    FORM top_of_page .

    "Uline for creating a horizontal line

    ULINE AT 1(45) .

    "Format color for header background

    FORMAT COLOR 7 .
    "This is where we manually create the header text,
    "in this example I'm using 2 lines header, if you
    "want to have 3 lines header or more, you can just
    "add new write command.

    WRITE: / sy-vline , 02 'HEADER 1',
    23 SY-VLINE, 25 'HEADER 2', 45 SY-VLINE.

    WRITE: / sy-vline , 02 'CARRID' ,12 sy-vline, 14 'CONNID',
    23 SY-VLINE, 25 'PLANE ', 34 SY-VLINE, 36 'SEATS MAX', 45 SY-VLINE.

    ENDFORM.