Problem with ALV gird

hi
i have an ALV grid in my screen
in that one of my field (quantity field )is editable
when user changes that quantity value and say he will press enter button
i need my control of the program in my PAI.
but this is not happening, if  any one knows the way to take the control to PAI
please help.

u've to register the edit event with the Enter key, something like this
call method gr_grid_d0100->register_edit_event
      exporting
        i_event_id = cl_gui_alv_grid=>mc_evt_enter.
checkt the sample program   BCALV_TEST_GRID_EVENTS for more info

Similar Messages

  • I have a problem with ALV Grid User Command?

    Hi Experts,
    I have a problem with ALV GRID User Command.
    I am calling TCODE IW33 (Order Display) from the ALV output at first time by selecting an order. But, User command is calling IW33 Initial screen with blank value of order. Even I checked in debugging the value what I selected is passing properly, but once that screen (IW33 Initial) displays, value doesn't appear. Then, Manually, I  created another session and gone to TCODE IW33 and displayed an order. After that I came out from that order. Then again run my ALV program and selected another order, now order is displaying, but not what I selected current order instead of displaying previous order what I just displayed manually. If I selected any other order, system will display the same order what I dislayed manually.
    Here is my code.
    FORM user_command_alv  USING u_ucomm TYPE sy-ucomm
                           us_self_field TYPE slis_selfield.
    CASE u_ucomm.
    WHEN '&IC1'.
    READ TABLE it_final INDEX us_self_field-tabindex INTO wa_final.
            WHEN 'ORDER'.
              IF NOT wa_final-order IS INITIAL.
                SET PARAMETER ID 'COK' FIELD wa_final-order.
                CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.
              ENDIF.
    endform.
    PARAMETER ID 'COK'  also the standard one.
    Could you please help me out, Where I did wrong?
    If I select any order, that order only should display.
    Thanks in advance.
    Regards,
    Sarayu.
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:33 PM

    hi,
    Please check it once the Paramater ID is 'ANR' for IW33 order number.
    Hope this may help.
    Regards,
    Sravanthi

  • Problem with ALV grid in edit mode

    Hello, gurus!
    I have a problem with ALV-grid. Sometimes when I call F4 help for a cell, data is inserted in a different cell.  And when I call check_changed_data method, my internal table (passed to ALV-control in set_table_for_first_display) does not updates properly. In what can be a problem?
    Thanks,
    Mikhail

    Hi Prabhu,
    MODULE pbo_100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      title_of_report = text-010.
      SET TITLEBAR '0100' WITH title_of_report.
      DATA: g_event_receiver TYPE REF TO lcl_event_handler.
      IF z_custom_container IS INITIAL .
        CREATE OBJECT z_custom_container
          EXPORTING
            container_name = 'ALV_ZAC'.
        CREATE OBJECT alv_grid
          EXPORTING
            i_parent = z_custom_container.
        g_repid = sy-repid.
        gs_variant-report = g_repid.
        x_save = 'A'.
        PERFORM check_alv_grid_fields.
        ps_layout-cwidth_opt = 'X'.
        ps_layout-edit = 'X'.
        CALL METHOD alv_grid->set_ready_for_input
          EXPORTING
            i_ready_for_input = '1'.
    *    CALL METHOD alv_grid->register_edit_event
    *      EXPORTING
    *        i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        APPEND   s_list_rec   to it_list_rec.
        CALL METHOD alv_grid->set_table_for_first_display
          EXPORTING
            is_layout       = ps_layout
            is_variant      = gs_variant
            i_save          = x_save
          CHANGING
            it_fieldcatalog = pt_fieldcat
            it_outtab       = it_list_rec[].
        CALL METHOD alv_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        CALL METHOD alv_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    ENDIF.
    FORM check_alv_grid_fields .
      DATA: ls_fcat LIKE LINE OF pt_fieldcat.
    REFRESH pt_fieldcat .
    CLEAR: ps_layout, ls_fcat.
      ls_fcat-fieldname = 'VBELN'.
      ls_fcat-ref_field = 'VBELN'. ls_fcat-ref_table =  'LIPS'. " .
      ls_fcat-outputlen = 9.
    *  ls_fcat-datatype   = 'CHAR'.
    *  ls_fcat-inttype    = 'C'.
      APPEND  ls_fcat TO pt_fieldcat.
      CLEAR: ls_fcat.
      ls_fcat-fieldname = 'ERDAT'.
      ls_fcat-ref_field = 'ERDAT'. ls_fcat-ref_table = 'LIPS'.
      ls_fcat-outputlen = 9.
    *  ls_fcat-f4availabl = 'X' .
    *  ls_fcat-datatype   = 'DATS'.
    *  ls_fcat-inttype    = 'D'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR: ls_fcat.
    ENDFORM.                    " check_alv_grid_fields
    FORM save_p .
      CLEAR l_valid.
      CALL METHOD alv_grid->check_changed_data
        IMPORTING
          e_valid = l_valid.
      IF l_valid IS INITIAL.
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = text-i01
            txt1  = text-i02
            txt2  = text-i03
            txt3  = text-i04.
      ELSE.
        i_dat_reg = zrumm_prr-cdprr.
        CLEAR is_temp_otc.
        freshit i_prrpus_fax.
        freshit i_list2_ot.
        LOOP AT it_list_rec INTO s_list_rec.
          MOVE-CORRESPONDING s_list_rec TO i_list2_ot.
          i_list2_ot-fgrup = 'RECE'.
          i_list2_ot-prrnu = i_num_prr.
          APPEND i_list2_ot.
          MOVE-CORRESPONDING s_list_rec TO i_prrpus_fax.
          APPEND i_prrpus_fax.
        ENDLOOP.
      ENDIF.
    Edited by: Mikhail Sarychev on Mar 16, 2011 6:41 AM
    Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM
    Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM

  • Problem with ALV filter functionality when filtered for multiple values

    Hi,
    I am facing a problem with ALV filter functionality.
    I have displayed an ALV with some columns col_A, col_B and col_C
    col_A---- col_B -
    col_C
    1----
    a -
    abc
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    5----
    f -
    stu
    From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
    Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
    i.e. after applying the filter the ALV table looks as below:
    col_A---- col_B -
    col_C
    3----
    c -
    lmn
    But ideally it should be:
    col_A---- col_B -
    col_C
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    I could not find any OSS note related to this issue.
    Please help me resolve this issue.
    Thanks,
    Feroz

    Hi,
    I am facing a problem with ALV filter functionality.
    I have displayed an ALV with some columns col_A, col_B and col_C
    col_A---- col_B -
    col_C
    1----
    a -
    abc
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    5----
    f -
    stu
    From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
    Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
    i.e. after applying the filter the ALV table looks as below:
    col_A---- col_B -
    col_C
    3----
    c -
    lmn
    But ideally it should be:
    col_A---- col_B -
    col_C
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    I could not find any OSS note related to this issue.
    Please help me resolve this issue.
    Thanks,
    Feroz

  • Problem with ALV search help Dictionary Search Help

    Hello experts
    I have a problem with ALV search help.
    I use DDIC table ZXXX with text table ZXXX_T. I created DDIC search help form table ZXXX. In my WD application, in context on COMPONENTCONTROLLER i set on attribute: 'Input help mode' as 'Dictionary Search Help' and in 'Dictionary Search Help' I pass name of new created DDIC search help.
    I create a input field from that atrribute and search help works fine (there was a value and description for value from text table). So I created ALV witch contains that attribute too.
    Next I set column for this attribute in ALV as editable but on Serch help for this collumn I have only value. I DON'T HAVE TEXT DESCRIPTION FOR VALUE.
    Please help me and tell me what I do wrong?
    Miko

    Hello,
    Thank's for your help. I create DDic Search help for all fields from my ALV. Next I changed 'TYPE' for all ALV fields in COMPONENTCONTROLLER from ZXXX-Zfield to Zfield, and I changed 'Input help mode' from 'Automatic' to 'Dictionary Search Help'. Now I see Value and Description for value in Search Help in my ALV.
    Regards
    Miko

  • Problems with ALV - Excel after changing from 640 to 710

    Hi all,
    first i have to say, that i have tried to set this thread in the SAPGUI-Forum,
    but i didn't get any answers, therefore i try it here.
    I have changed our SAPGUI from 640 to 710. Now i get problems
    with ALV-GRID display.
    When i change the output to EXCEL-Inplace i get the Error-Message:
    0K000
    View cannot be switched: Product is not installed or integration is not active.
    In 640 i don't have any problems. We have ECC6.
    When i use GUI710 and SAP 4.6C i don't have any problems.
    Simple Test is possible with SE16N and change ALV output to excel-inplace.
    Can anybody help?
    Thanks.
    Regards, Dieter

    Hi Dieter,
    we had a similar problem who we resolved installing path the GUI710_1-10002995.EXE.
    Have you tried to install the patch?
    Bye
    Giovanni Mortati

  • Problems with ALV - Excel after changin from 640 to 710

    Hi all,
    i have changed our SAPGUI from 640 to 710. Now i get problems
    with ALV-GRID display.
    When i change to EXCEL-Inplace i get the Error-Message:
    0K000
    View cannot be switched: Product is not installed or integration is not active.
    in 640 i don't have any problems.
    Can anybody help?
    Thanks.
    Regards, Dieter

    Hi Roman,
    in Service.sap.com there is the first patch-level of the new GUI7.10.
    i have install it without any problems.
    The problem i had with excal-inplace is solved.
    Regards, Dieter

  • Problem with ALV Grid Hotspot

    Hi ,
    I am having a problem with Hotspot <<removed_by_moderator>>
    I need to Open up SE16 and need to skip the first screen of the Table 'ZLE_WH01' and display the selection screen with the MATNR passed from my ALV Report.
    I tried using Call Transaction and Submit commands, but couldn't achive my target.
    when I used SUBMIT and pass the MATNR Value to the SE16 selection screen for the corresponding Table, the value is appearing in the MATNR field of the Selection screen but the Execute button is not working.
    When I try the Call Transaction Method, the value is not capturing in the 2nd screen. Table name is capturing in the first screen.
    Kindly advice me how to resolve this issue.
    Regards,
    Srinivas
    Edited by: Vijay Babu Dudla on Feb 25, 2009 11:08 PM

    For se16
    Use fm SE16N_INTERFACE

  • Background task problem with alv grid display

    Hello !
    I have a problem when executing my program in background.
    In foreground I have no problem, my ALV appears. In the background I have a dump.
    The current ABAP program "SAPLKKBL" had to be terminated because one of the statements could not be executed.
    I use the function module 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
            i_callback_program      = gd_repid
            i_callback_user_command = 'F533_USER_COMMAND'
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
            it_special_groups       = i_fgroup[]
            i_save                  = 'X'
            it_sort                 = gd_sort
            i_buffer_active         = ' '
            i_callback_pf_status_set = 'F534_SET_PF_STATUS'
         TABLES
            t_outtab                = mytab
         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.
    I don't understand where the problem is. Please help me.
    Thank you.

    I love replying to old threads:
    Try this link
    http://scn.sap.com/people/prashant.patil12/blog/2007/02/20/displaying-alv-grid-in-background-job

  • Problem with ALV list

    Hi friends,
                  I have created one program with alv list, but i am unable to add one header and footer, also i have to add one logo to the program. Plese some one tell me a easy procedure to add a header, footer and also a logo. If you can show me one with example that would be very helpful.
    This is my program, plz add the necessary parts.
    *& Report Y_BOM2_ALV
    REPORT y_bom2_alv LINE-SIZE 350 LINE-COUNT 350.
    *& Include YINCLUDE1
    TABLES : mast, stko, stpo.
    TYPE-POOLS : slis.
    DATA : BEGIN OF iall OCCURS 10,
    matnr LIKE mast-matnr,
    werks LIKE mast-werks,
    stlan LIKE mast-stlan,
    stlal LIKE mast-stlal,
    stlst LIKE stko-stlst,
    posnr LIKE stpo-posnr,
    idnrk LIKE stpo-idnrk,
    menge LIKE stpo-menge,
    meins LIKE stpo-meins,
    ausch LIKE stpo-ausch,
    lgort LIKE stpo-lgort,
    END OF iall.
    DATA : i_repid LIKE sy-repid,
    i_lines LIKE sy-tabix.
    DATA : int_fcat TYPE slis_t_fieldcat_alv.
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE title1.
    PARAMETER : p_werks LIKE mast-werks.
    SELECT-OPTIONS : s_matnr FOR mast-matnr.
    SELECTION-SCREEN END OF BLOCK a1.
    INITIALIZATION.
    title1(50) = ' Bill Of Material Input Screen '.
    *& Include YINCLUDE2
    START-OF-SELECTION.
    SELECT mastmatnr mastwerks maststlan maststlal stko~stlst
    stpoposnr stpoidnrk stpomenge stpomeins stpo~ausch
    stpo~lgort INTO TABLE iall FROM stpo INNER JOIN stko ON
    stpostlnr = stkostlnr INNER JOIN mast ON
    stpostlnr = maststlnr WHERE mast~werks EQ
    p_werks AND mast~matnr IN s_matnr.
    IF sy-subrc <> 0 OR p_werks EQ ' ' OR s_matnr EQ ' '.
    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
    EXPORTING
    titel = 'ERROR MESSAGE ( INPUT ERROR / WRONG INPUT ) '
    textline1 = ' PLANT / MATERIAL Invalid or Empty '
    textline2 = ' Plese enter plant no / material no again '
    start_column = 20
    start_row = 5.
    EXIT.
    ENDIF.
    CLEAR i_lines.
    DESCRIBE TABLE iall LINES i_lines.
    IF i_lines LT 1.
    WRITE: /
    'No materials found.'.
    EXIT.
    ENDIF.
    END-OF-SELECTION.
    i_repid = sy-repid.
    *& Include YINCLUDE3
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = i_repid
    i_internal_tabname = 'IALL'
    i_inclname = i_repid
    CHANGING
    ct_fieldcat = int_fcat
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    WRITE: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = i_repid
    it_fieldcat = int_fcat
    i_save = 'A'
    TABLES
    t_outtab = iall
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    WRITE: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
    ENDIF.

    Hi Tapodipta,
    See below example and modify ur code according to ur requirement..
    REPORT  ZTEST_ALV_CHECK        .
    TYPE-POOLS: SLIS.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT type slis_layout_alv,
          x_events type slis_alv_event,
          it_events type SLIS_T_EVENT.
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          POSNR LIKE VBAP-POSNR,
         END OF ITAB.
    SELECT VBELN
           POSNR
           FROM VBAP
           UP TO 20 ROWS
           INTO TABLE ITAB.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-SELTEXT_L = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
      x_events-NAME = SLIS_EV_END_OF_PAGE.
      x_events-FORM = 'END_OF_PAGE'.
      APPEND x_events  TO iT_EVENTS.
      CLEAR x_events .
      x_events-NAME = SLIS_EV_TOP_OF_PAGE.
      x_events-FORM = 'TOP_OF_PAGE'.
      APPEND x_events  TO iT_EVENTS.
      CLEAR x_events .
      x_events-NAME = slis_ev_end_of_list.
      x_events-FORM = 'END_OF_LIST'.
      APPEND x_events  TO iT_EVENTS.
      CLEAR x_events .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        IS_LAYOUT                = L_LAYOUT
        IT_FIELDCAT              = IT_FIELDCAT
        it_events                = it_events
      TABLES
        T_OUTTAB                 = ITAB
      EXCEPTIONS
        PROGRAM_ERROR            = 1
        OTHERS                   = 2.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    FORM TOP_OF_PAGE.
    * BREAK-POINT.
      WRITE: / 'TOP_OF_PAGE'.
    ENDFORM.
    FORM END_OF_LIST.
    * BREAK-POINT.
    "here you can use this for footer
      WRITE: / 'FOR FOOTER'.
    ENDFORM.
    FORM END_OF_PAGE.
    * BREAK-POINT.
      WRITE: / 'END_OF_PAGE'.
    ENDFORM.
    Go through the link as well..
    Re: ALV  Footer
    Hope it will solve ur problem..
    <b>Reward points if useful..</b>
    Thanks & Regards
    ilesh 24x7

  • Problem with alv print

    Hi,
    I am using alv grid, there is a problem with print, when i look at print preview it shows only 1 row and even the values in that row are incorrect.
    Please help me solv the problem.
    Thanks,
    Sai.

    Here is the code
    *&      Form  DISPLAY
          text
    FORM display.
      DATA : fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    *data : wa_fieldcat type slis_fieldcat_alv.
      DATA : t_header  TYPE slis_t_listheader,
             wa_header TYPE slis_listheader.
      DATA : cnt(3) TYPE c VALUE 0.
    cnt = cnt + 1.
      fieldcatalog-fieldname   = 'XBLNR'.
      fieldcatalog-seltext_m   = 'Invoice No'.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 8.
      fieldcatalog-tabname   = 'it_final'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'BLDAT'.
      fieldcatalog-seltext_m   = 'Invoice Date'.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 9.
      fieldcatalog-tabname     = 'it_final'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    *CT3 No.
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'SGTXT'.
      fieldcatalog-seltext_m   = 'CT3 No'.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 8.
      fieldcatalog-tabname   = 'it_final'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'MBLNR'.
      fieldcatalog-seltext_m   = 'GRR No.'.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-tabname     = 'it_final'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'BUDAT'.
      fieldcatalog-seltext_m   = 'GRR DATE'.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 9.
      fieldcatalog-tabname     = 'it_final'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'NAME1'.
      fieldcatalog-seltext_m   = 'Vendor Name'.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 30.
      fieldcatalog-tabname   = 'it_final'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material No'.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 18.
      fieldcatalog-tabname   = 'it_final'.
      fieldcatalog-no_zero   = 'X'.
      fieldcatalog-key         = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'MAKTX'.
      fieldcatalog-seltext_m   = 'Matdesc'.
      fieldcatalog-col_pos     =  cnt.
      fieldcatalog-outputlen   =  30.
      fieldcatalog-tabname   = 'it_final'.
      fieldcatalog-key         = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    **Excise Duty
    cnt = cnt + 1.
    fieldcatalog-fieldname   = 'EDUTY'.
    fieldcatalog-seltext_m   = 'EXCISE DUTY '.
    fieldcatalog-col_pos     = cnt.
    fieldcatalog-outputlen   = 30.
    fieldcatalog-tabname   = 'it_final'.
    fieldcatalog-do_sum    = 'X'.
    APPEND fieldcatalog TO fieldcatalog.
    CLEAR  fieldcatalog.
    *Excise Duty
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'DBDTY'.
      fieldcatalog-seltext_m   = 'DEBIT DUTY '.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 12.
      fieldcatalog-tabname   = 'it_final'.
      fieldcatalog-do_sum    = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    *Excise Duty
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'CRDTY'.
      fieldcatalog-seltext_m   = 'CREDIT DUTY '.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 12.
      fieldcatalog-tabname   = 'it_final'.
      fieldcatalog-do_sum    = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    *Credit Date
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'CRDAT'.
      fieldcatalog-seltext_m   = 'Cr. DATE'.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 9.
      fieldcatalog-tabname     = 'it_final'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    *Closing Balance
      cnt = cnt + 1.
      fieldcatalog-fieldname   = 'CL_BALANCE'.
      fieldcatalog-seltext_m   = 'BALANCE AMT'.
      fieldcatalog-col_pos     = cnt.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-tabname   = 'it_final1'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
          i_callback_top_of_page   = 'TOP-OF-PAGE'
          it_fieldcat              = fieldcatalog[]
          i_save                   = 'X'
        TABLES
          t_outtab                 = it_final[]
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    ENDFORM.                    "DISPLAY
    Form  TOP-OF-PAGE                                                 *
    ALV Report Header                                                 *
    FORM top-of-page.
    *ALV Header declarations
      DATA: t_header TYPE slis_t_listheader,
            wa_header TYPE slis_listheader,
            t_line LIKE wa_header-info,
            ld_lines TYPE i,
            ld_linesc(10) TYPE c,
            v_date1(10),
            v_date2(10).
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'B-17 BOND REGISTER - INDIGENOUS RAW MATERIALS'.
      APPEND wa_header TO t_header.
      CLEAR wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = ' Report generated on Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      APPEND wa_header TO t_header.
      CLEAR: wa_header.
    opening balance
      wa_header-typ  = 'S'.
      wa_header-key = ' Opening Amount: '.
      wa_header-info = gv_op_balance.   "Opening amount
      APPEND wa_header TO t_header.
      CLEAR: wa_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
        i_logo             = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "top-of-page

  • Problems with ALV header

    Hi there,
    i've got a little problem with my ALV header. every time when i run my program and want to go back to the selection screen with the BACK-button i see my header again. so i've got to push the BACK-button again to get to the selection screen.
    here's my alv-code
    FORM TOP_OF_PAGE.
      REFRESH header_itab[].
      CLEAR wa_header.
      wa_header-typ = 'H'.
    *  wa_header-key = 'ausw1'.
      wa_header-info = text-001.
      APPEND wa_header TO header_itab.
      CLEAR wa_header.
      IF radio1 = 'X'.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton1'.
        wa_header-info = text-002.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ELSEIF radio2 = 'X'.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton2'.
        wa_header-info = text-003.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ELSEIF radio3 = 'X'.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton3'.
        wa_header-info = text-004.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ELSEIF radio4 = 'X'.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton4'.
        wa_header-info = text-005.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ELSE.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton5'.
        wa_header-info = text-006.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ENDIF.
      wa_header-typ = 'S'.
      wa_header-key = 'Benutzer:'.
      wa_header-info = sy-uname.
      APPEND wa_header TO header_itab.
      CLEAR wa_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = header_itab.
    ENDFORM.
    *       FORM alv_füllen                                               *
    FORM alv_fuellen .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program     = my_repid
                i_callback_top_of_page = 'TOP_OF_PAGE'
    *            i_grid_title           = my_title
                it_fieldcat            = feldkatalog_itab
                is_layout              = gs_layout
    *            it_events              = event_itab
           TABLES
                t_outtab               = itab
           EXCEPTIONS
                program_error          = 1
                OTHERS                 = 2.
    ENDFORM.
    *       FORM layout_allg_build                                        *
    FORM layout_allg_build.
           gs_layout-zebra  = 'X'.
           gs_layout-colwidth_optimize = 'X'.
    ENDFORM.
    hope someone can help me.
    regards tobias

    hi,
    i tried some of your ideas but none helped my.
    so here's my complete code
    maybe this is helpful.
    *& Report  z_cd_tool_awdimaiob
    REPORT z_cd_tool_awdimaiob.
    * G L O B A L   I N T E R N  A L   T A B L E S
    DATA: BEGIN OF itab OCCURS 100,
          status TYPE dimaiobpar-zstatus,
          rtyp TYPE  dimaiobpar-zrtyp,
          zahlweg TYPE dimaiobpar-ezawe_x,
          a_status TYPE i,
          a_rtyp TYPE i,
          a_partner TYPE i,
          a_vertraege TYPE i,
          END OF itab .
    * G L O B A L   D A T A
    DATA: ok_code LIKE sy-ucomm,
          wa_test_tab LIKE dimaiobpar,
          my_title TYPE lvc_title,
          my_repid LIKE sy-repid.
    TYPE-POOLS: slis.
    DATA:     feldkatalog_itab  TYPE   slis_t_fieldcat_alv,
         wa_feldkatalog    TYPE   slis_fieldcat_alv,
           event_itab        TYPE   slis_t_event,
           header_itab       TYPE   slis_t_listheader,
           gs_layout         TYPE   slis_layout_alv,
           alv_event         TYPE   slis_alv_event,
           wa_header         TYPE   slis_listheader.
    DATA: t_tab LIKE dimaiobpar.
    *selection-screen
    SELECTION-SCREEN: SKIP, BEGIN OF BLOCK test WITH FRAME TITLE text-010.
    SELECT-OPTIONS: partner FOR  t_tab-partner,
                    astatus FOR  t_tab-zstatus.
    SELECTION-SCREEN END OF BLOCK test.
    *Radiobutton
    SELECTION-SCREEN: SKIP, BEGIN OF BLOCK test2 WITH FRAME TITLE text-020.
    PARAMETERS: radio1 RADIOBUTTON GROUP test DEFAULT 'X',
                radio2 RADIOBUTTON GROUP test,
                radio3 RADIOBUTTON GROUP test,
                radio4 RADIOBUTTON GROUP test,
                radio5 RADIOBUTTON GROUP test.
    SELECTION-SCREEN END OF BLOCK test2.
    * S T A R T - O F - S E L E C T I O N.
    START-OF-SELECTION.
    * Select-Abfrage
      PERFORM select_data.
    *END-OF-SELECTION.
    * Feldkatalog fuellen.
      PERFORM feldkatalog_fuellen .
    * Feldkatalog übergeben
      PERFORM alv_feldkatalog.
    * ALV-Event
      perform alv_event.
    * Layout bestimmen.
      PERFORM layout_allg_build.
    * header aufbau
      PERFORM top_of_page.
      SORT itab.
      my_title = 'Auswertung Dimaiobpar'.
      my_repid = sy-repid.
      PERFORM exit_program.
    END-OF-SELECTION.
    * ALV mit daten füllen
      PERFORM alv_fuellen.
    *       FORM alv_event                                                *
    FORM alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type = 0
           IMPORTING
                et_events   = event_itab.
      READ TABLE event_itab
      WITH KEY name = 'TOP_OF_PAGE'
      INTO alv_event.
      IF sy-subrc EQ 0.
        MOVE 'TOP_OF_PAGE' TO alv_event-form.
        APPEND alv_event TO event_itab.
        ENDIF.
    ENDFORM.
    *       FORM alv_feldkatalog                                          *
    FORM alv_feldkatalog.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name     = my_repid
                i_internal_tabname = 'ITAB'
                i_inclname         = my_repid
    *            i_bypassing_buffer = 'X'
           CHANGING
                ct_fieldcat        = feldkatalog_itab
           EXCEPTIONS
                program_error      = 1
                OTHERS             = 2.
    ENDFORM.
    *       FORM header                                                   *
    FORM top_of_page.
      CLEAR wa_header.
      wa_header-typ = 'H'.
    *  wa_header-key = 'ausw1'.
      wa_header-info = text-001.
      APPEND wa_header TO header_itab.
      CLEAR wa_header.
      IF radio1 = 'X'.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton1'.
        wa_header-info = text-002.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ELSEIF radio2 = 'X'.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton2'.
        wa_header-info = text-003.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ELSEIF radio3 = 'X'.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton3'.
        wa_header-info = text-004.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ELSEIF radio4 = 'X'.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton4'.
        wa_header-info = text-005.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ELSE.
        wa_header-typ = 'S'.
        wa_header-key = 'Radiobutton5'.
        wa_header-info = text-006.
        APPEND wa_header TO header_itab.
        CLEAR wa_header.
      ENDIF.
      wa_header-typ = 'S'.
      wa_header-key = 'Benutzer:'.
      wa_header-info = sy-uname.
      APPEND wa_header TO header_itab.
      CLEAR wa_header.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = header_itab.
      REFRESH header_itab.
    ENDFORM.
    *       FORM alv_füllen                                               *
    FORM alv_fuellen .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program     = my_repid
                i_callback_top_of_page = 'TOP_OF_PAGE'
    *            i_grid_title           = my_title
                it_fieldcat            = feldkatalog_itab[]
                is_layout              = gs_layout
    *            it_events              = event_itab
           TABLES
                t_outtab               = itab
           EXCEPTIONS
                program_error          = 1
                OTHERS                 = 2.
    ENDFORM.
    *       FORM layout_allg_build                                        *
    FORM layout_allg_build.
           gs_layout-zebra  = 'X'.
           gs_layout-colwidth_optimize = 'X'.
    ENDFORM.
    *       FORM feldkatalog_fuellen                                      *
    FORM feldkatalog_fuellen.
    *Feldkatalog erstellen/füllen mit hilfe der if-schleife anhand des
    *gewählten Radiobuttons
    IF radio1 = 'X'.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'STATUS'.
           wa_feldkatalog-seltext_m     = 'Status'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'RTYP'.
           wa_feldkatalog-seltext_m     = 'Rechungstyp'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'A_RTYP'.
           wa_feldkatalog-seltext_m     = 'Anzahl Rechungstyp'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
    ELSEIF radio2 = 'X'.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'RTYP'.
           wa_feldkatalog-seltext_m     = 'Rechungstyp'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'A_STATUS'.
           wa_feldkatalog-seltext_m     = 'Anzahl Status'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
    ELSEIF radio3 = 'X'.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'STATUS'.
           wa_feldkatalog-seltext_m     = 'Status'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'RTYP'.
           wa_feldkatalog-seltext_m     = 'Rechungstyp'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'A_VERTRAEGE'.
           wa_feldkatalog-seltext_m     = 'Anzahl Verträge'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
    ELSEIF radio4 = 'X'.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'STATUS'.
           wa_feldkatalog-seltext_m     = 'Status'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'RTYP'.
           wa_feldkatalog-seltext_m     = 'Rechungstyp'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'A_PARTNER'.
           wa_feldkatalog-seltext_m     = 'Anzahl GPartner'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
    ELSE.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'STATUS'.
           wa_feldkatalog-seltext_m     = 'Status'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'RTYP'.
           wa_feldkatalog-seltext_m     = 'Rechungstyp'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'ZAHLWEG'.
           wa_feldkatalog-seltext_m     = 'Zahlweg'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
      CLEAR wa_feldkatalog.
           wa_feldkatalog-fieldname     = 'A_PARTNER'.
           wa_feldkatalog-seltext_m     = 'Anzahl GPartner'.
      APPEND wa_feldkatalog TO feldkatalog_itab.
    ENDIF.
    ENDFORM.
    *       FORM select_data                                              *
    FORM select_data.
    *select-abfrage mit hilfe der if-schleife, analog zum Feldkatalog
      IF radio1 = 'X'.
    *   Radiobutton1: Rechungstypen je Satus
        SELECT
           zstatus AS status
           zrtyp AS rtyp
           COUNT( DISTINCT zrtyp ) AS a_rtyp
           INTO CORRESPONDING FIELDS OF itab
           FROM dimaiobpar
           WHERE
           insobject LIKE 'V%' AND
           partner IN partner AND
           zstatus IN astatus
           GROUP BY ZSTATUS zrtyp
           ORDER BY zstatus.
          APPEND itab.
        ENDSELECT.
      ELSEIF radio2 = 'X'.
    * Radiobutton2: Status je Rechungstyp.
        SELECT
               zrtyp AS rtyp
               COUNT( DISTINCT zstatus ) AS a_status
               INTO CORRESPONDING FIELDS OF itab
               FROM dimaiobpar
               WHERE
               insobject LIKE 'V%' AND
               partner IN partner AND
               zstatus IN astatus
               GROUP BY  ZRTYP
               ORDER BY zrtyp.
          APPEND itab.
        ENDSELECT.
      ELSEIF radio3 = 'X'.
    * Radiobutton3: Anzahl Verträge je Status und Rtyp.
        SELECT
             zstatus AS status
             zrtyp AS rtyp
             COUNT( DISTINCT insobject ) AS a_vertraege
             INTO CORRESPONDING FIELDS OF itab
             FROM dimaiobpar
             WHERE
             insobject LIKE 'V%' AND
             partner IN partner AND
             zstatus IN astatus
             GROUP BY ZSTATUS zrtyp
             ORDER BY zstatus.
          APPEND itab.
        ENDSELECT.
      ELSEIF radio4 ='X'.
    *  Radiobutton4: Anzahl GPartner je Status und RTyp.
        SELECT
               zstatus AS status
               zrtyp AS rtyp
               COUNT( DISTINCT partner ) AS a_partner
               INTO CORRESPONDING FIELDS OF itab
               FROM dimaiobpar
               WHERE
               insobject LIKE 'V%' AND
               partner IN partner AND
               zstatus IN astatus
               GROUP BY ZSTATUS zrtyp
               ORDER BY zstatus zrtyp.
          APPEND itab.
        ENDSELECT.
      ELSE.
    * Radiobutton5: Anzahl Kunden nach Zahlweg.
        SELECT
             zstatus AS status
             zrtyp AS rtyp
             ezawe_x AS zahlweg
             COUNT( DISTINCT partner ) AS a_partner
             INTO CORRESPONDING FIELDS OF itab
             FROM dimaiobpar
             WHERE
             insobject LIKE 'V%' AND
             partner IN partner AND
             zstatus IN astatus AND
             ezawe_x IN ('E', 'F', space)
             GROUP BY ZSTATUS zrtyp EZAWE_X
             ORDER BY zstatus zrtyp.
          APPEND itab.
        ENDSELECT.
      ENDIF.
    ENDFORM.
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
    IF sy-ucomm = 'BACK' OR
       sy-ucomm = 'EXIT' OR
       sy-ucomm = 'CANCEL'.
      LEAVE PROGRAM.
      endif.
    ENDFORM.

  • Problems with alv-grid

    hello all,
    i've got a little problem with the output of an internal table with the ALV Grid.
    i have made the declaration of my internal table (itab) with DATA: Begin of itab... and i have build my own fieldcatalog.
    the output of the fieldcatalog is correct but i don't get the results of my itab shown.
    it only shows me the numbers of lines in my itab but not the content.
    for this im using 'REUSE_ALV_FIELDCATALOG_MERGE' and 'REUSE_ALV_GRID_DISPLAY'
    *ALV-Grid
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
          EXPORTING
            i_program_name        = sy-repid
           i_internal_tabname    = 'itab'
          i_structure_name = 'itab'
         i_client_never_display
         i_inclname            = sy-repid
         CHANGING
            ct_fieldcat            = feldkatalog_itab
          EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
    *ALV  call
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
           i_callback_program = sy-repid
                it_fieldcat   = feldkatalog_itab
                i_structure_name = 'itab'
               it_events     = event_itab
           TABLES
                t_outtab      = itab[]
           EXCEPTIONS
                program_error = 1
                OTHERS        = 2.
    when i debug my programm the lines of the itab are filled.
    thanks and regards
    Ayse
    REPORT z_test_auswertung.
    G L O B A L   I N T E R N  A L   T A B L E S
    DATA: BEGIN OF itab OCCURS 100,
          status TYPE dimaiobpar-zstatus,
          rtyp TYPE  dimaiobpar-zrtyp,
          zahlweg TYPE dimaiobpar-ezawe_x,
          a_status TYPE i,
          a_rtyp TYPE i,
          a_partner TYPE i,
          a_vertraege TYPE i,
          END OF itab .
    G L O B A L   D A T A
    DATA: ok_code LIKE sy-ucomm,
          wa_test_tab LIKE dimaiobpar,
          my_title TYPE lvc_title.
    TYPE-POOLS: slis.
    DATA:     feldkatalog_itab   TYPE   slis_t_fieldcat_alv,
         wa_feldkatalog     TYPE   slis_fieldcat_alv,
           event_itab         TYPE   slis_t_event,
           header_itab        TYPE   slis_t_listheader,
           wa_header          TYPE   slis_listheader.
    DATA:
      mycontainer TYPE scrfname VALUE 'BCALV_VARIANTS_0100_C1',
      my_grid             TYPE REF TO cl_gui_alv_grid,
      my_custom_container TYPE REF TO cl_gui_custom_container.
    DATA: t_tab LIKE dimaiobpar.
    *selection-screen
    SELECTION-SCREEN: SKIP, BEGIN OF BLOCK test WITH FRAME TITLE text-010.
    SELECT-OPTIONS: partner FOR  t_tab-partner,
                    astatus FOR  t_tab-zstatus.
    SELECTION-SCREEN END OF BLOCK test.
    *Radiobutton
    SELECTION-SCREEN: SKIP, BEGIN OF BLOCK test2 WITH FRAME TITLE text-020.
    PARAMETERS: radio1 RADIOBUTTON GROUP test DEFAULT 'X',
                radio2 RADIOBUTTON GROUP test,
                radio3 RADIOBUTTON GROUP test,
                radio4 RADIOBUTTON GROUP test,
                rafio5 RADIOBUTTON GROUP test.
    SELECTION-SCREEN END OF BLOCK test2.
    S T A R T - O F - S E L E C T I O N.
    START-OF-SELECTION.
      PERFORM select_data.
    CALL SCREEN 100.
      DATA ttab LIKE itab.
      MOVE itab TO ttab.
    Feldkatalog fuellen.
      PERFORM feldkatalog_fuellen .
    Feldkatalog übergeben
      PERFORM alv_feldkatalog.
    ALV mit daten füllen
      PERFORM alv_füllen.
    END-OF-SELECTION.
      SORT itab.
      my_title = 'Auswertung Dimaiobpar'.
      PERFORM exit_program.
          FORM alv_feldkatalog                                          *
    FORM alv_feldkatalog.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
          EXPORTING
                  i_program_name        = sy-repid
            i_internal_tabname    = 'ITAB[]'
        i_structure_name = 'TTAB'
        i_client_never_display
         i_inclname            = 'ITAB[]'
         i_bypassing_buffer = 'X'
         CHANGING
            ct_fieldcat            = FELDKATALOG_ITAB
            EXCEPTIONS
            program_error          = 1
            OTHERS                 = 2.
    ENDFORM.
          FORM alv_füllen                                               *
    FORM alv_füllen .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
           i_callback_program = sy-repid
           i_grid_title = my_title
                it_fieldcat   = FELDKATALOG_ITAB
               i_structure_name = 'ITAB'
               it_events     = event_itab
           TABLES
                t_outtab      = itab
           EXCEPTIONS
                program_error = 1
                OTHERS        = 2.
    ENDFORM.
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
    CALL METHOD G_CUSTOM_CONTAINER->FREE.
    CALL METHOD CL_GUI_CFW=>FLUSH.
      LEAVE PROGRAM.
    ENDFORM.
          FORM feldkatalog_fuellen                                      *
    FORM feldkatalog_fuellen.
      IF radio1 = 'X'.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'status'.
             wa_feldkatalog-seltext_m     = 'Status'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'rtyp'.
             wa_feldkatalog-seltext_m     = 'RTyp'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'a_rtyp'.
             wa_feldkatalog-seltext_m     = 'Anzahl RTyp'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
      ELSEIF radio2 = 'X'.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'rtyp'.
             wa_feldkatalog-seltext_m     = 'RTyp'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'a_status'.
             wa_feldkatalog-seltext_m     = 'Anzahl Status'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
      ELSEIF radio3 = 'X'.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'status'.
             wa_feldkatalog-seltext_m     = 'Status'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'rtyp'.
             wa_feldkatalog-seltext_m     = 'RTyp'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'a_vertraege'.
             wa_feldkatalog-seltext_m     = 'Anzahl Vertraege'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
      ELSEIF radio4 = 'X'.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'status'.
             wa_feldkatalog-seltext_m     = 'Status'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'rtyp'.
             wa_feldkatalog-seltext_m     = 'RTyp'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'a_gpartner'.
             wa_feldkatalog-seltext_m     = 'Anzahl GPartner'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
      ELSE.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'status'.
             wa_feldkatalog-seltext_m     = 'Status'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'rtyp'.
             wa_feldkatalog-seltext_m     = 'RTyp'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'zahlweg'.
             wa_feldkatalog-seltext_m     = 'Zahlweg'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
        CLEAR wa_feldkatalog.
             wa_feldkatalog-fieldname     = 'a_gpartner'.
             wa_feldkatalog-seltext_m     = 'Anzahl GPartner'.
        APPEND wa_feldkatalog TO feldkatalog_itab.
      ENDIF.
    ENDFORM.
          FORM select_data                                              *
    FORM select_data.
      IF radio1 = 'X' .
       WRITE / 'Radiobutton1: Rechungstypen je Satus'.
      WRITE / 'Status, Rtyp, Anzahl-Rtyp'.
       ULINE.
        SELECT
           zstatus AS status
           zrtyp AS rtyp
           COUNT( DISTINCT zrtyp ) AS a_rtyp
           INTO CORRESPONDING FIELDS OF itab
           FROM dimaiobpar
           WHERE
           insobject LIKE 'V%' AND
           partner IN partner AND
           zstatus IN astatus
           GROUP BY ZSTATUS zrtyp
           ORDER BY zstatus.
          APPEND itab.
         WRITE:  / itab.
        ENDSELECT.
      ELSEIF radio2 = 'X'.
       WRITE / 'Radiobutton2: Status je Rechungstyp'.
       WRITE /.
        SELECT
               zrtyp AS rtyp
               COUNT( DISTINCT zstatus ) AS a_status
               INTO CORRESPONDING FIELDS OF itab
               FROM dimaiobpar
               WHERE
               insobject LIKE 'V%' AND
               partner IN partner AND
               zstatus IN astatus
               GROUP BY  ZRTYP
               ORDER BY zrtyp.
          APPEND itab.
         WRITE:    / itab-rtyp, itab-a_status.
        ENDSELECT.
      ELSEIF radio3 = 'X'.
       WRITE / 'Radiobutton3: Anzahl Verträge je Status und Rtyp'.
       WRITE /.
        SELECT
             zstatus AS status
             zrtyp AS rtyp
             COUNT( DISTINCT insobject ) AS a_vertraege
             INTO CORRESPONDING FIELDS OF itab
             FROM dimaiobpar
             WHERE
             insobject LIKE 'V%' AND
             partner IN partner AND
             zstatus IN astatus
             GROUP BY ZSTATUS zrtyp
             ORDER BY zstatus.
          APPEND itab.
         WRITE: / itab-status, itab-rtyp, itab-a_vertraege.
        ENDSELECT.
      ELSEIF radio4 ='X'.
       WRITE: / 'Radiobutton4: Anzahl GPartner je Status und RTyp'.
       WRITE: /.
        SELECT
               zstatus AS status
               zrtyp AS rtyp
               COUNT( DISTINCT partner ) AS a_partner
               INTO CORRESPONDING FIELDS OF itab
               FROM dimaiobpar
               WHERE
               insobject LIKE 'V%' AND
               partner IN partner AND
               zstatus IN astatus
               GROUP BY ZSTATUS zrtyp
               ORDER BY zstatus zrtyp.
          APPEND itab.
        WRITE: / itab-status, itab-rtyp, itab-a_partner.
        ENDSELECT.
      ELSE.
       WRITE / 'Radiobutton5: Anzahl Kunden nach Zahlweg'.
       WRITE /.
        SELECT
             zstatus AS status
             zrtyp AS rtyp
             ezawe_x AS zahlweg
             COUNT( DISTINCT partner ) AS a_partner
             INTO CORRESPONDING FIELDS OF itab
             FROM dimaiobpar
             WHERE
             insobject LIKE 'V%' AND
             partner IN partner AND
             zstatus IN astatus AND
             ezawe_x IN ('E', 'F', space)
             GROUP BY ZSTATUS zrtyp EZAWE_X
             ORDER BY zstatus zrtyp.
          APPEND itab.
         WRITE: / itab-status, itab-rtyp, itab-zahlweg, itab-a_partner
        ENDSELECT.
      ENDIF.
    APPEND itab.
    ENDFORM=

    Hi,
    Make itab into capital letters as below
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    it_fieldcat = feldkatalog_itab
    i_structure_name = 'ITAB'
    * it_events = event_itab
    TABLES
    t_outtab = itab[]
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    <b>Reward for helpful answers</b>

  • Problem with alv subtotals

    i have problem with subtotals display in AVL
    actually my code is
    FORM fill_field_catalog_table USING  f d  t s I.
      DATA t_fld TYPE slis_fieldcat_alv.
      STATICS pos LIKE sy-index VALUE 0.
      pos = pos + 1.
      CLEAR t_fld.
      MOVE 1 TO   t_fld-row_pos.
      MOVE pos TO t_fld-col_pos.
      MOVE f TO   t_fld-fieldname.
      MOVE d TO   t_fld-seltext_m.
      MOVE t TO   t_fld-tabname.
      MOVE s TO   t_fld-do_sum.
      MOVE I TO   t_fld-NO_OUT.
      if not t_fld-NO_OUT is initial.      "based on a condition i am appendding the fieldcatlog
       APPEND t_fld TO it_fieldcat.
      endif.
    if i remove "if not t_fld-NO_OUT is initial."  this condition and append the fieldcat....
    subtotals is getting dispalyed.
    if i insert this code subtotals is not getting displayed...
    can any body help me out in this fashion...
    any input are required please fell free to contact me.
    madan

    Hi Madan,
    NO_OUT value range is 'SPACE' and 'X'
    check if u have gone wrong there
    SPACE is not same as INITIAL.
    Also go through the following piece of code..
    Execute it, u will understand it. At places comments will help u to understand better.
    *& Report  ZRAJ_SUBTOTAL_ALV
    REPORT  ZRAJ_SUBTOTAL_ALV.
    TYPE-POOLS: SLIS.
    DATA: G_REPID LIKE SY-REPID,
          GT_SORT TYPE SLIS_T_SORTINFO_ALV,
          GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
          GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
          COL_POS TYPE I.
    DATA: BEGIN OF ITAB,
      FIELD1(5) TYPE C,
      FIELD2(5) TYPE C,
      FIELD3(5) TYPE P DECIMALS 2,
          END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0.
            INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB1.
    DATA: BEGIN OF ITAB_FIELDCAT OCCURS 0.
            INCLUDE STRUCTURE ITAB.
    DATA: END OF ITAB_FIELDCAT.
    INITIALIZATION.
      G_REPID = SY-REPID.
    START-OF-SELECTION.
    * TEST DATA
      MOVE 'TEST1' TO ITAB1-FIELD1.
      MOVE 'TEST1' TO ITAB1-FIELD2.
      MOVE '10.00' TO ITAB1-FIELD3.
      APPEND ITAB1.
      MOVE 'TEST2' TO ITAB1-FIELD1.
      MOVE 'TEST2' TO ITAB1-FIELD2.
      MOVE '20.00' TO ITAB1-FIELD3.
      APPEND ITAB1.
      DO 50 TIMES.
        APPEND ITAB1.
      ENDDO.
    END-OF-SELECTION.
      PERFORM BUILD_CATALOG.
      PERFORM ALV_DISPLAY.
    *&      Form  build_catalog
    *       text
    FORM BUILD_CATALOG.
      DATA: FIELDCAT_IN TYPE SLIS_FIELDCAT_ALV.
      CLEAR FIELDCAT_IN.
      FIELDCAT_LN-FIELDNAME = 'FIELD1'.
      FIELDCAT_LN-TABNAME = 'ITAB1'.
    *FIELDCAT_LN-NO_OUT = 'X'. "FIELD NOT DISPLAY, CHOOSE FROM LAYOUT
      FIELDCAT_LN-KEY = ' '. "SUBTOTAL KEY
      FIELDCAT_LN-NO_OUT = ' '.
      FIELDCAT_LN-SELTEXT_L = 'HEAD1'.
      APPEND FIELDCAT_LN TO GT_FIELDCAT.
      CLEAR FIELDCAT_IN.
      FIELDCAT_LN-FIELDNAME = 'FIELD2'.
      FIELDCAT_LN-TABNAME = 'ITAB1'.
      FIELDCAT_LN-NO_OUT = 'X'.
      FIELDCAT_LN-SELTEXT_L = 'HEAD2'.
      APPEND FIELDCAT_LN TO GT_FIELDCAT.
      CLEAR FIELDCAT_IN.
      FIELDCAT_LN-FIELDNAME = 'FIELD3'.
      FIELDCAT_LN-TABNAME = 'ITAB1'.
      FIELDCAT_LN-NO_OUT = ' '.
      FIELDCAT_LN-DO_SUM = 'X'. "SUM UPON DISPLAY
      APPEND FIELDCAT_LN TO GT_FIELDCAT.
    * DATA SORTING AND SUBTOTAL
      DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
      CLEAR GS_SORT.
      GS_SORT-FIELDNAME = 'FIELD1'.
      GS_SORT-SPOS = 1.
      GS_SORT-UP = 'X'.
      GS_SORT-SUBTOT = 'X'. "This is an important statement
      APPEND GS_SORT TO GT_SORT.
      CLEAR GS_SORT.
      GS_SORT-FIELDNAME = 'FIELD2'.
      GS_SORT-SPOS = 2.
      GS_SORT-UP = 'X'.
    *GS_SORT-SUBTOT = 'X'. "Note: This should be commented
      APPEND GS_SORT TO GT_SORT.
    ENDFORM.                    "build_catalog
    *&      Form  alv_display
    *       text
    FORM ALV_DISPLAY.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
    * I_INTERFACE_CHECK = ' '
    * I_BYPASSING_BUFFER =
    * I_BUFFER_ACTIVE = ' '
      I_CALLBACK_PROGRAM = G_REPID
    * I_CALLBACK_PF_STATUS_SET = ' '
    * I_CALLBACK_USER_COMMAND = ' '
      I_STRUCTURE_NAME = 'ITAB1'
      IS_LAYOUT = GS_LAYOUT
      IT_FIELDCAT = GT_FIELDCAT[]
    * IT_EXCLUDING =
    * IT_SPECIAL_GROUPS =
      IT_SORT = GT_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
    * IMPORTING
    * E_EXIT_CAUSED_BY_CALLER =
    * ES_EXIT_CAUSED_BY_USER =
      TABLES
      T_OUTTAB = ITAB1
      EXCEPTIONS
      PROGRAM_ERROR = 1
      OTHERS = 2.
    ENDFORM.                    "alv_display
    hope this will solve your problem
    Regards Rajan.

  • Problem with ALV Filter Option

    Hi
    In 4.6C version when i click on a column for Filter option, i am able to key only 20 Chars( Visible length is 16 ). Whereas in 4.7 version,  i am able to key in 40 Chars in the Input field of the filter option. Is this a problem with 4.6C version. Please Help...

    Hi
    Can you check report BCALV_TEST_FULLSCREEN_FILTER in 46C. When you put a filter on C60 ( 60 Char field ) the screen display of select-option is small but when you select the multiple options, you can key in upto 60 chars and the filter works well. Check if thsi rpogram helps you.
    Cheers.

Maybe you are looking for

  • Issues with using utl_http with Oracle Wallet

    Hello Everyone, We are experimenting with Oracle wallet and utl_http and are attempting to do an https transfer and we are facing some problems. I will appreciate your help greatly if you can advise on what could be wrong. We are on db version 10.2.0

  • Error when installing jam pack/audio content on new imac

    Keep trying to install the audio/jam pack cd´s that came with my Logic Studio bundle on my new Imac/Leopard. When i´m almost done installing, it asks for the "logic" cd and then after a while i´m getting an error "installation failed"- disk corrupted

  • Call java class that exists in separate server

    We have a java class on application server that provides some functions for returning important message. We need to call some functions by using stored procedures or functions in DB. Can anyone tell me how to tell the procedure to connect to the appl

  • Using ITrip with Bluetooth Speakers

    Hi, I want to listen to the music on my IPhone while I am in my car but I also want to be able to make and receive calls. At the moment I make and receive calls through a Visorlite which is attached to my sun visor and bluetooth through my phone. I h

  • A Baffling ConnectNow Problem ....

    My colleage and I work in different parts of the state. We have been trying to get Acrobat ConnectNow to work in a vid-conf mode. He is using s MacBook Pro(OS X & loaded) and I am using a Dell desktop GX-520 (XP Pro SP3 also loaded). The MacBook Pro