How to mention subheadings in alv report

hi all,
iam sending my report below.
here line items are coming but header is not coming anybody can tell me what shall i do .
report zmahi3.
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
      IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      L_LAYOUT type slis_layout_alv,
     x_events type slis_alv_event,
      it_events type slis_t_event with header line. "SLIS_T_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
      VBELN LIKE VBAK-VBELN,
      POSNR LIKE VBAP-POSNR,
      MALE type i,
      female type i,
      PLANE(10),
      ACTUAL(10),
      PLANE1(10),
      ACTUAL1(10),
     END OF ITAB.
SELECT VBELN
       POSNR
       FROM VBAP
       UP TO 20 ROWS
       INTO TABLE ITAB.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = text-020."'Planned cost'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-OUTPUTLEN = 10 .
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = text-053."'Actual cost '.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2."1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'MALE'.
X_FIELDCAT-SELTEXT_L = 'MALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'FEMALE'.
X_FIELDCAT-SELTEXT_L = TEXT-T01."'FEMALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
  it_events-NAME = SLIS_EV_TOP_OF_PAGE.
  it_events-FORM = 'TOP_OF_PAGE'.
  APPEND iT_EVENTS.
  CLEAR it_events .
  L_LAYOUT-NO_COLHEAD = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM       = SY-REPID
    IS_LAYOUT                = L_LAYOUT
    IT_FIELDCAT              = IT_FIELDCAT
    it_events                = it_events[]
  TABLES
    T_OUTTAB                 = ITAB
  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.
FORM TOP_OF_PAGE.
*-To display the headers for main list
    FORMAT COLOR COL_HEADING.
        WRITE: / SY-ULINE(143).
    WRITE: /   SY-VLINE,
          (8) 'LAST YEAR' ,
              SY-VLINE,
          (10)  ' ' ,
               SY-VLINE,
         (19) 'CURRENT YEAR'(020) centered,
           (19) 'CURRENT YEAR'(020),
               sy-vline.
    WRITE: /   SY-VLINE,
          (8) 'PLANE'(053) ,
               SY-VLINE,
          (8) 'ACTUAL'(054) ,
              SY-VLINE,
          (8) 'MALE'(056) ,
               sy-vline,
           (9)  'FEMALE'(057) ,
               sy-vline.
    FORMAT COLOR OFF.
ENDFORM.
thanks,
maheedhar.t

HI,
check this....
TYPE-POOLS: SLIS.
DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
L_LAYOUT type slis_layout_alv,
x_events type slis_alv_event,
it_events type slis_t_event with header line. "SLIS_T_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
POSNR LIKE VBAP-POSNR,
MALE type i,
female type i,
indian type i,
american type i,
PLANE(10),
ACTUAL(10),
PLANE1(10),
ACTUAL1(10),
END OF ITAB.
SELECT VBELN
POSNR
FROM VBAP
UP TO 20 ROWS
INTO TABLE ITAB.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-SELTEXT_L = 'Planned cost'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 1.
X_FIELDCAT-OUTPUTLEN = 10 .
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-SELTEXT_L = 'Actual cost '.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 2."1.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'MALE'.
X_FIELDCAT-SELTEXT_L = 'MALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'FEMALE'.
X_FIELDCAT-SELTEXT_L = 'FEMALE'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 3.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'INDIAN'.
X_FIELDCAT-SELTEXT_L = 'INDIAN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 4.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
X_FIELDCAT-FIELDNAME = 'AMERICAN'.
X_FIELDCAT-SELTEXT_L = 'AMERICAN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = 4.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
it_events-NAME = SLIS_EV_TOP_OF_PAGE.
it_events-FORM = 'TOP_OF_PAGE'.
APPEND iT_EVENTS.
CLEAR it_events .
L_LAYOUT-NO_COLHEAD = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
*IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
it_events = it_events[]
TABLES
T_OUTTAB = ITAB
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.
FORM TOP_OF_PAGE.
*-To display the headers for main list
FORMAT COLOR COL_HEADING.
WRITE: / SY-ULINE(143).
WRITE: / SY-VLINE,
(8) 'LAST YEAR' ,
SY-VLINE,
(11) ' ' ,
SY-VLINE,
(19) 'CURRENT YEAR'(020) centered,
(19) 'CURRENT YEAR'(020),
sy-vline,
<b>(21) 'NATIONALITY'(015) ,
sy-vline.</b>
WRITE: / SY-VLINE,
(8) 'PLANE'(053) ,
SY-VLINE,
(9) 'ACTUAL'(057) ,
SY-VLINE,
(8) 'MALE'(056) ,
sy-vline,
(8) 'FEMALE'(057) ,
sy-vline,
<b>(8) 'INDIAN'(057) ,
sy-vline,
(8) 'AMERICAN'(057) ,
sy-vline.</b>
FORMAT COLOR OFF.
ENDFORM.
do reward if it helps,
priya.

Similar Messages

  • How to devolped an Interactive ALV Report to display sales orders

    hi,
             how to devolped an Interactive ALV Report to display sales orders pertaining to the selected Customers and item details in the secondary list.For this report what are the tables and fields wehave to used give with example.
    thank you
    radhakrishna

    Hi,
    look via se38 for BCALV* and SALV*.
    Try ABAPDOCU.
    Regards, Dieter

  • How to upload logos in alv reports

    how to upload logos in alv reports?

    Hi Kishore,
    ALV LOGO
    Re: How do I insert a logo in ALV using Function Modules?
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm
    Steps for uploading Logo :-:
    1. Goto the transaction OAER
    2. Enter the class name as 'PICTURES'
    3. Enter the class type as 'OT'
    4. Enter the object key as the name of the logo you wish to give
    5. Execute
    6. Then in the new screen select Standard doc. types in bottom window
    Click on the Screen icon
    Now, it will ask for the file path where you have to upload the logo
    7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE
    Here you go !!
    *& Form TOP_OF_PAGE
    text
    FORM F_TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = IT_LISTHEADER
    i_logo = Logo name
    I_END_OF_LIST_GRID =.
    ENDFORM. "TOP_OF_PAGE
    Hope this helps.
    Manish

  • How To add Logo in ALV Report

    Hi,
    How To add Logo in ALV Report?
        I need step by step explanation.

    Hi uday,
    go through this hope u can understand.
    *&amp;amp; Report Z_OOALV_LOGO
    *&--Sample Program using ooalv-> by SrikanthV--
    REPORT z_ooalv_logo.
    ****DECLARATION FOR LOGO INSERT
    CONSTANTS: cntl_true TYPE i VALUE 1,
    cntl_false TYPE i VALUE 0.
    DATA:h_picture TYPE REF TO cl_gui_picture,
    h_pic_container TYPE REF TO cl_gui_custom_container.
    DATA: graphic_url(255),
    graphic_refresh(1),
    g_result LIKE cntl_true.
    DATA: BEGIN OF graphic_table OCCURS 0,
    line(255) TYPE x,
    END OF graphic_table.
    DATA: graphic_size TYPE i.
    CALL SCREEN 100.
    *&amp;----
    *& Module PICTURE OUTPUT
    text
    MODULE picture OUTPUT.
    DATA: l_graphic_xstr TYPE xstring,
    l_graphic_conv TYPE i,
    l_graphic_offs TYPE i.
    CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
    EXPORTING
    p_object = 'GRAPHICS'
    p_name = 'EDS'"IMAGE NAME - Image name from SE78
    p_id = 'BMAP'
    p_btype = 'BCOL'
    RECEIVING
    p_bmp = l_graphic_xstr
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    graphic_size = XSTRLEN( l_graphic_xstr ).
    CHECK graphic_size > 0.
    l_graphic_conv = graphic_size.
    l_graphic_offs = 0.
    WHILE l_graphic_conv > 255.
    graphic_table-line = l_graphic_xstr+l_graphic_offs(255).
    APPEND graphic_table.
    l_graphic_offs = l_graphic_offs + 255.
    l_graphic_conv = l_graphic_conv - 255.
    ENDWHILE.
    graphic_table-line = l_graphic_xstr+l_graphic_offs(l_graphic_conv).
    APPEND graphic_table.
    CALL FUNCTION 'DP_CREATE_URL'
    EXPORTING
    type = 'image'
    subtype = cndp_sap_tab_unknown " 'X-UNKNOWN'
    size = graphic_size
    lifetime = cndp_lifetime_transaction "'T'
    TABLES
    data = graphic_table
    CHANGING
    url = graphic_url
    EXCEPTIONS
    dp_invalid_parameter = 1
    dp_error_put_table = 2
    dp_error_general = 3
    OTHERS = 4 .
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    EXIT.
    ENDIF.
    CREATE OBJECT h_pic_container
    EXPORTING container_name = 'LOGO'.
    CREATE OBJECT h_picture EXPORTING parent = h_pic_container.
    CALL METHOD h_picture->load_picture_from_url
    EXPORTING
    url = graphic_url
    IMPORTING
    RESULT = g_result.
    ENDMODULE. " PICTURE OUTPUT
    Reward points if helpful.
    Thanks

  • How to find the customised alv reports

    Hi guys,
    I m working on a alv-grid report in PP.I want to know how can i find the alv reports already been created in the system.
    Thanks in advance.

    hi,
    GO to se37
    give the fm name
    reuse_alv_grid_display
    reuse_alv_LIST_display
    and clik the where used list
    and select programs
    and in that list check out the zprograms or y programs
    then you can see it
    regards,
    Venkatesh

  • How to get total in ALV report in same Internal table?

    Data : Begin of it_data,
            kunnr type kunnr,
            name1 type name1,
            amt1  type btrt01, " CURR 15,2
           end of it_data.
    loop at it_data into wa_data
    endloop.      
    Hello friends,
    I am developing one ALV report with 20 rows.
    I have filled one internal table with some fileds like amount.
    I want to get total of all amount1 in AMT1 field.
    So, How to get total of amount in same internal table in ALV report ?
    It is ok if i get duplicate rows in internal table.
    Points 'll be awarded soon.
    Regards,
    NVM

    Hi Ronny,
    the alv output will display the sum at the last row.
    for this functionality u have do this logic.
    data: lw_fcat type slis_fieldcat_alv.
    data: lt_fcat type slis_t_fieldcat_alv/
    wa_fcat-fieldname = 'AMT1'.
    wa_fcat-tabname = 'ITAB'.
    wa_fcat-do_sum = 'X'.
    append wa_fcat to lt_fcat.
    and then pass it to reuse_alv_grid_display function,
    regards,
    Santosh Thorat

  • How to add button in ALV report (Class method )?

    Hello experts,
    I have developed one ALV report using classes.
    I want to add one more  button on the report like already is there named DISPLQUA
    How ca i do that here?
    Following the code of CLASS definition & implimentation
    CLASS lcl_handle_events DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_on_user_command FOR EVENT added_function OF cl_salv_events
            IMPORTING e_salv_function.
    ENDCLASS.                    "lcl_handle_events DEFINITION
          CLASS lcl_handle_events IMPLEMENTATION
    CLASS lcl_handle_events IMPLEMENTATION.
      METHOD handle_on_user_command.
        CASE e_salv_function.
          WHEN 'DISPLQUA'.
            PERFORM show_quant_record.
         WHEN 'DISPQM03'.                                " Here i want to add button
           PERFORM display_quality_notification.
          WHEN OTHERS.
        ENDCASE.
      ENDMETHOD.                    "handle_on_user_command
    ENDCLASS.                    "lcl_handle_events IMPLEMENTATION

    HI Ronny.
    Code snippet for reference.
    CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION.
        METHODS :
    *--Toolbar control
          HANDLE_TOOLBAR FOR EVENT TOOLBAR
            OF CL_GUI_ALV_GRID IMPORTING E_OBJECT
                                         E_INTERACTIVE,
    ENDCLASS
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
    *--handle toolbar
      METHOD HANDLE_TOOLBAR.
    * append a separator to normal toolbar
        CLEAR G_TOOLBAR.
        G_TOOLBAR-BUTN_TYPE = 3.
        APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
        CLEAR G_TOOLBAR.
        G_TOOLBAR-FUNCTION = 'SAVE'.
        G_TOOLBAR-ICON = ICON_SYSTEM_SAVE.
        G_TOOLBAR-BUTN_TYPE = 0.
        G_TOOLBAR-QUICKINFO = 'Save the Customer'(203).
        APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
      ENDMETHOD.                    "HANDLE_TOOLBAR
    Hope this helps.
    Gary.
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Apr 7, 2008 5:41 PM

  • Subheadings in ALV Report

    hi all,
    in the ALV report i  have 3 final internal tables .
    these 3 final table data displays in the output.
    the output is as follows
    First Internal table:
    MATERIAL   PLANT  SALES       AMOUNT   QUANTIY
    Second Internal table:
    MATERIAL   PLANT  SALES       AMOUNT   QUANTIY  DIVISION
    Third  Internal table:
    MATERIAL   AMOUNT   QUANTIY
    now i need the output as, before the data dispaly i need subheading for every internal table as
    MATERIAL DATA1:
    MATERIAL   PLANT  SALES       AMOUNT   QUANTIY
    MATERIAL DATA2:
    MATERIAL   PLANT  SALES       AMOUNT   QUANTIY  DIVISION
    MATERIAL DATA3:
    MATERIAL   AMOUNT   QUANTIY
    Please help me to get subheadings in the ALV Report.
    thanks in advance.

    look at example report
    BCALV_TREE_01
    BCALV_TREE_02
    BCALV_TREE_03
    BCALV_TREE_....

  • How to display icon in alv report output

    hi,
    my ewquirement in in alv report in one column to diaplay the icon(tickmark) based on some codition.
    how to achieve it??
    condition is
    Affected (Locked on Current ECM) u2013 can use symbols    for affected and   for changing u2013
    u2022     Lock AEOI u2013 CCLCK for AE01-OBJKT (Material) lock.
    Condition:
      If AEOI u2013 CCLCK is activated then display symbols  (tickmark)  in line of their AE01-OBJKT (Material). else display
    (x mark)

    Hi,
    In field catalog of grid set
    Ex--
    when 'Field'.
      lwa_fcat-icon      = c_true.
    based on your condition
    set the desired icon in table.
    Ex.... lwa_table-field = icon_tick.

  • How to create Status in ALV reports?

    Hi experts,
                     I need to create a status in a alv report. but i am not getting how to create it. i have declared a variable type slis_formname. and appended the events with it. now how to create the status in form.answers will be rewarded.
    Thanks in advance,
    Ramana

    Hello Venkat,
    Copy the standard pf status of the ALV in SE41 and do the following.
      DATA: IT_EVENTS TYPE SLIS_T_EVENT,
            WA_EVENTS LIKE LINE OF IT_EVENTS.
      REFRESH: IT_EVENTS.
      CLEAR: WA_EVENTS,IT_EVENTS.
      WA_EVENTS-NAME = 'PF_STATUS_SET'.
      WA_EVENTS-FORM = 'STATUS'.
      APPEND WA_EVENTS TO IT_EVENTS .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM      = IT_VARIANT-REPORT
                I_CALLBACK_TOP_OF_PAGE  = 'TOP_OF_PAGE'
                I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                IT_FIELDCAT             = IT_FIELDCAT
                I_SAVE                  = 'A'
                IS_VARIANT              = IT_VARIANT
                IT_SORT                 = IT_SORT
                IT_EVENTS               = IT_EVENTS
           TABLES
                T_OUTTAB                = G_T_OUTTAB
           EXCEPTIONS
                PROGRAM_ERROR           = 1
                OTHERS                  = 2.
          FORM status                                                   *
    FORM STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD' EXCLUDING RT_EXTAB.
    ENDFORM.
    If useful reward.
    Vasanth

  • How to color row in ALV report?

    hi
    I am creating an ALV report using factory method.
    my report is based on itab which contain 3 coulms, 1 column is ERROR_TYPE . how can i color all the rows which contain E in error_type ???
    thanks
    Ami

    TABLES:LFA1.
    SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    REGIO LIKE LFA1-REGIO,
    SORTL LIKE LFA1-SORTL,
    CFIELD(4) TYPE C,
    END OF ITAB.
    data:col(4).
    data:num value '1'.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
    IN LIFNR.
    LOOP AT ITAB.
    concatenate 'C' num '10' into col .
    ITAB-CFIELD = col.
    num = num + 1.
    if num = '8'.
    num = '1'.
    endif.
    MODIFY ITAB.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA:EVE TYPE SLIS_T_EVENT WITH HEADER LINE.
    LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    LAYOUT-WINDOW_TITLEBAR = 'VENDORS DETAILS SCREEN'.
    LAYOUT-EDIT = 'X'.
    LAYOUT-info_fieldname = 'CFIELD'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    this is for coloring cols
    REPORT ZBHCOLOR_COLS.
    TABLES:LFA1.
    SELECT-OPTIONS:C_LIFNR FOR LFA1-LIFNR. " FOR GRID ONLY
    PARAMETERS:LIST RADIOBUTTON GROUP ALV DEFAULT 'X',
    GRID RADIOBUTTON GROUP ALV.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    SORTL LIKE LFA1-SORTL,
    REGIO LIKE LFA1-REGIO,
    COL TYPE LVC_T_SCOL,
    END OF ITAB.
    DATA:COLR TYPE LVC_S_SCOL.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
    LOOP AT ITAB.
    IF ITAB-LIFNR IN C_LIFNR.
    COLR-FNAME = 'NAME1'.
    COLR-COLOR-COL = '5'.
    COLR-COLOR-INT = '1'.
    COLR-COLOR-INV = '0'.
    COLR-NOKEYCOL = 'X'.
    APPEND COLR TO ITAB-COL.
    COLR-FNAME = 'LIFNR'.
    APPEND COLR TO ITAB-COL.
    MODIFY ITAB.
    ENDIF.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    LAYOUT-ZEBRA = 'X'.
    layout-coltab_fieldname = 'COL'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    IF LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ELSEIF GRID = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ENDIF.
    Reward points if useful.

  • How to Input Value in  ALV report at reuntime...?

    Dear All,
    How to Input Value or change the value of a field in  ALV report at runtime...?
    regards,

    HI,
    To input value in ALV you have to make it editable.
    to change values at runtime you have to capture some events and then change your values in internal table which is used to display alv.
    Here is an example of editable ALV.
    <b>REPORT ZWA_ALV_EDITABLE_FM .
    type-pools: slis.
    data: gs_layout type slis_layout_alv.
    DATA: d_ref TYPE REF TO data.
    DATA: itab type table of fmfint.
    SELECT * FROM fmfint
    INTO TABLE itab.
    gs_layout-edit = 'X'.
    * Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
         exporting
              i_callback_program      = 'ZWA_ALV_EDITABLE_FM'
              i_callback_user_command = 'USER_COMMAND'
              i_structure_name        =  'fmfint'
              is_layout               = gs_layout
         tables
              t_outtab                = itab.
    form user_command using r_ucomm type sy-ucomm
                            rs_selfield type slis_selfield.
      if r_ucomm = '&DATA_SAVE'.
        message i000(SU) with 'saved'.
        MODIFY fmfint FROM TABLE itab.
        call function 'REUSE_ALV_LIST_DISPLAY'
             exporting
                  i_structure_name = 'fmfint'
             tables
                  t_outtab         = itab.
      endif.
    endform.</b>
    Regards,
    Wasim Ahmed

  • How to create an interactive alv report in which some parameters

    hi all,
    i want to create an interactive alv report in which some parameters in selection screen
    & when fill those & press f8 then an alv list display will show & when user double click on
    any row then those contents get shown in header details of module pool program  which call by
      tcode mentioned in same alv .And same an interactive alv report used for change & display.
    please help me give me some code same as  required above.
    ketan
    abap consultant.
    Edited by: ketan pande on Feb 14, 2009 6:09 AM

    Hi Ketan,
    Please find Sample Code.
    TYPE-POOLS:slis.
    DATA:
      w_carrid TYPE scarr-carrid,
      it_fieldcat TYPE slis_t_fieldcat_alv,
      fs_fieldcat LIKE LINE OF it_fieldcat,
      it_eventcat TYPE slis_t_event,
      fs_eventcat LIKE LINE OF it_fieldcat.
    DATA:
      t_spfli LIKE STANDARD TABLE OF spfli,
      fs_spfli LIKE LINE OF t_spfli,
      t_sflight LIKE STANDARD TABLE OF sflight,
      fs_sflight LIKE LINE OF t_sflight.
    SELECT-OPTIONS:
      s_carrid FOR w_carrid.
    START-OF-SELECTION.
      SELECT * FROM spfli INTO TABLE t_spfli WHERE carrid IN s_carrid.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = sy-repid
          i_callback_user_command = 'PICK'
          i_structure_name        = 'SPFLI'
        TABLES
          t_outtab                = t_spfli
        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.
    *&      Form  PICK
    FORM pick USING command LIKE sy-ucomm
                    selfield TYPE slis_selfield.
      READ TABLE t_spfli INTO fs_spfli INDEX selfield-tabindex.
      CASE command.
        WHEN '&IC1'.
          SELECT * FROM sflight
          INTO TABLE t_sflight
         WHERE carrid = fs_spfli-carrid
           and connid = fs_spfli-connid.
          CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
             i_program_name               = sy-repid
           I_INTERNAL_TABNAME           =
             i_structure_name             = 'SFLIGHT'
           I_CLIENT_NEVER_DISPLAY       = 'X'
           I_INCLNAME                   =
           I_BYPASSING_BUFFER           =
           I_BUFFER_ACTIVE              =
            CHANGING
              ct_fieldcat                  = it_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.
          ENDIF.
          CALL FUNCTION 'REUSE_ALV_LIST_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_STRUCTURE_NAME               =
           IS_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_eventcat
           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
           IR_SALV_LIST_ADAPTER           =
           IT_EXCEPT_QINFO                =
           I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
         IMPORTING
           E_EXIT_CAUSED_BY_CALLER        =
           ES_EXIT_CAUSED_BY_USER         =
            TABLES
              t_outtab                       = t_sflight
          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.
      ENDCASE.
    ENDFORM.                    "pick
    Hope this will Be Helpful
    Thanks
    Kalyan

  • How can i download dynamic alv report into excel  ?

    when i create dynamic alv report and try to download it
    to my pc ( to excel file ) the data is not set in the
    write position , also i get message in the excel
    "Dynamic List Display " .
    how can i set the data like the alv display ?

    ALV has standard download functionality to Excel. Aren't you able to use this functionality? Have you written your own custom code for DOWNLOAD?

  • How to use subtotal in ALV report

    hi all,
    I need to find subtotal say for Event_ID(type numc) and this should come in the ALV grid intial screen itself.
    I have coded like
      gs_sort1-spos       = '1'.
      gs_sort1-fieldname  = 'EVENT_ID'.
      gs_sort1-up         = 'X'.
      gs_sort1-subtot     = 'X'.
      APPEND gs_sort1 TO gt_sort1.
    and declare gt_sort1 in FM' REUSE_ALV_GRID_DISPLAY'.. but I am  not getting the subtotal in the ALV screen
    points will be rewarded
    thanks in advance
    it is urgent

    Hi Jayasree,
    Plerase check this program
    REPORT z_demo_alv_sort.
    * This program lists orders (VBAK) with sort and sub-total for        *
    * 'sold-to-party' (KUNNR) and 'Sales organization' (VKORG)            *
    TABLES : vbak.
    TYPE-POOLS: slis.                      " ALV Global types
    SELECT-OPTIONS :
      s_vkorg FOR vbak-vkorg,              " Sales organization
      s_kunnr FOR vbak-kunnr,              " Sold-to party
      s_vbeln FOR vbak-vbeln.              " Sales document
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
    PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    DATA:
      BEGIN OF gt_vbak OCCURS 0,
        vkorg LIKE vbak-vkorg,             " Sales organization
        kunnr LIKE vbak-kunnr,             " Sold-to party
        vbeln LIKE vbak-vbeln,             " Sales document
        netwr LIKE vbak-netwr,             " Net Value of the Sales Order
        waerk LIKE vbak-waerk,             " Document currency
      END OF gt_vbak.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data.
      PERFORM f_display_data.
    *      Form  f_read_data
    FORM f_read_data.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
               FROM vbak
                 UP TO p_max ROWS
              WHERE kunnr IN s_kunnr
                AND vbeln IN s_vbeln
                AND vkorg IN s_vkorg.
    ENDFORM.                               " F_READ_DATA
    *      Form  f_display_data
    FORM f_display_data.
      DEFINE m_fieldcat.
        add 1 to ls_fieldcat-col_pos.
        ls_fieldcat-fieldname   = &1.
        ls_fieldcat-ref_tabname = 'VBAK'.
        ls_fieldcat-do_sum      = &2.
        ls_fieldcat-cfieldname  = &3.
        append ls_fieldcat to lt_fieldcat.
      END-OF-DEFINITION.
      DEFINE m_sort.
        add 1 to ls_sort-spos.
        ls_sort-fieldname = &1.
        ls_sort-up        = 'X'.
        ls_sort-subtot    = &2.
        append ls_sort to lt_sort.
      END-OF-DEFINITION.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv,
        lt_sort     TYPE slis_t_sortinfo_alv,
        ls_sort     TYPE slis_sortinfo_alv,
        ls_layout   TYPE slis_layout_alv.
      m_fieldcat 'VKORG' ''  ''.
      m_fieldcat 'KUNNR' ''  ''.
      m_fieldcat 'VBELN' ''  ''.
      m_fieldcat 'NETWR' 'X' 'WAERK'.
      m_fieldcat 'WAERK' ''  ''.
      m_sort 'VKORG' 'X'.                  " Sort by vkorg and subtotal
      m_sort 'KUNNR' 'X'.                  " Sort by kunnr and subtotal
      m_sort 'VBELN' ''.                   " Sort by vbeln
      ls_layout-cell_merge = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                is_layout   = ls_layout
                it_fieldcat = lt_fieldcat
                it_sort     = lt_sort
           TABLES
                t_outtab    = gt_vbak.
    ENDFORM.                               " F_DISPLAY_DATA
    Hope this helps...
    Best regards,
    raam

Maybe you are looking for

  • Streaming from icloud to ipad

    Hi, Not sure if this has been asked before but...... I was wondering if it is possible to stream iCloud content (movies, or tv shows) directly to my Mac Book Pro rather than just streaming to my Apple TV? As my Mac has a monitor, I would sometimes li

  • I type in the code on the iTunes gift card but it says it has not been activated? Please help me.

    I type in the code on the iTunes gift card but it says it has not been activate? Please help.

  • Quicktime Won't Open

    About a month ago I reinstalled Windows XP Pro SP2. Instead of installing Quicktime, I installed the Quicktime Alternative which has worked for me in the past. I could never open .mov files in firefox or media player classic. I finally got fed up wit

  • Nov. 10 - Folio Producer Service Update

    At 5:00 PM PST, the Folio Producer Service on the web will be updated. This update requires you to update the Folio Builder panel: Mac OS: Download Folio Builder panel Windows: Download Folio Builder panel This update includes support for the Single

  • So I bought "Seagate Backup Plus" to back up my files

    Everything seemed to have been backed up fine I guess. It probably didn't work out the way I would have hoped for or something probably went wrong with it but to my knowledge, it said the backup was complete. But anyways, I'm using Time Machine with