SUM icon issue in ALV Report

HI all,
I have developed an ALV Report. In the ALV display, i would like to sum see the Sum (Total) of few fields like Qty, Net value etc when i select that particular column and click the 'SUM" icon.
In my Report when i do so, the Program is displaying Runtime Error.
How to resolve this issue?
Any idea?
Regards
Pavan

You must make sure that these columns are defined correctly in the field catalog and in the internal table.  For example, make sure that the quantity field is typed as such in the internal table.
data: begin of itab occurs 0,
        qty type p decimals 2,
        end of itab.
And then in your field catalog, make sure that the DATATYPE is set correctly.
ls_fcat-datatype = 'QUAN'.
Do this may help your situation.  Also make sure that the data in these columns is all numeric.
Regards,
Rich Heilman

Similar Messages

  • Issue in ALV Report

    Hi,
    I have a issue in ALV Report for displaying one field's data into output.
    I am getting data into all other fields in ALV Report except for this field.
    This field & related fields are declared as below: in final internal table.
    sta_no     TYPE z3status,
    status(10) TYPE c,
    Here z3status is of type Char(1).
    In Report
    I have put a condition :
    IF i_tab-sta_no EQ 1.
       i_tab-status = 'Created'.
    ELSE.
       i_tab-status = 'Closed'.
    ENDIF.
    and to field catalog also i am passing right information as for every other field in ALV Report.
    Till the point use of REUSE_ALV_LIST_DISPLAY F.M also final internal table is having status field filled.
    But in output nothing gets displayed for Status field.
    Can anybody tell me what can be the issue!
    Thanks in advance.
    Thanks,
    Deep.

    Hi,
    I have no problem in data fetching into final internal table.
    Everything is coming well to REUSE_ALV_DISPLAY F.M.
    But still Status field data is not getting displayed.
    I have posted some code for reference:
            LOOP AT t_z3manboxid INTO wa_z3manboxid.
              wa_result-manifest_no     = wa_z3manboxid-zmanno.
              wa_result-item_no         = wa_z3manboxid-item_no.
              IF l_item_no NE wa_z3manboxid-item_no.
                wa_result-piece_quantity  = wa_z3manboxid-vemng.
                wa_result-unit            = wa_z3manboxid-vemeh.
                wa_result-manifester      = wa_z3manboxid-usnam.
                wa_result-manifest_sta_no = wa_z3manboxid-z3status.
                IF wa_result-manifest_sta_no EQ 1.
                  wa_result-manifest_status = c_created.
                ELSEIF wa_result-manifest_sta_no EQ 2.
                  wa_result-manifest_status = c_in_transit.
                ELSEIF wa_result-manifest_sta_no EQ 3.
                  wa_result-manifest_status = c_arrived.
                ELSEIF wa_result-manifest_sta_no EQ 4.
                  wa_result-manifest_status = c_closed.
                ENDIF.
              ENDIF.
              l_item_no  = wa_z3manboxid-item_no.
              APPEND wa_result TO t_result.
              CLEAR: wa_result, wa_z3manboxid.
            ENDLOOP.
    Building field catalog following code is added:
    For status call is as below:
      PERFORM f_build_fieldcat  USING c_tab
                                      c_manifest_status
                                      c_space
                                      c_space
                                      c_mannf_status
                                      c_space1
                                      15.
    FORM f_build_fieldcat USING p_tabname p_fldname
                                p_rtabname p_rfldname
                                p_fldhdg p_check
                                p_length.
      CLEAR t_fieldcat_ln1.
      ADD 1 TO g_col_pos.
      t_fieldcat_ln1-tabname       = p_tabname.
      t_fieldcat_ln1-fieldname     = p_fldname.
      t_fieldcat_ln1-ref_tabname   = p_rtabname.
      t_fieldcat_ln1-ref_fieldname = p_rfldname.
      t_fieldcat_ln1-ddictxt       = c_l.
      t_fieldcat_ln1-seltext_l     = p_fldhdg.
      t_fieldcat_ln1-no_zero       = space.
      t_fieldcat_ln1-do_sum        = space.
      t_fieldcat_ln1-col_pos       = g_col_pos.
      t_fieldcat_ln1-no_out        = space.
      t_fieldcat_ln1-just          = c_c.
      t_fieldcat_ln1-qfieldname    = space.
      t_fieldcat_ln1-checkbox      = p_check.
      t_fieldcat_ln1-input         = p_check.
      t_fieldcat_ln1-reptext_ddic  = p_fldhdg.
      IF p_fldname EQ c_manno.
        t_fieldcat_ln1-key     = c_x.
        t_fieldcat_ln1-hotspot = c_x.
      ELSE.
        t_fieldcat_ln1-key     = space.
        t_fieldcat_ln1-hotspot = p_check.
      ENDIF.
      t_fieldcat_ln1-outputlen      = p_length.
      t_fieldcat_ln1-intlen         = p_length.
      t_fieldcat_ln1-ddic_outputlen = p_length.
      APPEND t_fieldcat_ln1 TO t_fieldcat1.
    ENDFORM.                    " f_build_fieldcat
    FORM f_build_sortcat USING p_fldname.
      CLEAR t_sortcat_ln1.
      ADD 1 TO g_col_pos.
      t_sortcat_ln1-spos      = g_col_pos.
      t_sortcat_ln1-fieldname = p_fldname.
      t_sortcat_ln1-up        = c_x.
      t_sortcat_ln1-down      = space.
      t_sortcat_ln1-subtot    = c_x.
      APPEND t_sortcat_ln1 TO t_sortcat1.
    ENDFORM.                    " f_build_sortcat
    FORM f_build_layout.
      t_layout1-zebra           = c_x.
      t_layout1-no_vline        = c_space1.
      t_layout1-reprep          = c_x.
      t_layout1-detail_popup    = c_x.
      t_layout1-window_titlebar = text-005.
      t_layout1-no_scrolling    = c_space1.
      t_layout1-detail_titlebar = text-005.
      t_layout1-numc_sum        = c_x.
      t_layout1-get_selinfos    = c_x.
      t_layout1-min_linesize    = 132.
    ENDFORM.                    " f_build_layout
      DATA: l_pgm TYPE syrepid,
            l_exit(1) TYPE c.
      CLEAR: l_pgm,
             l_exit.
      l_pgm = sy-repid.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_callback_program      = l_pgm
                i_callback_user_command = c_user_command
                is_layout               = t_layout1
                it_fieldcat             = t_fieldcat1
                i_save                  = c_a
                it_events               = t_eventcat1
           IMPORTING
                e_exit_caused_by_caller = l_exit
           TABLES
                t_outtab                = t_result
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc NE 0.
        l_exit = l_exit.
      ENDIF.
    To ALV F.M t_result table is updated with correct data.
    But it is not getting displayed.
    What can be the reason!
    Can anybody give the solution!
    Thanks for your replies.
    Thanks,
    Deep.

  • Issue in ALV reporting

    Dear All,
    I have an issue in ALV reporting. Pls look at the follow table.
    <u>Duty Post</u>      <u>Date</u>          <u>Time</u>
    jurong                   12/06                3.45
    jurong                   13/06                3.50
    jurong                   14/06                4.50
    In the above table jurong is repeated. I do not want jurong to be repeated but other fields should be present.
    Kindly help me solve it.
    Regards,
    Karthikeyan
    <u></u><u></u>

    Hi Karthik,
    Another way of handling this without doing if else comparision is using the SORT functionality.
    I am giving an example here:
    Sort data in the output based on Duty_Post
      CLEAR itab_sort.
      itab_sort-fieldname = 'DUTY_POST' . (Replace DUTY_POST with the actual field name used in ur report)
      itab_sort-up = c_x.
      APPEND itab_sort.
      CLEAR itab_sort.
    Then while calling the ALV FM: include the ITAB_SORT table also.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
             EXPORTING
                  i_callback_program      = w_call_back_pgm
                  i_grid_title            = w_text
                  it_fieldcat             = itab_fldcat
                  it_sort                 = itab_sort[]
                  is_layout               = w_layout
                  it_events               = itab_events[]
                  i_default               = 'X'
                  i_save                  = 'A'
             IMPORTING
                  e_exit_caused_by_caller = w_exit_by_caller
                  es_exit_caused_by_user  = w_exit_by_user
             TABLES
                  t_outtab                = itab_output_gr
             EXCEPTIONS
                  program_error           = 1
                  OTHERS                  = 2.
    This way data would not repeat.
    Hope this helps.
    Rgds,
    HR

  • Icon display in alv report

    Hi all,
           I have a problem in alv report ,there are 5 fields to display and in 6th position i have to display an icon as red or green light according to data. How can i do that ? please help me .
    Thanks and regards
    Goutam

    Hi goutam,
    1. Simple
    2. we have to use the layout for this purpose.
    3. like this :
      alvly-lights_fieldname = 'LT'.
      alvly-lights_tabname = 'ITAB'.
    4. Just copy paste to get a taste of it.
      (important code has been highlighted)
    REPORT abc.
    TYPE-POOLS : slis.
    DATA : alvly TYPE slis_layout_alv.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : BEGIN OF itab OCCURS 0,
    <b>       lt TYPE i,</b>
           matnr LIKE mara-matnr,
           END OF itab.
    END-OF-SELECTION.
    <b>  itab-lt = 1.
      APPEND itab.
      itab-lt = 2.
      APPEND itab.
      itab-lt = 3.
      APPEND itab.
      itab-lt = 1.
      APPEND itab.
      itab-lt = 3.
      APPEND itab.
      itab-lt = 3.
      APPEND itab.
      itab-lt = 3.
      APPEND itab.</b>
    <b>  alvly-lights_fieldname = 'LT'.
      alvly-lights_tabname = 'ITAB'.</b>
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name     = sy-repid
          i_internal_tabname = 'ITAB'
          i_inclname         = sy-repid
        CHANGING
          ct_fieldcat        = alvfc.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          it_fieldcat        = alvfc
          is_layout          = alvly
          i_save             = 'A'
        TABLES
          t_outtab           = itab.
    regards,
    amit m.

  • Data Displaying issue in ALV report

    Hi,
      I have made a ALV report,  the presetn display layout is as below
    it is displaying the material shortage reprot against issued production order
    ORDER NO.     Order Qty.     MATERIAL     TOTAL QTY     SHORTAGE QTY
    3000000     100     610     100     5
    3000000     100     101     200     43
    3000000     100     8795     400     400
    3000000     100     456     100     67
    3000001     50     548     50     33
    3000004     62     710     62     3
    3000005     15     7895     15     15
    3000020     11     456     22     10
    now the user requirement is the report should come as per below formate
    AT EACH NEW ORDER NUMBER :
    ****************first display main order no. and order qty.
    ORDER NO.     Order Qty
    3000000     100
    ************************then below this display the indiviual material and qty.
    MATERIAL     TOTAL QTY          SHORTAGE QTY
         610            100                     5
       101              200     43
    8795     400     400
    456     100     67
    *******again at new order******
    ORDER NO.       Order Qty
      3000001         50
    **********then below display the items
    MATERIAL     TOTAL QTY          SHORTAGE QTY
      548           50                 33
    how to do this is there any output layout with this i can get this formate in LAV report
    regards,
      zafar

    Hi Zafar,
    You can populate your internal table as per the requirement.
    at new order only.
    itab-Order = 3000000 .
    itab-Order quantity = 100.
    append itab
    for all materials for that order
    itab-MATERIAL       =   610 .
    itab-TOTAL QTY  = 100 .
    itab-SHORTAGE QTY = 5.
    append itab.
    Cheers,
    Suhail

  • Sum 2 columns in alv report (not separately)

    Hi,
    I have an alv report and I use do_sum = 'X' in order to sum separately 2
    columns.
    The demand here is that at the end of the report there will also be
    a total of the 2 columns together.
    I tried to implement it but so far - no success.
    Mayby someone has an idea ??
    Promise to award points...
    Thanks.
    Ruthie.

    Hi,
    For summing say column EBELN, MATNR for eg.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
       fieldcatalog-outputlen   = 10.
      <b>fieldcatalog-do_sum      = 'X'.</b>
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      <b>fieldcatalog-do_sum      = 'X'.</b>
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    You will get the sum at the end also, try this.

  • An issue in ALV reports.

    Hi,
             I am new to ALV reporting. I have one doubt. When I am declaring the internal table as
                 itab type standard table of stucture.
    and then using merge catalog and reuse list disp FM it is not showing any output.
             I want to know why is this happening?
             Experts please help me out.

    Hai Abir
    Go through the following Code
    *& Report  ZALV_BLOCK                                                  *
    REPORT  ZALV_BLOCK NO STANDARD PAGE HEADING
                                  LINE-SIZE 150
                                  LINE-COUNT 60(4)
                                  MESSAGE-ID Z00.
    *..Type Definitions for ALV Report
    TYPE-POOLS SLIS.
    *..Includes
    *for ICONs
    *INCLUDE <ICON>.
    Table/Structure declarations.                                        *
    TABLES:  MARA,
             MARC,
             T134.
                  Types Declaration                                      *
    TYPES: BEGIN OF typ_mara,
           MATNR TYPE MARA-MATNR,
           MTART TYPE MARA-MTART,
           MATKL TYPE MARA-MATKL,
           MEINS TYPE MARA-MEINS,
           NTGEW TYPE MARA-NTGEW,
           END OF typ_mara.
    TYPES: BEGIN OF typ_marc,
           WERKS TYPE MARC-WERKS,
           LADGR TYPE MARC-LADGR,
           MTVFP TYPE MARC-MTVFP,
           DISPR TYPE MARC-DISPR,
           DISMM TYPE MARC-DISMM,
           DISPO TYPE MARC-DISPO,
           END OF typ_marc.
                  Intrnal tables Declaration                             *
    DATA: it_mara TYPE STANDARD TABLE OF typ_mara WITH HEADER LINE.
    DATA: it_marc TYPE STANDARD TABLE OF typ_marc WITH HEADER LINE.
    ALV Type declaration                                                 *
    DATA:V_NO_DATA            TYPE C.
    ALV Type declaration                                                 *
    DATA:V_REPID              TYPE SYREPID.
    DATA: IT_FIELDCATALOG_MARA   TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCATALOG_MARA   TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCATALOG_MARC   TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCATALOG_MARC   TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCATALOG_MATKL  TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCATALOG_MATKL  TYPE SLIS_FIELDCAT_ALV,
          WA_LAYOUT              TYPE SLIS_LAYOUT_ALV,
          IT_EVENTS              TYPE SLIS_T_EVENT,
          WA_EVENTS              TYPE SLIS_ALV_EVENT,
          WA_KEYINFO             TYPE SLIS_KEYINFO_ALV.
    Selection Screen.                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR ,
                    S_MTART FOR MARA-MTART .
    SELECTION-SCREEN END OF BLOCK B1.
    Event:Initialization                                                 *
    INITIALIZATION.
    *Report Name
      V_REPID = SY-REPID.
    AT Selection Screen.                                                 *
    AT SELECTION-SCREEN.
    Event: Start-of-Selection                                            *
    START-OF-SELECTION.
      PERFORM FETCH_DATA.
    Event: End-of-Selection                                            *
    END-OF-SELECTION.
      IF V_NO_DATA = ''.
        MESSAGE I010 WITH 'NO DATA TO DISPLAY ! '.
        EXIT.
      ELSE.
        PERFORM FILL_FIELDCAT_MARA.
      PERFORM FILL_FIELDCAT_MAKT.
        PERFORM FILL_FIELDCAT_MARC.
        PERFORM FILL_LAYOUT.
        PERFORM CALL_ALV_INIT.
        PERFORM ADD_LISTS.
        PERFORM DISPLAY_BLOCK_LIST.
      ENDIF.
                             FORM DEFINITIONS                            *
    *&      Form  FETCH_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM FETCH_DATA.
      SELECT MATNR
             MTART
             MATKL
             MEINS
             NTGEW
             INTO CORRESPONDING FIELDS OF TABLE IT_MARA
             FROM MARA
             WHERE MATNR IN S_MATNR
               AND MTART IN S_MTART.
      IF SY-SUBRC <> 0.
        V_NO_DATA = ''.
      ELSE.
        V_NO_DATA = 'X'.
        SELECT WERKS
               LADGR
               MTVFP
               DISPR
               DISMM
               DISPO
               INTO CORRESPONDING FIELDS OF TABLE IT_MARC
               FROM MARC
               WHERE MATNR IN S_MATNR.
      ENDIF.
    ENDFORM.                    " FETCH_DATA
    *&      Form  FILL_FIELDCAT_MARA
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_FIELDCAT_MARA.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          I_PROGRAM_NAME               = V_REPID
        I_INTERNAL_TABNAME           =
          I_STRUCTURE_NAME             = 'IT_MARA'
        I_CLIENT_NEVER_DISPLAY       = 'X'
          I_INCLNAME                   =  V_REPID
        I_BYPASSING_BUFFER           =
        I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = IT_FIELDCATALOG_MARA
        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.
      LOOP AT IT_FIELDCATALOG_MARA INTO WA_FIELDCATALOG_MARA.
        CASE WA_FIELDCATALOG_MARA-FIELDNAME.
          WHEN 'MATNR'.
            WA_FIELDCATALOG_MARA-COL_POS     = '1'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Material NO'.
          WHEN 'MTART'.
            WA_FIELDCATALOG_MARA-COL_POS     = '2'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Mat Type'.
          WHEN 'MATKL'.
            WA_FIELDCATALOG_MARA-COL_POS     = '3'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Mat Group'.
          WHEN 'MEINS'.
            WA_FIELDCATALOG_MARA-COL_POS     = '4'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Measure Unit'.
          WHEN 'NTGEW'.
            WA_FIELDCATALOG_MARA-COL_POS     = '5'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Net Wt'.
            WA_FIELDCATALOG_MARA-DO_SUM      = 'X'.
        ENDCASE.
       MODIFY IT_FIELDCATALOG_MARA FROM WA_FIELDCATALOG_MARA INDEX SY-TABIX.
      ENDLOOP.
    ENDFORM.                    " FILL_FIELDCAT_MARA
    *&      Form  FILL_FIELDCAT_MARC
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_FIELDCAT_MARC.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         I_PROGRAM_NAME               = V_REPID
         I_INTERNAL_TABNAME           = 'IT_MARC'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
         I_INCLNAME                   = V_REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = IT_FIELDCATALOG_MARC
       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.
      LOOP AT IT_FIELDCATALOG_MARC INTO WA_FIELDCATALOG_MARC.
        CASE WA_FIELDCATALOG_MARC-FIELDNAME.
          WHEN 'WERKS'.
            WA_FIELDCATALOG_MARC-COL_POS     = '1'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'PLANT NAME'.
          WHEN 'LADGR'.
            WA_FIELDCATALOG_MARC-COL_POS     = '2'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'Loading Group'.
          WHEN 'MTVFP'.
            WA_FIELDCATALOG_MARC-COL_POS     = '3'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '20'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'Checking group'.
          WHEN 'DISPR'.
            WA_FIELDCATALOG_MARC-COL_POS     = '4'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'MRP PROFILE'.
          WHEN 'DISMM'.
            WA_FIELDCATALOG_MARC-COL_POS     = '5'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'MRP TYPE'.
          WHEN 'DISPO'.
            WA_FIELDCATALOG_MARC-COL_POS     = '6'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'MRP CONTROLLER'.
        ENDCASE.
       MODIFY IT_FIELDCATALOG_MARC FROM WA_FIELDCATALOG_MARC INDEX SY-TABIX.
      ENDLOOP.
    ENDFORM.                    " FILL_FIELDCAT_MARC
    *&      Form  FILL_FIELDCAT_MAKT
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_FIELDCAT_MAKT.
    ENDFORM.                    " FILL_FIELDCAT_MAKT
    *&      Form  CALL_ALV_INIT
          text
    -->  p1        text
    <--  p2        text
    FORM CALL_ALV_INIT.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          I_CALLBACK_PROGRAM             = V_REPID
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      IT_EXCLUDING                   =
    ENDFORM.                    " CALL_ALV_INIT
    *&      Form  ADD_LISTS
          text
    -->  p1        text
    <--  p2        text
    FORM ADD_LISTS.
    *ADD IT_MARA TABLE TO THE OUTPUT
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IS_LAYOUT                        = WA_LAYOUT
          IT_FIELDCAT                      = IT_FIELDCATALOG_MARA
          I_TABNAME                        = 'IT_MARA'
          IT_EVENTS                        = IT_EVENTS
      IT_SORT                          =
      I_TEXT                           = ' '
        TABLES
          T_OUTTAB                         = IT_MARA
       EXCEPTIONS
         PROGRAM_ERROR                    = 1
         MAXIMUM_OF_APPENDS_REACHED       = 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.
    **ADD IT_MARC TABLE TO THE OUTPUT
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = WA_LAYOUT
        IT_FIELDCAT                      = IT_FIELDCATALOG_MARC
        I_TABNAME                        = 'IT_MARC'
        IT_EVENTS                        = IT_EVENTS
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MARC
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 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.
    ENDFORM.                    " ADD_LISTS
    *&      Form  FILL_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_LAYOUT.
      WA_LAYOUT-ZEBRA = 'X'.
      WA_LAYOUT-TOTALS_TEXT = 'TOTAL'.
    ENDFORM.                    " FILL_LAYOUT
    *&      Form  DISPLAY_BLOCK_LIST
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_BLOCK_LIST.
    WA_KEYINFO-HEADER01 = 'MATNR'.
    WA_KEYINFO-ITEM01 = 'MATNR'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK             = ' '
      IS_PRINT                      =
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
       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.
    ENDFORM.                    " DISPLAY_BLOCK_LIST                   .
    Thanks & regards
    Sreenivasulu P

  • Field Length issue in ALV Report

    Hi,
    I am using FM REUSE_ALV_GRID_DISPLAY to display few fields. Among them I have a field with length 200 characters text.
    During ALV report display I am able to see only 128 characters, But when I download it and see the field, the it is showing complete text.
    Can anybody help me out?
    Thanks,
    Ramakrishna

    Check out the last answer of this post.
    Re: ALV Grid Display - 255 characters
    <i>I found a SAP document called "Using ALV for list display.pdf" that says the following:
    "Size of data fields: While the list-based ALVList can display only tables of up to 90 columns, the control-based ALVGrid and ALVFullscreen have the limitation of 128 characters per data cell."</i>
    Please make sure to award point for helpful answers and mark the post as solved.  Thanks.
    Regards,
    Rich HEilman

  • Reg : Print Issue in ALV Report

    Hi Experts,
                     I have created an ALV Report for USER Requirement and it is working fine. While taking printout the SORTED Field is not working, it gets repeated in the Print... How to rectify..?

    hi,
    did u use SORT-UP equal to 'X'?
    wa_sort-up = c_x.
    ags.

  • Issue regarding ALV report

    Hi all,
             I've created an ALV report which is having a editable checkbox box field and some more fields that are not editable.
    My requirement is that when i check any checkbox, some of the fields in that particular row should become editable.
    In table control it can be done easily but can it be done in ALV.
    Note: I have created the ALV through container as it was required.
    Thanks in Advance.
    Regards
    Dheeraj

    Hi,
    Basically you will have to first register the data change event after you display the grid as follows:-
        CALL METHOD y_lobj_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>MC_EVT_MODIFIED
          EXCEPTIONS
            error      = 1
            OTHERS     = 2.
    Here Y_LOBJ_GRID is my grid object of type CL_GUI_ALV_GRID.
    Then you will have to set a handler method for this.
       SET HANDLER y_obj_evt_handler->y_m_handle_cell_modified
        FOR Y_LOBJ_GRID.
    Here y_obj_evt_handler is a local class in your program and y_m_handle_cell_modified is the method of that class.
    In this method you can change the fields to make then editable or non editable.
    Regards,
    Ankur Parab

  • How to insert the new toolbar icons to a ALV report in custom container

    Hi,
    I found the exporting parameter for excluding the toolbar icons in the method "set_table_for_first_display" but I didn't find any parameter for including the new toolbar icons. I do not want to include the toolbar icons through the PF-Status, but want to include them with the method.  Please tell me is there any option of including toolbar icons with using the above method.
    Thanks,
    Srinivas.

    Hi Srinivas,
    Refer to the link
    Adding buttons to standard alv toolbar in OOALV
    Thanks

  • Sub totals and Sort Text issue in ALV report

    Hi,
    I have requirement for list of Purchase orders.
    1st. sort the list by vendor (This i did by using sort)
    2nd. Vendor name should be display after sorting the lines.
    3rd  should count the no lines which has mark 'X' in field ELIKZ and sum the total counts and display it for every vendor after the sorted line.
    I could sort the list by vendors. but don't know how to display the vendor name after those lines. then sub total also.
    Please help
    Moderator Message: spec-dumping is not allowed. Please use the availble resources and put some effort from your end.
    Edited by: kishan P on Oct 27, 2010 3:02 PM

    Hi,
    I have requirement for list of Purchase orders.
    1st. sort the list by vendor (This i did by using sort)
    2nd. Vendor name should be display after sorting the lines.
    3rd  should count the no lines which has mark 'X' in field ELIKZ and sum the total counts and display it for every vendor after the sorted line.
    I could sort the list by vendors. but don't know how to display the vendor name after those lines. then sub total also.
    Please help
    Moderator Message: spec-dumping is not allowed. Please use the availble resources and put some effort from your end.
    Edited by: kishan P on Oct 27, 2010 3:02 PM

  • Footer issue in ALV Report

    Hi All,
    I have used the following code...Header is getting displayed properly.
    But Footer is not getting printed.....
    perform build_event.
    perform build_comment.
    FORM build_event .
    CLEAR: GT_EVENTS.  REFRESH: GT_EVENTS.
      CLEAR: FS_EVENTCAT.
      FS_EVENTCAT-NAME = 'gt_list_top_of_page'.
      FS_EVENTCAT-FORM = 'build_comment'.
      APPEND FS_EVENTCAT TO GT_EVENTS.
      CLEAR: FS_EVENTCAT.
      FS_EVENTCAT-NAME = 'gt_list_end_of_page'.
      FS_EVENTCAT-FORM = 'f_write_summary'.
      APPEND FS_EVENTCAT TO GT_EVENTS.
    ENDFORM.                    " build_event
    FORM build_comment .
    DATA: lv_info TYPE string,
            l_comcode type string,
            l_plant type string,
            ls_line TYPE slis_listheader.
              CLEAR ls_line.
    **-- Title
      ls_line-typ  = 'H'.
      ls_line-info = 'List of Sales Orders Blocked from Production and Delivery'.
      APPEND ls_line TO gt_list_top_of_page.
    clear ls_line.
    ENDFORM.                    " build_comment
    FORM F_WRITE_SUMMARY.
    data: v_date1(12) type c.
    data: v_time(10) type c.
    data: v_dtime(25) type c.
    concatenate sy-datum6(2) sy-datum4(2) sy-datum+0(4) into v_date1 separated by '-'.
    concatenate sy-uzeit0(2) sy-uzeit2(2) sy-uzeit+4(2) into v_time separated by '.'.
    concatenate v_date1 v_time into v_dtime separated by ' / '.
    ls_line-typ = c_s.
    ls_line-key = 'Date/Time:'.
    ls_line-info = v_dtime.
    append ls_line to gt_list_end_of_page.
    ENDFORM.                    " F_WRITE_SUMMARY
    Please help me....

    Refer this example -
    http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm
    Regards,
    Amit
    Reward all helpful replies.

  • Issue in ALV reporting in ME2L transaction

    Hi All,
    I have a default layout setting in the ME2L out put ( In ECC6.0,ALV grid option),where in the sort order tab,I have subtotals fuction.
    If I choose other layout,in the sort order tab,I dont find subtotals function.
    What could be the reason.
    Thanks,
    Sesahdri

    Hi
    You will have sub total option only in ALV grid display, you will not have it in classical output display.
    Regards
    Prasad

  • Use of Icon in alv report

    Hi Experts,
        How to use icon in the ALV Report ...?
    Suppose My Scenario is i have a Pending PR Report if any line item in the PR is Deleated i want to display delete icon
    Please guide me on this....
    any Kind help would be highly appricated.

    Hello friend,
    please try following codes, it works.
    types: begin of gs_outtab.
       types:   lights               type char1,
                color                type i,
                tabcol               type lvc_t_scol,
                id                   type char25, " Already exist in ICON, Flat Structure
                name                 type icon-name,
                symbol               type icon-id,
           end   of gs_outtab.
    data: gt_outtab type standard table of gs_outtab.
    data: gr_grid   type ref to cl_gui_alv_grid.
    data: gr_container type ref to cl_gui_custom_container,
          gs_layout type lvc_s_layo,
          gt_fieldcat type lvc_t_fcat.
    data: ls_vari   type disvariant.
    data: g_okcode type syucomm.
    data: gt_exc type table of ALV_S_QINF.
    data: text type string.
    selection-screen begin of block gen with frame.
    parameters:
    p_amount type i default 20.
    selection-screen end of block gen.
    selection-screen begin of block dsp with frame.
    parameters:
    p_full   radiobutton group dsp,
    p_grid   radiobutton group dsp.
    selection-screen end of block dsp.
    START-OF-SELECTION.
    END-OF-SELECTION.
       perform select_data.
       IF p_full = 'X'.
         perform display_fullscreen.
       ELSE.
         perform display_grid.
       ENDIF.
    STEP 1: load data *******************************************
    form select_data.
      select * from icon into corresponding fields of table gt_outtab
               up to p_amount rows.
    endform.
    STEP2: build full screen **************************************
    form display_fullscreen .
      data: ls_layout type slis_layout_alv,
            lt_fcat type slis_t_fieldcat_alv,
            ls_fcat type slis_fieldcat_alv.
          ls_layout-lights_tabname   = '1'.
          ls_layout-lights_fieldname = 'LIGHTS'.
          ls_layout-coltab_fieldname =  'TABCOL'.
          clear ls_fcat.
          ls_fcat-fieldname = 'LIGHTS'.
          ls_fcat-inttype = 'C'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Lights'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'COLOR'.
          ls_fcat-inttype = 'I'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Color'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'ID'.
          ls_fcat-inttype = 'C'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Icon'.
          ls_fcat-icon = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'SYMBOL'.
          ls_fcat-inttype = 'C'.
          ls_fcat-seltext_l = ls_fcat-seltext_m = ls_fcat-seltext_s = 'Symbol'.
          ls_fcat-symbol = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'NAME'.
          ls_fcat-tech = abap_true.
          append ls_fcat to lt_fcat.
          perform select_data.
          perform set_tooltips.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         IS_LAYOUT                         = ls_layout
         IT_FIELDCAT                       = lt_fcat
         IT_EXCEPT_QINFO                   = gt_exc
        TABLES
          T_OUTTAB                          = gt_outtab
       EXCEPTIONS
         PROGRAM_ERROR                     = 1
         OTHERS                            = 2
       ASSERT sy-subrc = 0.
    endform.
    STEP3: display grid ******************************************
    form display_grid.
      call screen 100.
    endform.
    STEP4: PBO ***************************************************
    module d0100_pbo output.
      perform d0100_pbo.
    endmodule.
    STEP5: PAI ***************************************************
    module d0100_pai input.
      perform d0100_pai.
    endmodule.
    STEP6: PBO form ***********************************************
    form d0100_pbo .
      set pf-status 'D0100'.
      if gr_container is not bound.
        create object gr_container
          exporting
            container_name = 'CONTAINER'.
        create object gr_grid
            exporting i_parent = gr_container.
      data: ls_layout type lvc_s_layo,
            lt_fcat type lvc_t_fcat,
            ls_fcat type lvc_s_fcat.
          ls_layout-excp_fname = 'LIGHTS'.
          ls_layout-ctab_fname =  'TABCOL'.
          clear ls_fcat.
          ls_fcat-fieldname = 'LIGHTS'.
          ls_fcat-inttype = 'C'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Lights'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'COLOR'.
          ls_fcat-inttype = 'I'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Color'.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'ID'.
          ls_fcat-inttype = 'C'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Icon'.
          ls_fcat-icon = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'SYMBOL'.
          ls_fcat-inttype = 'C'.
          ls_fcat-scrtext_l = ls_fcat-scrtext_m = ls_fcat-scrtext_s = 'Symbol'.
          ls_fcat-symbol = abap_true.
          append ls_fcat to lt_fcat.
          clear ls_fcat.
          ls_fcat-fieldname = 'NAME'.
          ls_fcat-tech = abap_true.
          append ls_fcat to lt_fcat.
      perform select_data.
      perform set_tooltips.
      data: lt_tooltips type lvc_t_qinf,
            lt_toolb type ui_functions,
            ls_toolb type UI_FUNC.
      ls_toolb = CL_GUI_ALV_GRID=>mc_fc_call_crbatch.
      append ls_toolb to lt_toolb.
      lt_tooltips = gt_exc.
      call method gr_grid->set_table_for_first_display
            exporting is_layout   = ls_layout
                 it_except_qinfo  = lt_tooltips
                 it_toolbar_excluding = lt_toolb
            changing
                  it_fieldcatalog = lt_fcat
                  it_outtab       = gt_outtab.
      endif.
    endform.
    STEP7: PAI form ******************************************************
    form d0100_pai .
      case g_okcode.
        when 'BACK' or 'EXIT' or 'CANC'.
          set screen 0.
          leave screen.
      endcase.
    endform.
    STEP8: Set Tooltip *************************************************
    FORM set_tooltips .
      field-symbols: <outtab> type gs_outtab.
      data: tooltips type ref to cl_salv_tooltips,
            settings type ref to cl_salv_functional_settings,
            ls_styl type lvc_s_styl,
            value type char128,
            text type char40,
            ls_symbol type icon,
            lt_symbol type standard table of icon,
            ls_exc type ALV_S_QINF,
            tabix type sy-tabix,
            col type lvc_s_scol.
      loop at gt_outtab assigning <outtab>.
        tabix = sy-tabix.
        read table lt_symbol index sy-tabix into ls_symbol.
        <outtab>-symbol = ls_symbol-id.
        value = <outtab>-id(3).
        text = <outtab>-name.
        concatenate value '\Q' text '@' into value.
        <outtab>-id = value.
        value = ls_symbol-id.
        text  = ls_symbol-name.
        ls_exc-type = cl_salv_tooltip=>c_type_symbol.
        ls_exc-value = value.
        ls_exc-text = text.
        append ls_exc to gt_exc.
        <outtab>-color = tabix mod 7 + 1.
        <outtab>-lights = tabix mod 3 + 1.
        col-fname = 'COLOR'.
        col-color-col = tabix mod 7 + 1.
        if tabix ge 7.
          col-color-inv = 1.
        endif.
        if tabix ge 14.
          col-color-int = 1.
        endif.
        append col to <outtab>-tabcol.
      endloop.
    ENDFORM.

Maybe you are looking for

  • Nokia 701 web browser is not working

    i have nokia 701. My phone web browser is not working. Net is working in other browsers like opera and uc browser. it's a big problem for me i can't watch online videos and i can't access to google or any other site.. I also delete the cache folder i

  • One iMac, two OSX-accounts and one iTunes Match, how do I get it to work?

    I have one iMac to work with and two different User-Accounts for my daily business. I use iTunes-Match and I would like to use it on every User-Account. On the forst Account I already acitvated iTunes-Match succesfully. But on my second User-Account

  • My I phone 5c won't connect to my wifi what's wrong with my phone?

    My iPhone 5c won't connect to my wifi. I am using my ipad connected to my woof right now. What's wrong with my phone?

  • ThinkPad Ultra Dock - 90W US 40A20090US Dual Video Vga port dropping

    We have a new lenovo 440 with this docking station.   There are two monitors hooked to both the DVD and VGA output.   Everything works most of the time but every now and then the VGA monitor goes black and wont come back until you undock and redock t

  • File Watcher/Notifier - Design Question

    I am considering a scenario that just scans a directory and notifies via email if any files exist.  Pretty simple to do with a few unix commands, but what is the best way with PI? I figure a file comm channel in test mode and then an SMTP receiver.