UNexpected problem with ALV

Hi all,
I am trying an ALV report. The problem here is, If I define an internal table like this
TYPES: BEGIN OF t_ekko ,
         ebeln LIKE ekko-ebeln, " Purchasing Document Number
         bukrs LIKE ekko-bukrs, " Company Code
         bsart LIKE ekko-bsart, " Purchasing Document Type
         ernam LIKE ekko-ernam, " Name of Person who Created
                                " the Object
         lifnr LIKE ekko-lifnr, " Account Number of the Vendor
         line_color(4) TYPE c,         " Line color
       END OF t_ekko.
*---- Table Memory Allocation.
DATA i_ekko TYPE t_ekko OCCURS 0.
*---- Work area Declaration.
DATA wa_ekko LIKE LINE OF i_ekko.
when I call the FM reuse_alv_fieldcatalog_merge the field catalog is not being populated.
But when I change the declaration like this
data : begin of i_ekko occurs 0,
         ebeln LIKE ekko-ebeln, " Purchasing Document Number
         bukrs LIKE ekko-bukrs, " Company Code
         bsart LIKE ekko-bsart, " Purchasing Document Type
         ernam LIKE ekko-ernam, " Name of Person who Created
                                " the Object
         lifnr LIKE ekko-lifnr, " Account Number of the Vendor
         line_color(4) TYPE c,         " Line color
       end of i_ekko.
this is working properly. But there are other instances where even the types declaration worked for me. I do not understand the strange behavioUr of ALV. If anyone can explain please explain me this.
Regards,
Varun.

Hi Varun,
You can try to fill the field catalog manually in the program instead of using FM reuse_alv_fieldcatalog_merge.
DATA: ls_fcat type lvc_s_fcat.
clear: ls_fcat.
ls_fcat-fieldname = 'CARRID'.
ls_fcat-inttype = 'C'.
ls_fcat-outputlen = '3'.
ls_fcat-coltext = 'Carrier ID'.
ls_fcat-seltext = 'Carrier ID'.
append ls_fcat to pt_fieldcat.
clear: ls_fcat.
ls_fcat-fieldname = 'CONNID'.
ls_fcat-inttype = 'C'.
ls_fcat-outputlen = '3'.
ls_fcat-coltext = 'Connection ID'.
ls_fcat-seltext = 'Connection ID'.
append ls_fcat to pt_fieldcat.
You can also use a macro for this. Hope it helps.
Regards,
Neeraj Gupta

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

  • Unexpected problem with this printable

    Started by trying to stop the printing of the "Samples" printable that was acquired accidentally.  Tried directions found in the forums to no avail.  Tried through the HP Go manageprint route and never saw the minus sign in the printable header as described.  Trying on the control panel of the printer, I get to the "Select activity" option and select the "Schedule it" icon.  Loading....then error message:  "There was an unexpected problem with this printable.  Please try again later."  I also had problems previously connecting to web services when I tried to scan a document to my email address (which I have done many time previously successfully). Performed wireless network test and all results were good.  Something is screwed up.  Any assistance is appreciated. 

     I suspect the whole setup is "not quite right" and that is not your fault -- it is a multi-step process and if it does go well the first time around, it can seem like the size 14 is a solution to fit the need. I do not have an answer - know that.  The print App is stuck, no doubt about that. I will try and help you straighten out the setup; understand I am not a Printer Expert.  Not.  This may make it worse. You might want to call Cloud Services if you can do so...  SideBar:At the least, the Snapfish bits may be just one more worm in the bucket of troubles - at this point, you might as well Click Reset Snapfish -- frankly, while used to understand what Snapfish is and why it might be on the printer panel, I have never heard of Snapfish Country.  Final note about Snapfish -- if you ever get into some sort of evil loop about logging into (creating) your HP Connected Account and it is offing something about Snapfish account -- saying you have to have the Snapfish account or you can just die and never be able to log into your HP Connected Account:  Give the program what it wants --- it is a bug.  Create the Snapfish account and you will be able to get in.  I did not write the program.  I did not create the bug.  I may have done some stupid things when I wrote code in my life -- this one is not mine.  Smiling. You can "reset" at least the "web services" by simply disabling Web Services on the printer front panel.  This is perhaps a good plan all things considered; you might read first and then decide. The one thing I have noted is that I have never had had any luck resetting, redoing, or entering much of anything from a printer panel.  I lack the patience to type on tiny panels. I do know the Printable / Print App has to be "scheduled", that is, active before it can be cancelled.  So, if it is in some sort of zombie state of half-life, you may want log in to your HP Connected account and make sure the Print App is "active" -- then try to kill it. Also -- see the note below about the Safari browser -- there may be other browsers (Chrome??) that do not handle the HP Connected account management page setup.  There are several parts to the whole "ePrint" business.   The following might be useful to help you make sure you have your setup in place.-----------------------------------------------------------------------------------------Reference:Add Device to Printer See Section:Computer gets Full Feature Software (Printer Software)If you are printing from a mobile device on the same (home) network, then you probably have a home computer in the mix (on that same network).  On that home computer, you would want to have installed the Full Feature Software for the Printer. -----------------------------------------------------------------------------------------ePrint SetupThe ePrint setup on ePrint capable printers involves the setting of the printer's own email address and the switching on of the ePrint service on the printer.  The ePrint email address is the email address to which you send your print jobs from your mobile device(s).  Note that a mobile device can also include your notebook computer.  "If you can send an email, you can use ePrint." -----------------------------------------------------------------------------------------The HP Connected AccountThe HP Connected Account (still called ePrint account in some countrys) is the account you use to manage your ePrint setup.  You can customize your ePrint email address, add / remove your ePrint printer from the HP Connected account, check your ePrint job log, and -- when things are working as intended -- manage your Print Apps (formally Printables). For example,If you have had to Reset Web Services, you may need to log into your HP Connected Account > Settings > and Add your printer. If you have had to Reset Web Services, you must change your Custom ePrint email address. If you gave your ePrint address to someone you no longer "like", you can change the address or remove that person from the "Allowed Senders" list. There are a couple of oddities having to do with the managing of the HP Connected Account.  For all that it is intended to be fully functional under most circumstances, some Browsers do not seem to be able to handle the code in which the WebPage is written.  Safari is notorious for not handling the Print Apps section of the HP Connected setup.   If you have trouble managing the features in  your HP Connected Account, try a different Browser. -----------------------------------------------------------------------------------------Mobile Device / iPad gets an App Once everything else is set up, mobile device(s) can be added to the ePrint setup.  The type of Application used to support the mobile device depends on the device. For example, iPhone and other Apple flavored products typically use those products found in the Apply Store.  Android has its own download, etc. Most devices and printers that can be connected with ePrint or some sort of Cloud or Web services print service are mentioned and / or covered in the Mobile Printing Link in the document. -----------------------------------------------------------------------------------------Troubleshooting and Additional HelpTips, Suggestions, lists, and extra "bits".   When you see a Post that helps you,Inspires you, provides fresh insight,Or teaches you something new,Click the "Thumbs Up" on that Post. Click my Answer Accept as Solution to help others find Answers.

  • 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

  • HT201250 Unexpected problem with Mac time machine!

    Hi every one!
    I'm having an unexpected problem with my time machine! the moment I hook up the back up drive my Mac crashes and the only thing I can do is to force restart. I'm not sure if the problem is with the back up disk or the Time Machine itself. I've successfully used the app since now and this just happens! I can neither access the disk in finder nor fix it by disk utility... would you please help me?
    PS. the disk is encrypted, I doubt that might be causing the problem?!    
    Thank you!
    chargar

    Launch the Console application by entering the first few letters of its name into a Spotlight search. Enter the name of the crashed process in the “Filter” text field. Post the messages from the time of the last crash, if any -- the text, please, not a screenshot.
    Then, still in the Console window, look under User Diagnostic Reports for crash logs related to the process. Select the most recent one and post the contents -- again, not a screenshot. For privacy’s sake, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)

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

Maybe you are looking for