ALV Dispay

Hi experts,
    I have created an report which gives an LIST output.
When  we take the print out of the o/p some extra blank pages are getting printed.
  Any idea how to avoid this? IS  there any parameter needs to be maintained in ALV FM?
Regards
Saurabh

Hi Saurabh,
    Are you using Footer in yout List display. If you are using a footer in your list display, then footer should always be displayed on one complete page. i.e there should be no page-break in the middle of printing the footer. I had this issue once. Do let me know if it helps.
Regards,
Sandeep

Similar Messages

  • ALV - output to file

    Hello,
    I am trying to save the ALV displayed data as a text file and I would like
    to keep the headings from be outputted to the text file. I would appreciate
    any help you may have.

    Hi,
    If u want to save the output of the ALV dispay on text file....
    then execute the following code.....and in the out put ur having an icon with Local file(CtrlShiftF9) u will get options select where u  want to store data......
    TABLES:Z50889_BMS_TABLE, SSCRFIELDS.
    TYPE-POOLS:SLIS.
    TYPES:BEGIN OF ST_TAB1,
          EMPID TYPE ZKKEMPID,          "Employee ID
          EMPNAME TYPE ZKKNAME,         "Employee Name
          EMPDEPARTMENT TYPE ZKKDEPT,   "Department
          EMPPROJECT TYPE ZKKPROJECT,   "Project
          EMPLOGIN TYPE ZKKLOGIN,       "Login Time
          EMPSALARY TYPE ZKKSALARY,     "EMployee Salary
          END OF ST_TAB1.
    DATA:
    *Declaration of internal table to store data
          WA_TAB1 TYPE  ST_TAB1,
          IT_TAB1 TYPE STANDARD TABLE OF ST_TAB1,
    *Declaration of variables used in the program
          V_NUMBER LIKE Z50889_BMS_TABLE-EMPID,
          V_PROG TYPE SY-REPID,
    *Declaration of internal table for the funtion codes
          IT_EXC TYPE TABLE OF RSEXFCODE,
          WA_EXC TYPE          RSEXFCODE,
    *Declaration of internal table and work area to the display
          IT_FIELDCAT  TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT  TYPE SLIS_FIELDCAT_ALV,
          WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
          IT_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENTS TYPE SLIS_ALV_EVENT.
    *Declaration of selection-screen block
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS:SO_NUM  FOR  V_NUMBER.
    SELECTION-SCREEN END OF BLOCK B1.
    INITIALIZATION.
      SSCRFIELDS-FUNCTXT_01 = 'CREATE'.
      SSCRFIELDS-FUNCTXT_02 = 'CHANGE'.
      WA_EXC-FCODE  = 'ONLI'.
      APPEND WA_EXC TO IT_EXC.
      V_PROG = SY-CPROG.
    START-OF-SELECTION.
      PERFORM FETCH_DATA.
      PERFORM DISPLAY.
    *&      Form  to fetch_data from the table  Z50889_BMS_TABLE
    FORM FETCH_DATA .
      SELECT EMPID EMPNAME EMPDEPARTMENT EMPPROJECT EMPLOGIN EMPSALARY FROM
      Z50889_BMS_TABLE INTO TABLE IT_TAB1 WHERE EMPID IN SO_NUM.
    ENDFORM.                    " fetch_data
    *&      Form to  display the output
    FORM DISPLAY .
      PERFORM INITIALIZE_BLOCK.
      PERFORM FIELD_CATALOG.
      PERFORM LAYOUT.
      PERFORM EVENTS.
      PERFORM APPEND_TO_LAYOUT.
      PERFORM BLOCK_DISPLAY.
    ENDFORM.                    " display
    *&      Form  initialize_block
    FORM INITIALIZE_BLOCK .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          I_CALLBACK_PROGRAM = V_PROG.
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      IT_EXCLUDING                   = IT_EXCLUDING
    CALL FUNCTION 'REUSE_ALV_CHECKBOX_SET'
      CHANGING
        CT_FIELDCAT       = IT_FIELDCAT
    ENDFORM.                    " initialize_block
    *&      Form for field_catalog
    FORM FIELD_CATALOG .
      WA_FIELDCAT-FIELDNAME = 'EMPID'.
      WA_FIELDCAT-SELTEXT_L = 'EMPLOYEE ID'.
      WA_FIELDCAT-COL_POS     = 0.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'EMPNAME'.
      WA_FIELDCAT-SELTEXT_L = 'EMPLOYEE NAME'.
      WA_FIELDCAT-COL_POS     = 1.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'EMPDEPARTMENT'.
      WA_FIELDCAT-SELTEXT_L = 'DEPARTMENT'.
      WA_FIELDCAT-COL_POS     = 3.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'EMPPROJECT'.
      WA_FIELDCAT-SELTEXT_L = 'PROJECT'.
      WA_FIELDCAT-COL_POS     = 4.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'EMPLOGIN'.
      WA_FIELDCAT-SELTEXT_L = 'LOGIN TIME'.
      WA_FIELDCAT-COL_POS     = 5.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      WA_FIELDCAT-FIELDNAME = 'EMPSALARY'.
      WA_FIELDCAT-SELTEXT_L = 'SALARY'.
      WA_FIELDCAT-COL_POS     = 6.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
    ENDFORM.                    " field_catalog
    *&      Form  layout
    FORM LAYOUT .
      WA_LAYOUT-ZEBRA ='X'.
      WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      WA_LAYOUT-WINDOW_TITLEBAR = 'EMPLOYEE DETAILS'.
    ENDFORM.                    " layout
    *&      Form  events
          text
    -->  p1        text
    <--  p2        text
    FORM EVENTS .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 1
        IMPORTING
          ET_EVENTS       = IT_EVENTS[]
        EXCEPTIONS
          LIST_TYPE_WRONG = 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.                    " events
    *&      Form  APPEND_TO_LAYOUT
    FORM APPEND_TO_LAYOUT .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IS_LAYOUT                  = WA_LAYOUT
          IT_FIELDCAT                = IT_FIELDCAT
          I_TABNAME                  = 'IT_TAB1'
          IT_EVENTS                  = IT_EVENTS
        TABLES
          T_OUTTAB                   = IT_TAB1
        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.                    " APPEND_TO_LAYOUT
    *&      Form to call  BLOCK_DISPLAY
    FORM BLOCK_DISPLAY .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
        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.                    " BLOCK_DISPLAY

  • Variable Columns Dispaying in ALV Report

    Hi ,
    I am working on ALV report . I am displaying 40 static fields and variable fields . Those varaible fields dependent on internal table . In the internal table 3 fields are available
    if it contains 1 row then in report variable fields are   3  OR
    if it contains 2 rows then in report variable fields are 6  OR 
    if it contains 3 rows then in report variable fields are 9  OR
    if it contains n rows then in report variable fields are 3n.
    Example :  1)  Internal table have 3 fields sd_active , sd_close , sd_term .
                               Internal table is i_a936 , Work area w _a936 .
                                 w_a936-sd_active = 'A1'.
                                 w_a936-sd_close  = 'B1'.
                                 w_a936-sd_term    = 'C1'.
                                 append w_a936 to i_a936.
                                 w_a936-sd_active = 'A2'.
                                 w_a936-sd_close  = 'B2'.
                                 w_a936-sd_term    = 'C2'.
                                 append w_a936 to i_a936.
                      Then in final internal table it should display  6 columns like w_final-sd_Active1 ,w_final-sd_close1,w_final-sd_term1 , w_final-sd_Active2 ,w_final-sd_close2,w_final-sd_term2 . Columns in Internal table varies from i_a936 rows .
    I am trying to use Dynamic internal table .
    Regards
    Srihari Nerella

    Hi,
           I think this may help you . Use CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
    see the link
    Dynamic fields to be displayed in ALV
    Dynamic column change in Alv
    Dynamic Number of Columns in ALV

  • Need to add Header  and footer in an alv grid display output.

    How can I add header and footer in an alv grid dispay output.
    For the grid display, I am using the function module "REUSE_ALV_GRID_DISPLAY".

    HI,
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_html_end_of_list = 'END_OF_LIST_HTML'
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
      DATA: ls_text TYPE sdydo_text_element,
            l_grid     TYPE REF TO cl_gui_alv_grid,
            f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
      ls_text = 'Footer title'.
    adds and icon (red triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'IL'.
    adds test (via variable)
      CALL METHOD end->add_text
        EXPORTING
          text         = ls_text
          sap_emphasis = 'strong'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Bold text'
          sap_emphasis = 'strong'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Nor'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Yellow '
          sap_emphasis = 'str'.
    adds and icon (yellow triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'IC''.
    display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Mor'.
    *set height of this section
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = l_grid.
      CALL METHOD l_grid->parent->parent->(f)
        EXPORTING
          id     = 3
          height = 14.
    ENDFORM. "end_of_list_html.
    This will solve  it. Post if you need more help in this.
    Regards,
    Madhu.

  • Page number problem in ALV background

    Hi all,
    I am displaying a report in ALV format.
    In the header , i have to display the detail like current page no/ total page numbers .
    I am able to achieve this , but I am facing 2 problems
    1. In foreground , it is always dispayed as ONE SINGLE PAGE , there by showing 1/10 no matter how much pages are present.
    2. When i schedule this program in background, it takes 1 page extra .. i.e 1/10 , 2/10 .... 11/10 .
    The number of records obtained in background are proper , but probably the page lenghts are different,
    Can any one please provide some inputs on the same ?
    Thanks ,
    Supriya Murudkar .

    Hi Twinkal,
    Thanks for your suggestion .
    Is there any solution for the same ?
    The program has a normal output as well as ALV o/p.
    I just compared the 2 outputs now.
    Some records which are on page 1 on normal output are on page 2 of ALV output. the total number of records being the same.
    Do we have any other sol for this .
    Thanks ,
    Supriya Murudkar

  • Showing special character in Dos Mode while doing Alt+255 in ALV for spaces

    Hi,
    I have used alt+255 in my code to show space at the end of alv's one of the column.
    I had used alt+255 because the space ' ' was not displayed in the alv.
    When i copy the text of the alv to a notepad file i was able to display the space at the end.
    But when i opened that notepad file in ms-dos instead of dispalying space at the end it displayed  a`.
    Can u please tell me how can i stop dispaying a`.
    Please help . Rewards points will definetely be given.
    Thanks in advance

    Hi,
    I have got no answer therefore i m closing this thread.
    Jonu

  • Selection of no of rows in alv grid

    hi experts,
                 iam displaying data in alv grid using OOPS and i am trying to select no of records and perform some operations on those, so before dat i want to move the data from those selected rows into an internal table, how to do this.
                              thnaks in advance,

    Hi Himabindu,
    Say for example your the internal table your dispaying in the output is 'itab' and
    in 'itab1' you want allselected rows,
    * Table to hold index of all selected rows
    DATA: gi_index_rows TYPE lvc_t_row.
    *Wor area for the above table
    DATA: g_selected_row LIKE lvc_s_row.
    * Read index of selected rows
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
    * Read indexes of selected rows.
      LOOP AT gi_index_rows INTO g_selected_row.
             READ TABLE itab INDEX g_selected_row-index INTO
             wa_itab.
             APPENDwa_itab TO itab1.
      ENDLOOP.
    Now the selcted row contents will be appended to new table 'itab1'.
    Hope this will help you.
    Regards,
    Manoj Kumar P

  • How to put Download  button on Webdynpro ALV

    Hi,
    I used SELECT_OPTIONS     WDR_SELECT_OPTIONS as webdynrpo components  in my ALV report.I also need download option on the output.I am using just one main view to display the results.
    Also ,Output is always defaulting to 5 rows only.. Where can I change this default?
    Rgds
    Vara

    I'm a little confused because you talk about both Select-Options and ALV.  Which are you wanting to download and which is only dispaying 5 rows.  I'm going to assume that you mean the ALV and the mention of Select-Options is actually inmaterial.
    The ALV Component already has an export button built into it standard.  Were you looking for something else - and if so what kind of functionality did you want.
    To adjust the number of visible rows in the ALV use the configuration model interface that is exposed by the component usage: cl_salv_wd_config_table.. Here is an example. You will need to adjust the name of the component usage for the name you actually used.  I used ALV - then wd_this->wd_cpuse_alv. You would need to adjust this to wd_this->wd_cpuse_<your name> and wd_this->wd_cpifc_<your name>.
    DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
      DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv( ).
      DATA l_table TYPE REF TO cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
      l_table->if_salv_wd_table_settings~SET_VISIBLE_ROW_COUNT( 20 ).

  • How to use Write statement along with ALV output

    Hi expert,
    currently i have a requirement where i am first displaying message with write statement and after that ALV should be displayed ...something like below:
    vendor number is wrong.
    material number is wrong.
    plant is wrong.
    and then here ALV output -list of records updated in the database.
    but as of now the ALV is shown first and when going back then the write message information is dispayed.
    can anyone help how we can get this in only one screen?
    Thanks!!!
    Rajesh

    May below example give you some idea.
    TYPE-POOLS: slis.
    DATA: BEGIN OF it_kna1 OCCURS 0,
            kunnr TYPE kna1-kunnr,
            name1 TYPE kna1-name1,
            ort01 TYPE kna1-ort01,
          END OF it_kna1.
    DATA: it_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    START-OF-SELECTION.
      SELECT kunnr name1 ort01
        FROM kna1 INTO TABLE it_kna1 UP TO 10 ROWS.
    END-OF-SELECTION.
      WRITE:/ 'Write Statement Display' HOTSPOT ON.
    AT LINE-SELECTION.
      CLEAR it_fcat.
      it_fcat-fieldname = 'KUNNR'.
      it_fcat-tabname = 'IT_KNA1'.
      it_fcat-seltext_l = 'Customer'.
      APPEND it_fcat.
      CLEAR it_fcat.
      it_fcat-fieldname = 'NAME1'.
      it_fcat-tabname = 'IT_KNA1'.
      it_fcat-seltext_l = 'Customer Name'.
      APPEND it_fcat.
      CLEAR it_fcat.
      it_fcat-fieldname = 'ORT01'.
      it_fcat-tabname = 'IT_KNA1'.
      it_fcat-seltext_l = 'City'.
      APPEND it_fcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = sy-repid
          it_fieldcat        = it_fcat[]
        TABLES
          t_outtab           = it_kna1[].

  • Open Field in ALV Report

    Hi all,
    i have to develop a ALV report.
    In that report i have to put a open quantity column , so that the user can enter values in that, and that value should get updated in the database.
    So please suggest me how to develop such report with open field.
    Thanks in advance,
    Regards,
    Pawan

    Hi,
    Try executing the below code
    REPORT YMS_EDITBLOCKALV.
    TABLES : rmmg1,MCHB, mkpf.
    DATA: BEGIN OF t_mseg OCCURS 0,
    zeile LIKE mseg-zeile,
    menge LIKE mseg-menge,
    meins LIKE mseg-meins,
    matnr LIKE mseg-matnr,
    werks LIKE mseg-werks,
    charg LIKE mseg-charg,
    bwart LIKE mseg-bwart,
    END OF t_mseg.
    DATA:BEGIN OF t_mchb OCCURS 0.
    INCLUDE STRUCTURE mchb.
    data flag type c.
    matnr LIKE mchb-matnr,
    charg LIKE mchb-charg,
    werks LIKE mchb-werks,
    clabs LIKE mchb-clabs,
    DATA END OF t_mchb.
    TYPE-POOLS slis.
    data: progname like sy-repid,
    fieldcattab TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    data tabindex type i.
    data wa_matnr LIKE mchb-matnr.
    progname = sy-repid.
    SELECTION-SCREEN BEGIN OF BLOCK b_b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS s_docno FOR mkpf-mblnr. " OBLIGATORY.
    PARAMETERS p_docyr LIKE mkpf-mjahr. " OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b_b1.
    START-OF-SELECTION.
    SELECT zeile
    menge
    meins
    matnr
    werks
    charg
    bwart
    FROM mseg
    INTO TABLE t_mseg
    WHERE mblnr IN s_docno AND mjahr = p_docyr.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 1.
    fieldcattab-fieldname = 'ZEILE'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-fix_column = 'X'.
    fieldcattab-seltext_l = 'Item'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 2.
    fieldcattab-fieldname = 'MENGE'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Quantity'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 3.
    fieldcattab-fieldname = 'MEINS'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Unit'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 4.
    fieldcattab-fieldname = 'MATNR'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Material'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 5.
    fieldcattab-fieldname = 'WERKS'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Plant'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 6.
    fieldcattab-fieldname = 'CHARG'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Batch No'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 7.
    fieldcattab-fieldname = 'BWART'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Inventory'.
    fieldcattab-hotspot = 'X'.
    APPEND fieldcattab.
    end-of-selection.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = PROGNAME
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USERCOMMAND1'
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
    IT_FIELDCAT = fieldcattab[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_ADD_FIELDCAT = fieldcattab
    IT_HYPERLINK =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = t_mseg
    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 usercommand1 USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
    slis_selfield.
    CASE r_ucomm.
    WHEN '&IC1'.
    tabindex = rs_selfield-tabindex.
    read table t_mseg INDEX tabindex.
    select * from mchb into table t_mchb where matnr = t_mseg-matnr.
    clear fieldcattab.
    CLEAR fieldcattab[].
    fieldcattab-col_pos = 1.
    fieldcattab-fieldname = 'FLAG'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-fix_column = 'X'.
    fieldcattab-seltext_l = 'Check Box'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    fieldcattab-checkbox = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 2.
    fieldcattab-fieldname = 'MATNR'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-fix_column = 'X'.
    fieldcattab-seltext_l = 'Material'.
    fieldcattab-emphasize = 'C1'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    fieldcattab-checkbox = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 3.
    fieldcattab-fieldname = 'CHARG'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-seltext_l = 'Batch No'.
    fieldcattab-emphasize = 'C2'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 4.
    fieldcattab-fieldname = 'WERKS'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-seltext_l = 'Plant'.
    fieldcattab-emphasize = 'C30'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 5.
    fieldcattab-fieldname = 'CLABS'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-seltext_l = 'Stock'.
    fieldcattab-emphasize = 'C601'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    APPEND fieldcattab.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = PROGNAME
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USERCOMMAND2'
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
    IT_FIELDCAT = FIELDCATTAB[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_ADD_FIELDCAT =
    IT_HYPERLINK =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = t_mchb
    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.
    FORM usercommand2 USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
    slis_selfield.
    CASE r_ucomm.
    WHEN '&IC1'.
    IF rs_selfield-sel_tab_field = 'T_MCHB-MATNR'.
    CALL FUNCTION 'ZALV2'
    EXPORTING
    CTU = 'X'
    MODE = 'E'
    UPDATE = 'A'
    GROUP =
    USER =
    KEEP =
    HOLDDATE =
    NODATA = '/'
    MATNR_001 = '200-200'
    KZSEL_01_002 = 'X'
    IMPORTING
    SUBRC =
    TABLES
    MESSTAB =
    SET PARAMETER ID 'RID' FIELD RMMG1-MATNR.
    CALL TRANSACTION 'MM03' and skip first screen.
    ENDIF.
    ENDCASE.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = progname
    i_callback_user_command = 'USERCOMMAND3'
    it_fieldcat = fieldcattab[]
    TABLES
    t_outtab = t_mchb
    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.
    Regards,
    chandru

  • Unable to capture data in an editable dynamic ALV.

    Hi ,
    I have created a dynamic editable ALV whose displayed structure can be changed at runtime based on the selection in a drop down list value selector.
    Im trying to capture the values entered in the ALV into an internal table before the user changes the structure of the ALV to a different structure.
    In the ON_SELECT event handler of the drop down list box , im rasing a data_check event to capture the ALV data.
    The problem is that the control is not entering the event handler for the data_check event.
    If i raise the data_check event in my save event handler or any other event handler , it works fine.
    Can someone please suggest a solution.
    Regards,
    Newton.

    Hi ,
    I have figured out that the problem is local to my machine , because the code works fine on other machines.
    I guess my internet explorer has some bug.
    Regards,
    Newton.

  • Total is not getting displayed in the ALV output.

    Hi,
    Total is not getting displayed in the ALV output.
    I m using :REUSE_ALV_BLOCK_LIST_APPEND & REUSE_ALV_BLOCK_LIST_DISPLAY
    Are  there any issues with it as the same settings are working fine with REUSE_ALV_LIST_DISPLAY
    source code:
    DATA: layout TYPE slis_layout_alv,
          IT_eventS  TYPE slis_t_event,
          fcat   TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          rec_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    TYPES: BEGIN OF ty_tab,
          belnr TYPE dberchz-belnr,
          belzart TYPE dberchz-belzart,
          net TYPE dberchz-nettobtr,
          END OF ty_tab.
    DATA: lt_tab TYPE STANDARD TABLE OF ty_tab.
    SELECT belnr belzart nettobtr
      FROM dberchz
      INTO TABLE lt_tab[]
    WHERE belnr eq '000000000001'.
      if sy-subrc ne 0.
      ENDIF.
    *  defining layout
    layout-colwidth_optimize = 'X'.
    layout-def_status = 'X'.
    *defning event
    *event
    *defining field catalog
    fcat-col_pos = 1.
    fcat-fieldname = 'BELNR'.
    fcat-tabname  = 'LT_TAB'.
    APPEND fcat.
    fcat-col_pos = 2.
    fcat-fieldname = 'BELZART'.
    fcat-tabname  = 'LT_TAB'.
    APPEND fcat.
    fcat-col_pos = 3.
    fcat-fieldname = 'NET'.
    fcat-tabname  = 'LT_TAB'.
    fcat-do_sum = 'X'.
    APPEND fcat.
    *calling alv
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program             = 'YZ_PLR'
    *   I_CALLBACK_PF_STATUS_SET       = ' '
    *   I_CALLBACK_USER_COMMAND        = ' '
    *   IT_EXCLUDING                   =
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        is_layout                        = layout
        it_fieldcat                      = fcat[]
        i_tabname                        = 'LT_TAB'
        it_events                        = IT_EVENTS[]
    *   IT_SORT                          =
    *   I_TEXT                           = ' '
      tables
        t_outtab                         = lt_tab[]
    * 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.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    Thanks,
    Gaurav

    Hi
    No I don't think, this is my code (based on your code) and it works fine:
    TYPE-POOLS SLIS.
    DATA: BEGIN OF LT_TAB OCCURS 0,
           BELNR LIKE BSEG-BELNR,
           GJAHR LIKE BSEG-GJAHR,
           WRBTR LIKE BSEG-WRBTR,
           WAERS LIKE BKPF-WAERS,
          END OF LT_TAB.
    DATA: LAYOUT     TYPE SLIS_LAYOUT_ALV,
          IT_EVENTS  TYPE SLIS_T_EVENT,
          FCAT       TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          REC_FCAT   TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    START-OF-SELECTION.
      FCAT-COL_POS       = 1.
      FCAT-FIELDNAME     = 'BELNR'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-REF_FIELDNAME = 'BELNR'.
      FCAT-REF_TABNAME   = 'BSEG'.
      APPEND FCAT.
      FCAT-COL_POS       = 2.
      FCAT-FIELDNAME     = 'GJAHR'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-REF_FIELDNAME = 'GJAHR'.
      FCAT-REF_TABNAME   = 'BSEG'.
      APPEND FCAT.
      FCAT-COL_POS       = 3.
      FCAT-FIELDNAME     = 'WRBTR'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-CFIELDNAME    = 'WAERS'.
      FCAT-REF_FIELDNAME = 'WRBTR'.
      FCAT-REF_TABNAME   = 'BSEG'.
      FCAT-DO_SUM        = 'X'.
      APPEND FCAT.
      FCAT-COL_POS       = 4.
      FCAT-FIELDNAME     = 'WAERS'.
      FCAT-TABNAME       = 'LT_TAB'.
      FCAT-REF_FIELDNAME = 'WAERS'.
      FCAT-REF_TABNAME   = 'BKPF'.
      FCAT-DO_SUM        = SPACE.
      APPEND FCAT.
      SELECT * FROM BSEG INTO CORRESPONDING FIELDS OF TABLE LT_TAB
        WHERE BUKRS = 'MAAB'
          AND BELNR = '0000000001'.
      LT_TAB-WAERS = 'EUR'.
      MODIFY LT_TAB FROM LT_TAB TRANSPORTING WAERS WHERE WAERS = SPACE.
    *CALLING ALV
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          I_CALLBACK_PROGRAM = 'ZPROVAMAX5'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IS_LAYOUT   = LAYOUT
          IT_FIELDCAT = FCAT[]
          I_TABNAME   = 'LT_TAB'
          IT_EVENTS   = IT_EVENTS[]
        TABLES
          T_OUTTAB    = LT_TAB[].
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
    I've also inserted a currency field
    Max

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

  • Vendor open items wise ALV Grid Display (FBL1N) report to Excel Sheet

    Hi All,
    I need vendor wise open items and cleared items in ALV Grid format in excel sheet.
    I'm Trying that in T Code FBL1N, After the execution. I had select ALV Grid format like this From the menu bar->Settings-> Switch list.
    After that i get ALV  Grid format, Then i'm doing export the data to excel sheet. like this From the Menu bar->List->Export->Spread sheet.
    That time i'm getting Error Message no. 0K064, Filter criteria, sorting, totals and subtotals are not taken into account.
    I want vendor wise sorting totals and subtotals,
    How can i over come this Error please let me now.
    Thanks,
    Amar

    Hi Amar,
    Please check the KBA 2083705.
    https://websmp230.sap-ag.de/sap(bD1odSZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3230383337303526
    Regards,
    Monika

  • Report for CRM-Opportunities - Open CRMD_ORDER for selected ALV row

    Hello,
    i created a report which can be used to find the relevant opportunities and list them in a ALV table.
    I have the requirement that by doubleclick on the table line the selected opportunity shall open in tx crmd_order.
    I have the GUID and the object_id of the opportunity in my ALV tableline.
    Has anybody already experience how to achieve this?
    Thank you
    Best regards
    Manfred

    It works perfectly for me. Look at the code (this works)
    REPORT ytestfhe3.
    DATA: gv_1o_manag    TYPE REF TO cl_crm_1o_manag,
          gv_1o_main     TYPE REF TO cl_crm_1o_main.
    DATA: gv_dynnr       TYPE sydynnr.
    DATA: gv_1o_frame_pa TYPE crmt_1o_frame_pa.
    DATA: gv_guid        TYPE crmt_object_guid.
    DATA: gv_boolean     TYPE crmt_boolean VALUE 'X'.
    PARAMETERS: p_order TYPE crmd_orderadm_h-object_id.
    START-OF-SELECTION.
      SELECT SINGLE guid FROM crmd_orderadm_h
                         INTO gv_guid
                        WHERE object_id EQ p_order.
    END-OF-SELECTION.
      gv_1o_frame_pa-transaction_guid = gv_guid.
      CREATE OBJECT gv_1o_manag
        EXPORTING
          iv_with_navig  = gv_boolean
          iv_1o_frame_pa = gv_1o_frame_pa.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        EXIT.
      ENDIF.
      CALL METHOD gv_1o_manag->get_main_screen
        IMPORTING
          ev_dynnr = gv_dynnr.
      CALL FUNCTION 'CRM_1O_MANAG_CALL_SCREEN_UI'
        EXPORTING
          iv_dynnr       = gv_dynnr
          iv_1o_frame_pa = gv_1o_frame_pa.

Maybe you are looking for