Performnace issue alv report

Hi,
We have developed an complex ALV report which accesses the data from FI Tables like BKPF, BSEG, BSAK etc., SALES,MM,PP etc..This report is running in development server but in production taking lot of time and shoing time out error.
1) How can I improve the performance of the report. Especially to access data from huge database table like BSEG with lot of conditions. Any best practices
Please help me.
Moderator message: frequently discussed, please read the sticky threads of this forum for approaches to find performance problems.
Edited by: Thomas Zloch on Jan 25, 2012

Hi KK,
Check the tables declaration,indexes and selection criteria also.Execute and track in which selection is taking more time.
Regards,
Madhu.

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.

  • 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 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

  • ALV Report Output Print issue with more Columns

    Hi Experts ,
                             I'm facing an issue while printing an ALV report which has around 22 columns .If i reduce the column display in the code . I'm able to print but not with 22 columns.. I have used Line-size = 1023 and line-count = 60 , but still the problem persists .
    I also searched in SDN with similar issue but managed to get only the above solution which is not working .
    Any other ways of doing it , kindly suggest .
    Many Thanks,
    Kumaran

    175 characters is the maximum number of characters that can be generated in a line of a spool (next characters are stored on the next line of the spool). When the spool is printed, these line feeds are respected.
    What is possible (I don't know) is that ALV chooses its own format type instead of the format type you have chosen when you run your program in background. To check that, just look at spool attributes (SP01).

  • ALV report - Print issues

    When trying to print an ALV report (Ctrl+P), printer has issues due to the shading (backgound colors) of the report.
    So here is my question,
    Is there a way to supress the report formatting while printing?
        or
    Can you convert an ALV into an unfomatted basic report?

    In the output screen
    GOTO  LIST IN THE MENU
    SELECT EXPORT IN IT
    THEN SELECT EXPORT SPREAD SHEET
    to get other basic format for the alv output.

  • 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

  • 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

  • Issue in displaying header details in ALV report

    Hi,
    I have used slis_t_listheader and REUSE_ALV_COMMENTARY_WRITE to display the header details in ALV report.I want the details to be displayed as below.
    Requester : ----------------------                                                                               Page: 1
    Program: -----------------------                                                                                Date:---------
                                                                     Title of Report
    But when I use the structure slis_t_listheader to display the header details,all the fields are coming one below the other.
    How can I get the fields as shown in the above format
    Edited by: Abaper12345 on Jun 25, 2009 7:54 AM

    Hi,
    Go through following code... its showing the data exactly the way you want....
    REPORT  TEST3.
    TYPE-POOLS:slis.
    TABLES:MARA.
    *Type Declaration
    TYPES:BEGIN OF t_mara,
          matnr TYPE mara-matnr,
          ersda TYPE mara-ersda,
          ernam TYPE mara-ernam,
          END OF t_mara.
    *Internal Table
    data:it_mara type standard table of t_mara.
    *Work Area
    data:wa_mara type t_mara.
    DATA:i_repid TYPE sy-repid .
    i_repid = sy-repid.
    *Declaration for field catalog
    DATA : fcat TYPE slis_t_fieldcat_alv,
           wa_fcat TYPE slis_fieldcat_alv.
    *Declaration for Layout
    data : WA_LAYOUT type SLIS_LAYOUT_ALV.
    *Initializing ColumnWidth_Optimize For Layout
      WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    START-OF-SELECTION
    START-OF-SELECTION.
    *Fetching data into internal tables
      PERFORM get_data.
    *Buil Fieldcatalog
      PERFORM build_fcat.
    *Display ALV Report
      PERFORM alv_display.
    *Build Fieldcat
    FORM build_fcat .
      wa_fcat-tabname = 'IT_MARA'.
      wa_fcat-fieldname = 'MATNR'.
      wa_fcat-inttype = 'C'.
      wa_fcat-seltext_m = 'Material Number'.
      wa_fcat-outputlen = 25.
      wa_fcat-col_pos = 1.
      APPEND wa_fcat TO fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'IT_MARA'.
      wa_fcat-fieldname = 'ERSDA'.
      wa_fcat-inttype = 'C'.
      wa_fcat-seltext_m = 'Date'.
      wa_fcat-outputlen = 25.
      wa_fcat-col_pos = 1.
      APPEND wa_fcat TO fcat.
      CLEAR wa_fcat.
      wa_fcat-tabname = 'IT_MARA'.
      wa_fcat-fieldname = 'ERNAM'.
      wa_fcat-inttype = 'C'.
      wa_fcat-seltext_m = 'User'.
      wa_fcat-outputlen = 25.
      wa_fcat-col_pos = 1.
      APPEND wa_fcat TO fcat.
      CLEAR wa_fcat.
      endform.
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    form GET_DATA .
    select matnr ersda ernam from mara into table it_mara.
    endform.                    " GET_DATA
    *&      Form  ALV_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form ALV_DISPLAY .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = i_repid
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
       I_CALLBACK_HTML_TOP_OF_PAGE       = 'HTML_TOP_OF_PAGE'
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = fcat
      TABLES
        t_outtab                          = it_mara
    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.                    " ALV_DISPLAY
    *&      Form  html_top_of_page " I_CALLBACK_HTML_TOP_OF_PAGE  "
    FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
    CALL METHOD document->add_text
      EXPORTING
        text          = 'Program'
        sap_color     = document->list_group
        sap_fontstyle = document->standard
       sap_emphasis  = document->strong.
    CALL METHOD document->new_line
      EXPORTING
        repeat = 1
    CALL METHOD document->add_text
      EXPORTING
        text          = 'Requester'
        sap_color     = document->list_group
        sap_fontstyle = document->standard
       sap_emphasis  = document->strong.
    CALL METHOD document->new_line
      EXPORTING
        repeat = 1
    CALL METHOD document->add_gap
      EXPORTING
         width      = 125
    CALL METHOD document->add_text
      EXPORTING
        text          = 'This Is Test Data'
        sap_color     = document->list_group
       sap_fontsize  = document->LARGE
       sap_fontstyle = document->standard
       sap_emphasis  = document->strong.
    ENDFORM.                    "HTML_TOP_OF_PAGE
    Thanks & Regards
    Ashu SIngh

  • 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

  • ALV Report: Summation button issue.

    Hi Experts,
    I have designed the ALV report. And the requirement is to have a summation button on the o/p screen.
    I have tried with :
    fieldcatalog-do_sum      = 'X'.
      fieldcatalog-datatype = 'QUAN'.
    fieldcatalog-do_sum      = 'X'.
      fieldcatalog-inttype = 'P'.
    Sometimes its directly summing the field, which I don't need.
    I want to sum only If I click on Summation button.
    My fieldcatalog is:
    fieldcatalog-tabname     = 'IG_FINAL'.
      fieldcatalog-fieldname   = 'ZPROD1'.
      fieldcatalog-seltext_m   =  text-018.
      fieldcatalog-outputlen   = 25.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-do_sum      = 'X'.
      fieldcatalog-datatype = 'QUAN'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    Now what should I do get the summation button working ?
    Pls help !

    Hi Harish,
    almost all run time errors in programs with ALV are related to field catalog errors. Functional errors and questions for ALV are relatedto field catalog not much less.
    The only ALV released for customer use is the ALV object model involving classes CL_SALV_*, mainly ans atrting fromCL_SALV_TABLE.
    The ALV object model does not use any user-created field catalog.
    If you do not take the initial load of reading a few blogs explaining  ALV object model and the time to get used to it, you will remain at the field catalog level for ever.
    lr_aggregations    = lio_salv->get_aggregations( ).
        lv_columnname = io_column->get_columnname( ).
        TRY.
            lr_aggregations->add_aggregation(
              columnname  = lv_columnname
              aggregation = if_salv_c_aggregation=>total ).
          CATCH cx_salv_data_error .
            ASSERT 1 = 2.
          CATCH cx_salv_not_found .
            ASSERT 1 = 2.
          CATCH cx_salv_existing .
            ASSERT 1 = 2.
        ENDTRY.
    This code snippet may look strange to you - not after you started with CL_SALV_TABLE. Search for Rich Heilmans aticles to start with.
    Regards
    Clemens

  • '@' not getting displayed in the ALV report

    Hello,
    I am facing  a strange issue in the ALV report display. A string starting with '@' is not getting displayed and says "default icon " on the report. and this is varying from system to system for the same user.
    can anyone please help me in resolving the issue.
    Thanks in advance.
    Thanks and Regards,
    Santhosh Guptha N.

    @ is a default value as per ALV internal process. This is used in icons .
    I think this is causing the confusion.
    Check in the fieldcat if there is any adjsutment to be made to handle this.
    Br,
    Vijay

  • Oops alv report not getting displayed

    Hi experts,
    I have  REQUIREMENT WHERE I NEED TO DISPLAY THREE REPORTS USING ALAV OOPS.
    I have maintained a FM to call alv rport.
    ,I have two validations to make at to different location in report. The report needs to be displayed only after I perform two different validations.
    Issue is
    I call this ALV reprt Fm once at  :  AT SELECTION SCREEN OUTPUT
    and second time at : START OF SELECTION...
    Now I can see the ALV report ( oops with three reports in one container) very well when i call it from :  AT SECETION SCREEN OUTPUT(  Here I perform one of teh two validations which I have mentioned above...The validation performed here is of Selction screen valiudation).
    ButNow when I perform another validation at START OF SELECTIOn...here I cannot  see the ALV report...TEH screen appearing is blank...
    I am calling teh SAME OOPS ALV Function Module from both the locations...( START of SEL and AT selc O/p)..
    I have debugged teh code and checked teh feidcatalogue genration as well s output table .and also structure
    parameteers .. all of tehm are getting populated in both the cases ,,, but dont know why thye output doesnot appear in th last call..
    please help ., I am stuck up...
    TX a ton in adv...
    Regards,
    KT

    Hi Kshitija T,
    START-OF-SELECTION is processed in PAI of selection screen - as soon as all processing is done, the program flow will return, initialize your program an all of it's objects and display the selection screen again.
    I solved this by disabling the default report status EXECUTE button and used AT-SELECTION-SCREEN events.
    Regards,
    Clemens

Maybe you are looking for

  • I can not open a crw image in photoshop camera Raw.

    When I go to open a CRW Image in CS5,Bridge It will not open.It says Could not complite your request because it is not the right kind of document.Need help bad. PS How do I tell what version of Camera Raw I have.By the way I have a Canon EOS 10D came

  • BB Bold won't switch on

    Ok So last night while using KIK Messager on my bb 9900 bold the app froze, I tried the alt+Shift+enter combo but nothing happend I then pulled the battery and the phone went off. Once the phone went off it doesn't want to swtich on. NO Red Led nothi

  • Hi! My MacBook seems to be downloading something when i try to turn it on.

    Hi! So my MacBook seems to be downloading something when i try to turn it on. It takes roughly 10mins for it to start up! Any suggestions of how i could fix this?

  • PeopleTools 8.53 Release Value Proposition (RVP) published

    Check out the blog posting on the PeopleTools 8.53 RVP https://blogs.oracle.com/peopletools/entry/oracle_peoplesoft_peopletools_8_53 Edited by: Greg Kelly on Jul 7, 2012 9:48 AM

  • Online number same as iPhone Number

    If i have the same number, when i get an incoming call (whilst in wi-fi area), will the call go to skype (and thus free), or to my mobile (where i get charged an international incoming rate)?  Cheers