How to  learn about ALV Grid?

Hi Experts,
I dont about ALV grid and how to implement it.So can anyone let me know how to implement the simple basic ALV grid with example?
Please explain me with set by step procedure.
Thanks a lot in Advance,
Regards,
Raghu

hi,
Process to create ALV with OOPs:
Step 1:
Create a container. There are 2 type of containers: docking and custom.
Go to SE38.Create a program. Use Pattern button to create object for docking container. Click ABAP Object Pattern radio button. Click Create object radio button. Give Instance as o_docking and class as cl_gui_docking_contianer.
Step 2:
Create a grid inside the container.
Use Pattern button to create the same. Make the parent of grid as container.
Click ABAP Object Pattern radio button. Click Create object radio button. Give Instance as o_grid and class as cl_gui_alv_grid. Create object o_grid.
Step 3:
Call the function lvc_fieldcatalog_merge to get the field catalog.
Pass the structure name.
Step 4:
Call the method of grid set_table_for_first_display to display the output.
Click ABAP Object Pattern radio button. Click Call Method radio button. Give Instance as o_grid and Class/Interface as cl_gui_alv_grid and Method as set_table_for_first_display.
w_variant-report = sy-repid.
Call method o_grid->set_table_for_first_display
Step 5:
Fill the internal table itab with values by using logic.
select * from mara into table itab up to 100 rows.
call screen 9000.
Create a screen by double clicking 9000 in the above line. Fill the description for the screen. In the flow logic, uncomment the PBO and PAI module and create those in main program (for simplicity).
Step 6:
Create GUI status. Create GUI Title if required. That can be done by using display object List (CtrlShiftF5).Then in left side, right click the program and create GUI Status and Title.
Step 7:
Free the memory occupied once the BACK, EXIT or CANCEL button is clicked. Use Pattern button to call the method FREE of cl_gui_alv_grid and cl_gui_docking_container.
Click ABAP Object Pattern radio button. Click Call Method radio button. Give Instance as o_grid and Class/Interface as cl_gui_alv_grid and Method as Free.
Similarly Click Call Method radio button. Give Instance as o_docking and Class/Interface as cl_gui_docking_container and Method as Free.
Also follow these links.
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Hope this helps, Do reward.

Similar Messages

  • How to send the ALV GRID output to spool by using the print button in std t

    How to send the ALV GRID output to spool by using the print button in standard tool bar.
    We have created a button in the va02 transaction.  If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept.  But i am unable to send the output to spool using the print button in the standard tool bar.
    I am able to display the Print parameter dialog box but i am not able to send it to spool.
    Kindly help.
    Thanks In Advance.
    G.V.Ramana

    Hi Shaik,
    There is not properties button in my print screen.
    MODULE user_command_0900 INPUT.
        WHEN 'EXCEL'.
          PERFORM excel_download.                              
        WHEN 'PRI'.
          PERFORM print_output.
    form Print_output.
    CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
               EXPORTING
                    columns        = 80
                    device         = 'ANY '
                    lines          = 65
                    maxpenality    = 1999
               TABLES
                    layouts        = lt_layouts1
               EXCEPTIONS
                    unknown_device = 1
                    OTHERS         = 2.
          IF sy-subrc = 0.
            LOOP AT lt_layouts1.
              IF lt_layouts1-penality < 1000        AND
                 lt_layouts1-penality < l_min_penality.
                l_layout       = lt_layouts1-layout.
                l_min_penality = lt_layouts1-penality.
              ENDIF.
            ENDLOOP.
            IF NOT l_layout IS INITIAL.
              CALL FUNCTION 'GET_PRINT_PARAMETERS'
                   EXPORTING
                        mode                   = 'CURRENT'
                        line_size              = 80             "#EC *
                new_list_id            = l_new_list_id
                        no_dialog              = l_no_dialog
                        layout                 = l_layout
                   IMPORTING
                        out_archive_parameters = rs_arc_params
                        out_parameters         = rs_pri_params
                        valid                  = l_valid
                   EXCEPTIONS
                        archive_info_not_found = 1
                        invalid_print_params   = 2
                        invalid_archive_params = 3
                        OTHERS                 = 4.
              IF sy-subrc NE 0.                                 " INS SLIN
              ENDIF.                                            " INS SLIN
              IF rs_pri_params-linsz LT 80 OR
                 rs_pri_params-linsz LT gt_stack-s_lprint-width.
                gt_stack-print_line_break = 'X'.
              ELSE.
                CLEAR gt_stack-print_line_break.
              ENDIF.
              IF l_valid NE 'X'.
                rs_pri_params = ls_pri_params_sav.
                rs_arc_params = ls_arc_params_sav.
              ENDIF.
            ENDIF.
          ENDIF.
    endform.                    " Print_output
        CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
                EXPORTING
                   is_layout         = gs_layout_cost_tot_grand
                CHANGING
                   it_fieldcatalog   = gt_fcat_cost_tot_grand[]
                   it_outtab         = gt_cost_tot_grand[].
    Please check my code

  • How to read a alv grid row data from standard program

    Hi All,
    I am working on transaction LBK1. Actually when you will open this transaction in the left hand side it will show you the data in tree. When you click on a notification node it will show the relevant data in right side. In which there is a operation tab . In this tab the data comes in alv grid. If user selects a row then I have to get that selected row value. There is also a toolbar above on the tree side. There are some buttons which execute our implementation class where I can put the code.  
    Can anyone please help me out? How I can read that selected row in our class/method?
    Thanks in advance.
    Best Regards
    Ritu

    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows and set_selected_rows. There are similiar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected row(s) to read the information in the rows fronm the table. In the examples below the grid table is named gi_sflight.
    Data declaratrion:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
      CALL METHOD go_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines = 0.
        CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
             EXPORTING
                  textline1 = 'You must choose a valid line'.
        EXIT.
      ENDIF.
      LOOP AT gi_index_rows INTO g_selected_row.
         READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
        ENDIF.
      ENDLOOP.
    Example 2: Set selected row(s).
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      IF l_lines > 0.
        CALL METHOD go_grid->set_selected_rows
            exporting
              it_index_rows = gi_index_rows.
      ENDIF.

  • How to get the alv grid report in another screen when double click on basic

    Hi.
    I have created an alv report using class cl_gui_alv_grid.I got another report in the same screen,when double clicked on basic list(using double_click event).I want to get this report in another screen.What i have to do?(In classical reports i worked with sy-lsind = 1 ,but how to do here?)
    How to set color to the selected rows in the alv grid report?I worked with change_data_from_inside method of cl_gui_alv_grid.But it didn't work out..
    With Regards,
    Ramana.

    On double click event . you will have to call another screen say 9000.
    now within screen 900 PBO.. you will have to prepare the fieldcatalog/layout.. and the table to be displayed there.
    in PAI of screen 9000, you can return to the original ALV.
    method double_click.
    call screen 9000.
    endmethod.
    " now in PBO create a module display_alv2
    module display_alv2.
    'prepare the fieldcat/layout info for new alv
    'add the data to the new ALV table
    'instantiate the grid call.. etc
    'call the ALV
    endmodule
    "in PAI
    module exit.
    case sy-ucomm.
    when 'ENT1'.
      leave to screen 0.
    endcase.
    endmodule
    while preparing the field catalog you can mention the EMPHASIZE field, whish will give color to tht column
    E.g
    *--Service Order
        ls_fieldcat-tabname   = 'IT_FINAL_VALID'.
        ls_fieldcat-fieldname = 'AUFNR'.
        ls_fieldcat-scrtext_m = 'Service Order'.
        ls_fieldcat-ref_table = 'AUFK'.
        ls_fieldcat-ref_field = 'AUFNR'.
        ls_fieldcat-col_pos   = 1.
        ls_fieldcat-outputlen = 12.
        ls_fieldcat-emphasize = 'C400'.  "This will add color to the cell
        APPEND ls_fieldcat TO fcat_valid.
    Hope this helps.

  • How to use two ALV grids in a single program (pl read below for details)?

    Please read thoroughly::
    I have an ALV report using REUSE_ALV_GRID_DISPLAY.
    On the output of this report, when I click on a "change" button, a couple of columns should be made editable.
    I achieved this by modifying the fieldcatalog and triggering the output with another REUSE_ALV_GRID_DISPLAY.
    When I click on the back button of this second report, it is still taking me to the first one.
    How to over come this?
    Note:
    I used custom containers etc but the default buttons on the container are not controllable. I added custom buttons but could not suppress the default ones. So I did not pursue this much even though this is more comfortable to use.
    I am not able to get into the code in debug to see how the default buttons like COPY, INSERT ROW etc are working.
    Can any body throw some inputs into this?
    Thanks,
    Ven.

    >I achieved this by modifying the fieldcatalog and triggering the >output with another REUSE_ALV_GRID_DISPLAY.
    >When I click on the back button of this second report, it is still >taking me to the first one.
    >How to over come this?
    For this there is a solution
    i am thinking you are using user_command and calling the second time ALV Grid if so check this.
    form user_command using r_ucomm type sy-ucomm selfield type slis_selfield.
    case r_ucomm.
    when 'CHANGE'.
    selfield-exit = 'X'.   "use this , this will solve the problem
    "i hope you are calling the Function here
    endform.

  • How do I save ALV Grid O/P to spool

    Hi All,
               I have a requirement of saving alv grid output to spool. How can this be done?
    could I get any help on this?
    Thanks & Regards,
    Deepak Raj

    DATA: BEGIN OF i_mara OCCURS 0,
      matnr LIKE mara-matnr.
      DATA: END OF i_mara.
      DATA: v_dest LIKE tsp01-rqdest,
      v_handle LIKE sy-tabix,
      v_spool_id LIKE tsp01-rqident,
      v_rc TYPE c,
      v_errmessage(100) TYPE c,
      v_text(70) TYPE c.
    START-OF-SELECTION.
      SELECT matnr FROM mara INTO TABLE i_mara.
      CALL FUNCTION 'RSPO_OPEN_SPOOLREQUEST'
           EXPORTING
                dest            = 'LOCL'
               layout          =
               name            =
               suffix1         =
               suffix2         =
               copies          =
               prio            =
               immediate_print =
               auto_delete     =
               titleline       =
               receiver        =
               division        =
               authority       =
               posname         =
               acttime         =
                lifetime        = '8'
               append          =
               coverpage       =
               codepage        =
               doctype         =
           importing
                handle          = v_handle
                spoolid         = gd_spool_nr
                rc              = v_rc
                errmessage      = v_errmessage.
      LOOP AT i_mara.
        v_text = i_mara-matnr.
        CALL FUNCTION 'RSPO_WRITE_SPOOLREQUEST'
             EXPORTING
                  handle           = v_handle
                  text             = v_text
                  length           =
                  codepage         =
                  truncate         =
             importing
                  rc               = v_rc
                  errmessage       = v_errmessage
             EXCEPTIONS
                  handle_not_valid = 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.
      ENDLOOP.
      CALL FUNCTION 'RSPO_CLOSE_SPOOLREQUEST'
           EXPORTING
                handle           = v_handle
           IMPORTING
                rc               = v_rc
                errmessage       = v_errmessage
           EXCEPTIONS
                handle_not_valid = 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.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    get the spool number
    Declaration of local variables.
      DATA:
      lv_rq2name LIKE tsp01-rq2name.
      CONCATENATE sy-repid+0(8)
      sy-uname+0(3)
      INTO lv_rq2name SEPARATED BY '_'.
    Get the spool number.
      SELECT * FROM tsp01 WHERE rq2name = lv_rq2name
      ORDER BY rqcretime DESCENDING.
        v_rqident = tsp01-rqident.
        EXIT.
      ENDSELECT.
      IF sy-subrc NE 0.
        CLEAR v_rqident.
      ENDIF

  • Question ABout ALV GRIDS

    Hi,
    I need to add a custom button to the alv grid menu and i couldnt able to see the screen when i execute this program. Will u please tell me how to add a new button to the existing application toolbar of the ALV grid. I had tried this code but couldnt succeeded.
    Here is my code.
    REPORT ZZZZ .
    *& Report  ZZZZ
    type-pools: slis.
    Data to be displayed
    data: gt_wrkpool type  table of zte_wrkpool.
    data: gs_wrkpool type zte_wrkpool.
    data: gs_layout type slis_layout_alv.
    DATA:G_REPID TYPE SY-REPID.
    Selection
    select * from zte_wrkpool into corresponding fields of table gt_wrkpool.
    Eingabebereit
    gs_layout-edit = 'X'.
    G_REPID = SY-REPID.
    Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
         exporting
              I_CALLBACK_PROGRAM       = g_repid
              I_CALLBACK_USER_COMMAND = 'ACTION'
              I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
              i_structure_name        = 'zte_wrkpool'
              is_layout               = gs_layout
             IT_SORT = SORT[]
             IT_EVENTS = events[]
         tables
              t_outtab                = gt_wrkpool.
    FORM pf_status_set USING gt_extab TYPE slis_t_extab.
    SET PF-STATUS <ZSTANDARD>.
    ENDFORM.
    Create another subroutine:
    *&      Form  user_command
      Takes the User command and acts accordingly
    FORM user_command  USING r_ucomm     LIKE sy-ucomm
                           rs_selfield TYPE slis_selfield.
    call function 'sAP_WI_FORWARD'
    endform.

    Hi vicky,
    1. The important things are :
    a) New PF-STATUS is required , say 'ABCD'.
    b) Handle user_commmand
    2. First of all, from Function group SALV,
    copy the STANDARD gui status to your program,
    from SE80, by right clicking.
    3. come to your program.
    start-of-selection.
    SET PF-STATUS 'ABCD'.
    4. Double click ABCD and activate the gui status.
    6. AT USER-COMMAND.
    IF sy-ucomm = 'MYFCODE'.
    ENDIF.
    regards,
    amit m.

  • About ALV Grid

    I am using ALV Grid with logo display.At the time of print preview logo was not displayed.
    Regards
    Hari

    hi Hari,
    U can have look in one of the links
    Simple ALV report
    http://www.sapgenie.com/abap/controls/alvgrid.htm
    http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    Check the program in the following link:
    http://sap-img.com/abap/display-secondary-list-using-alv-grid.htm
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    13. Top-of-page in ALV
    selection-screen and top-of-page in ALV
    14. ALV Group Heading
    http://www.sap-img.com/fu037.htm
    How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    15. ALV output to PDF conversion
    It has an example code for PDF Conversion.
    http://www.erpgenie.com/abap/code/abap51.htm
    converting the output of alv in pdf
    Cheers
    Mohinder Singh Chauhan

  • How to kill an alv-grid object and refresh the frontend

    Hello experts,
    i have created an alv-grid display!
    now i want to hide the whole alv-table on the screen when user e.g. hits a button!
    How can i kill this object and refresh the frontend?
    Thanks a lot,
    Marcel

    Hello Marcel
    For this requirement I would use the following approach:
    (1) main screen '0100': here you display your ALV grid
    (2) Define a dummy screen '0101' the user will never see
    (3) Link the container for the ALV grid (e.g. go_docking) to the dummy screen when the user pushes the HIDE button (method LINK)
    (4) Link the container back to your main screen when the user pushes the DISPLAY button
    I never ever destroy a grid control and re-build it from scratch but always use either of its methods REFRESH_TABLE_DISPLAY or SET_TABLE_FOR_FIRST_DISPLAY.
    Regards
       Uwe

  • How to create editable ALV grid/list

    Hi,
    I want to create editable ALV grid/list so that user can modify the data in the ALV.
    And when user presses save button data will get saved in Z table.
    I dont know how to create editable ALV so could anybody please help me regarding this?
    Thanks & regards,
    Sameer Dhuke

    HI
    check the demo programs BCALV_FULLSCREEN_GRID_EDIT
    BCALV_GRID_EDIT
    BCALV_TEST_GRID_EDIT_01
    BCALV_TEST_GRID_EDITABLE
    REUSE_ALV_GRID EDITABLE
    ALV Grid editable fields
    Just to make things a bit easy
    In the layout,there is a property called edit, make it 'X' for the particular field whichever you want to make editable.
    Hope this helps,
    Suruchi
    Message was edited by:
            Suruchi Mahajan

  • How to increase the alv grid size dynamically

    Hi all,
    I have to develop the report with the following requirement:
    I have to take bwkey from t001k on basis of bukrs and bwkey. this bukrs and bwkey are entered in selection-screen.
    I have to select matnr, lbkum, salk3 from mbew on basis of bwkey in selection-screen.(this is select options)
    now the ouput should be as follows:
    for example :
                        ef01                efo2               ef03
    matnr     lbkum  salk3  lbkum    salk3      lbkum  salk3         total
    700001     3       4            0        0            0            0                    7
    700010     0       0            2       1             0            0                    3
    The output should be as mentioned above.
    In the above output,
    in the first record for 700001, the total of 3 and 4 is displayed as total 7 and
    for 700010 , it is displayed as 3.
    the get the output as above in the alv grid,
    I have taken bwkeys in t001k and remaining fields from mbew and joined them in final internal table.
    now in the final table ifinal, i have the following fields,
    matnr lbkum salk3 bwkey total.
    now when i want to display the output, it is displaying as normal output like
    mantr bwkey lbkum salk3 total
    700001 etap   3         4      7
    700002 etap   1        2       3
    but i want to display in the first mentioned format.
    so i tried to attach the bwkey values in it001k(this is internal table for t001k) for the final field catalog so that this bwkeys are displayed as column headings in the final output. but it is not displaying.
    Please suggest me the solution to display the output in the above first mentioned
    format as soon as possible
    points will be awarded.
    thanking u in advance.
    A.Srinivas

    hi ,
    u can set the row count to any number , here I am setting it to 5 using the method set_visible_row_count
    1 Change the visible row count to u20185u2019
      DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
        DATA lo_value TYPE REF TO cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
        lo_value->if_salv_wd_table_settings~set_visible_row_count( '5' ).
    u can also go thru this useful links for CONFIGUIRING ALV :
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4;jsessionid=(J2EE3417400)ID0488867050DB10849380333905377829End
    SAP List Viewer (ALV) [original link is broken]
    Configuring ALV
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9?overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/db22242d-0701-0010-28a2-aeaa1fefd706;jsessionid=(J2EE3414800)ID0133346050DB00727847586176044227End?overridelayout=true&bcsi_scan_06B6B0A4B65849C2=0
    I hope it shud solve ur query.
    regards,
    amit

  • How to show an ALV grid in planning book (using macro-exit)

    Hi Expertss,
    I am using a macro-exit. Now in the execution flow of this macro-exit I am required to shaow an ALV grid. I tried calling a Zreport in which i am calling alv screen(screen type dialog box). It is giving a short-dump saying Exception condition "CNTL_ERROR" raised.
    If i comments the fieldcatlog and structure name while calling the ALV in my Zreport then the alv is coming but then planning book is not vivible.
    Kindly tell what thing I am missing and what probable thing I can do to make it work.
    Thanks a lot in advance.

    I got the solution.

  • How to print an alv grid

    Hello All,
    I want to print data on an alv grid to spool according the current layout using code.
    Can anyone give me suggestion, maybe some sample code?
    Thanks in advance,
    Alex

    Hi,
    I have 2 ALV grid in the screen and pront to spool of both ALV's using OOp.
    Please find sample code. Whenever report runs in the background i simply call this print subroutine after creating fieldcatalog, layout, sorting table etc.
    FORM list_append TABLES ut_table
                     USING  u_no      TYPE char1
                            u_tabname TYPE slis_tabname.
      IF u_no CA '13'.
        MOVE        'TOP_OF_PAGE'        TO ls_event-name.
        CONCATENATE 'TOP_OF_PAGE' u_no INTO ls_event-form.
        APPEND ls_event TO lt_events.
      ELSE.
        MOVE        'TOP_OF_LIST'        TO ls_event-name.
        CONCATENATE 'TOP_OF_LIST' u_no INTO ls_event-form.
        APPEND ls_event TO lt_events.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
           EXPORTING
                it_fieldcat                = lt_fieldcat
                is_layout                  = ls_layout
                i_tabname                  = u_tabname
                it_events                  = lt_events
                it_sort                    = lt_sort
    *           i_text                     =
           TABLES
                t_outtab                   = ut_table
           EXCEPTIONS
                program_error              = 1
                maximum_of_appends_reached = 2
                OTHERS                     = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                               " LIST_APPEND
    *       Form  f_list_display
    FORM f_list_display.
      DATA ls_print TYPE slis_print_alv.
      ls_print-no_print_selinfos  = 'X'.   " Display no selection infos
      ls_print-no_print_listinfos = 'X'.   " Display no listinfos
      ls_print-reserve_lines      = 2.     " Lines reserved for end of page
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
           EXPORTING
                i_interface_check = ' '
                is_print          = ls_print
           EXCEPTIONS
                program_error     = 1
                OTHERS            = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                               " F_LIST_DISPLAY
    May this will help you.
    aRs
    Message was edited by:
            aRs

  • How to print multiple ALV Grids with only one print dialog?

    Hi,
    I have a report that has multiple ALV grids in splitter containers. The users want to be able to print those ALVs by pushing only one print button. I got it to work (parameter IS_PRINT and method SET_FRONTEND_PRINT before calling SET_TABLE_FOR_FIRST_DISPLAY) but I can't find a way to avoid that the printer dialog pops up for every grid I print.
    I tried to use the function module approach with REUSE_ALV_LIST_DISPLAY but have the same issue. Any thoughts?
    Thanks,
    Guenther

    Hi Peluka,
    Well, that's exactly what I am doing. Putting one central button in the app is not the problem; the issue is that the print dialog (to select the printer) pops up for every  individual ALV grid. E.g. if I place 4 ALV grids on my screen and trigger their print from a central button, I am getting 4 print dialogs.
    Cheers,
    Guenther

  • About ALV Grid's cell merge..Helpppp

    Dear gurus:
    I just write some code in order to learn alv.
    but i find when i sort the data by 'carrid', the cells which have same data was merged. and i declare the cell_merge = space, the result is just the same, how can i solve it? i want the cells not merge.
    REPORT  zzalv17.
    TYPE-POOLS: slis.
    TABLES: spfli.
    DATA: it_sortinfo TYPE slis_t_sortinfo_alv,
          wa_sortinfo TYPE slis_sortinfo_alv,
          it_layout TYPE slis_layout_alv,
          it_spfli LIKE STANDARD TABLE OF spfli.
    SELECT *
    INTO CORRESPONDING FIELDS OF TABLE it_spfli
    FROM spfli.
    CLEAR wa_sortinfo.
    wa_sortinfo-spos = 1.
    wa_sortinfo-fieldname = 'CARRID'.
    wa_sortinfo-up = 'X'.
    APPEND wa_sortinfo TO it_sortinfo.
    it_layout-zebra = 'X'.
    it_layout-detail_popup = 'X'.
    it_layout-colwidth_optimize = 'X'.
    it_layout-cell_merge = space.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        it_sort          = it_sortinfo
        is_layout        = it_layout
        i_structure_name = 'SPFLI'
        i_save           = 'X'
      TABLES
        t_outtab         = it_spfli.

    Its a little miss leading, isn't it.  Anyway, I was seeing the same, so I looked into the underlying code, and it is expecting that you pass an "N" in order to suppress the merging, so set it to "N" and it will work.
    it_layout-cell_merge = 'N'.
    Regards,
    RIch Heilman

Maybe you are looking for

  • In serious need of some guidance.

    If you look at my post history, you'll see I've been complaining about my Early-2008 iMac recently and how it crashes after waking up from sleep. It use to do this about once every couple of months. No it's getting to the point where I can't use it w

  • Weird Preview, Help!!!

    I accidently hit a button and now its in this werid preview where only the image is lit up. Its really annoying and I need to know what button to push to get it back. Thank you!!

  • How do I 'invert drawbars' in control surfaces?? Korg NanoKontrol & VB3

    I've set up my Korg nanokontrol with VB3 organ, and all is OK apart from the drawbars are inverted. (When I pull the fader down the drawbar decreases in volume rather than the other way around). Is there something to select to 'Flip' this action. The

  • Hosting Plans -- Large Bandwidth needed!

    I started my podcast back in late February, and I've switched servers a couple times, starting with my school's personal web server (however I recently graduated) and then moving to GoDaddy's biggest plan, which has 2,000GB of bandwidth monthly. Howe

  • Uploading Error: AIR version must be 1.5.3 or higher

    I get this error when I try uploading my AIR app to Melrose. It uploads and then this error appears. My SDK version is Adobe AIR 2.0.2 and I'm compiling using Flash CS 4 on Mac OS X 10.5. Any ideas why I would get this error?