Grid ALV Output to Screen  as well as to Spool.

Hi Masters,
I have one requirement in which I have to Send the Grid ALV Output to Screen as well as to Spool.
Can Anybody suggest any solution?
and most Important 
Helpful answers will get definitely awarded.
Thanks in advance

ALV Grid Output cannot be sent to Sppol.
REUSE_ALV_GRID_DISPLAY function module will not work when the program runs in background mode.
You should use the LIST Display function module when you run the program in Background.
code like:
if sy-batch = 'X'.
call function 'REUSE_ALV_LIST_DISPLAY'...
endif.
Regards,
Ravi Kanth Talagana

Similar Messages

  • How to get report output on screen as well as in spool?. Spool to be mailed

    Hi All,
    Can any guide the approach for:
    Foreground run:
    Get report output on screen as well as generate a spool. The content of spool needs to be mailed.
    Background run:
    we need to generate the spool and mail the spool contents.
    Am aware of usage of FMs 
    1. GET_JOB_RUNTIME_INFO
    2. RSTS_GET_ATTRIBUTES
    3. CONVERT_OTFSPOOLJOB_2_PDF
    4. SO_DOCUMENT_SEND_API1
    Regards
    Raj

    Hi All,
    I had solved the issue by having two separate blocks for processing based on mode of execution.
    Background:
        1.  Initiate spool
        2. Write the summary
        3. Close spool, build PDF and mail the same.
    Foreground:
       1.  Initiate spool
        2. Write the summary
        3. Close spool, build PDF and mail the same.
       Write summary again (for display on screen).
    Regards
    Raj

  • How to change the Grid ALV output resolution according to screen

    Hi All,
    I have a requirement in which I have to adjust the Grid ALV Output Screen resolution according to user screen. I mean if the user has any type of  screen (17'' , 15'', 12.1'' ),  the output should be completely fit to his screen.
    Helpful solution will definitely be rewared.
    Amit Varlani

    Hi!
    I doesn't depends on the screen size only the desktop resolution.
    If the desktop resolution is set to 1024*768 on every computer, then it will be the same all the time.
    You can set the desktop resolution in your windows (right click on desktop - properties - settings).
    Regards
    Tamá

  • ALV output as an attachment to mail

    Hi all,
    I have an requirement where in an interface i populate a ALV data and i need to pass the ALV output as an attachment to a mail send to some shared folder in SAP mail office. Indeed i should not display the output but rather capture the output and send it as an attachment to mail. Tried using with SPOOL, able to capture the ALV output in background but the retrieval of spool id being generated during that process seems to be difficult. if some one has already worked on this kind of requirement may throw some light on this.
    thanks,
    Jagath

    Hi Zhenglin hu,
    thanks for your valuable information. well it indeed was really helpful, but i have a small problem which is when i call the FM print_report and executemy ALV the output gets attached to spool but it displays a spool request screen which will stop my interface process until or unless i press back manually. how to avoid this screen being displayed after i execute the same.
    are there any different approach apart from this?
    Thanks,
    Jagath
    Message was edited by: Jagathguru Chandrasekharan

  • Is it possible to display list alv and grid alv in the same screen

    Hi
    There are methods to display more than 1 alv grid in the same screen by using block append grid . In the same manner its available for more than 1 list alv report display by REUSE_ALV_BLOCK_LIST_APPEND.
    My question is I want to display 1 alv list and 1 alv grid report in the same output screen .
    Please let me know how to do it ?  I will definetly appreciate the answers.
    Thanks!!

    Hi Anindita,
                                      Previously i ad told v cant display two lists together in same screen. But u can use Block ALV for this. Use FM "REUSE_ALV_BLOCK_LIST_APPEND.
    In OO u can use Cl_GUI_EAST_SPLITTER_CONTAINER for displayin more than two lists in same screen.
    If useful giv points
    Regards
    Vanitha P

  • Need to display two ALV GRIDs in a single screen

    Hi,
    I have a question, i'm using version 4.6. I want to display 2 ALVs in a single screen or by calling.
    Step 1 : The internal table (which holds the data for the ALVs has to be populated before calling ALV1 or ALV2) 
    Step 2 : Display In a single report
    ALV1 report (Editable ,Has to be a GRID)
    ALV2 report (Non Editable, Has to be a GRID)
                             (or)
    Step 1 : The internal table (which holds the data for the ALVs has to be populated before calling ALV1 or ALV2)
    Step 2 :
    ALV1 report (Editable ,Has to be a GRID, with a custom button to call ALV2 hiding the ALV1 ie not visible to user)
    ALV2 report (Non Editable ,Has to be a GRID, with a custom button to call ALV1 hiding the ALV2 ie not visible to user)
    Please help me <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

    Hi
    ABAP List Viewer
    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
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
    This helps us to implement all the features mentioned very effectively.
    Using ALV, We can have three types of reports:
    1. Simple Report
    2. Block Report
    3. Hierarchical Sequential Report
    There are some function modules which will enable to produce the above reports without much effort.
    All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
    1. SIMPLE REPORT.
    The important function modules are
    a. Reuse_alv_list_display
    b. Reuse_alv_fieldcatalog_merge
    c. Reuse_alv_events_get
    d. Reuse_alv_commentary_write
    e. Reuse_alv_grid_display
    A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
    The important parameters are :
    I. Export :
    i. I_callback_program : report id
    ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
    iii. I_callback_user_command : routine where the function codes are handled
    iv. I_structure name : name of the dictionary table
    v. Is_layout : structure to set the layout of the report
    vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
    vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
    II. Tables :
    i. t_outtab : internal table with the data to be output
    B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
    The Important Parameters are :
    I. Export :
    i. I_program_name : report id
    ii. I_internal_tabname : the internal output table
    iii. I_inclname : include or the report name where all the dynamic forms are handled.
    II Changing
    ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
    declared in the type pool SLIS.
    C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
    Parameters :
    I. Import :
    Et_Events : The event table is returned with all possible CALLBACK events
    for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
    II. Export :
    I_List_type :
    0 = simple list REUSE_ALV_LIST_DISPLAY
    1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
    2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
    3 = hierarchical-sequential block list
    REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
    Parameters :
    I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
    This internal table has three fields :
    Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action
    Key : only when typ is ‘S’.
    Info : the text to be printed
    E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
    Parameters : same as reuse_alv_list_display
    This is an example for simple list.
    2. BLOCK REPORT
    This is used to have multiple lists continuously.
    The important functions used in this report are:
    A. REUSE_ALV_BLOCK_LIST_INIT
    B. REUSE_ALV_BLOCK_LIST_APPEND
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    A. REUSE_ALV_BLOCK_LIST_INIT
    Parameters:
    I. I_CALLBACK_PROGRAM
    II. I_CALLBACK_PF_STATUS_SET
    III. I_CALLBACK_USER_COMMAND
    This function module is used to set the default gui status etc.
    B. REUSE_ALV_BLOCK_LIST_APPEND
    Parameters :
    Export :
    I. is_layout : layout settings for block
    II. it_fieldcat : field catalog
    III. i_tabname : internal table name with output data
    IV. it_events : internal table with all possible events
    Tables :
    i. t_outtab : internal table with output data.
    This function module adds the data to the block.
    Repeat this function for all the different blocks to be displayed one after the other.
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    This function module is used for hierarchical sequential blocks.
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    Parameters : All the parameters are optional.
    This function module display the list with data appended by the above function.
    Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
    3. Hierarchical reports :
    Hierarchical sequential list output.
    The function module is
    A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
    Parameters:
    I. Export:
    i. I_CALLBACK_PROGRAM
    ii. I_CALLBACK_PF_STATUS_SET
    iii. I_CALLBACK_USER_COMMAND
    iv. IS_LAYOUT
    v. IT_FIELDCAT
    vi. IT_EVENTS
    vii. i_tabname_header : Name of the internal table in the program containing the
    output data of the highest hierarchy level.
    viii. i_tabname_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    ix. is_keyinfo : This structure contains the header and item table field
    names which link the two tables (shared key).
    II. Tables
    i. t_outtab_header : Header table with data to be output
    ii. t_outtab_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
    Important Attributes :
    A. col_pos : position of the column
    B. fieldname : internal fieldname
    C. tabname : internal table name
    D. ref_fieldname : fieldname (dictionary)
    E. ref_tabname : table (dictionary)
    F. key(1) : column with key-color
    G. icon(1) : icon
    H. symbol(1) : symbol
    I. checkbox(1) : checkbox
    J. just(1) : (R)ight (L)eft (C)ent.
    K. do_sum(1) : sum up
    L. no_out(1) : (O)blig.(X)no out
    M. outputlen : output length
    N. seltext_l : long key word
    O. seltext_m : middle key word
    P. seltext_s : short key word
    Q. reptext_ddic : heading (ddic)
    R. ddictxt(1) : (S)hort (M)iddle (L)ong
    S. datatype : datatype
    T. hotspot(1) : hotspot
    Regards
    Anji

  • How to get rid of the loop in ALV output from At selection screen event?

    I have several push buttons on a selection screen.
    Clikc on a button, then it pops up an editable ALV report. (This gets triggered AT SELECTION SCREEN event.). REUSE_ALV_GRID_DISPLAY_LVC..
    On the ALV output, I enabled F4 for a couple of fields. Once I click on the F4 button, ONF4 method gets triggerd and a pop up appears with custom search helps.
    choose a line and it fills the cell.
    Upto this it works fine.
    Now I click on the BACK button at the ALV output, it takes me to the selection screen. I click on the button again, it show the editable ALV. Now when I click on the F4 button, the pop up comes up twice and the cell gets filled from the second pop - up.
    How to control this?
    Probably I am not refreshing something?
    (I am using REUSE_ALV_GRID_DISPLAY_LVC and tooks ome code for ONF4 event from BCALV_*DATATYPES (forgot the exact name) program.)
    Thanks,
    Ven

    Hi,
    FORM refresh_grid USING  pw_grid TYPE REF TO cl_gui_alv_grid.
    *Work area
      DATA : wal_stable TYPE lvc_s_stbl.
      CHECK NOT pw_grid IS INITIAL.
      wal_stable-col = c_check.
      wal_stable-row = c_check.
    *Method to refresh grid
      CALL METHOD  pw_grid->refresh_table_display
           EXPORTING
             is_stable      = wal_stable
             i_soft_refresh = c_check
           EXCEPTIONS
             finished       = 1
             OTHERS         = 2.
    ENDFORM.                    " refresh_grid
    Thanks,
    Sree.

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

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

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

  • Two ALV Grids in a single screen are overlapping eachother

    Hi,
    I have created two ALV grids in a single screen. I have used seperate containers for them.
    But on executing them , both the ALV grids are overlapping eachother.
    Please give me a solution.

    Hi,
      IF w_custom_container IS INITIAL.
    Creating Object for the Custom Container.
        CREATE OBJECT w_custom_container
          EXPORTING
            container_name              = w_container
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
        CASE sy-subrc.
          WHEN 1.
            MESSAGE e054.  "CNTL ERROR
          WHEN 2.
            MESSAGE e055.  "CNTL SYSTEM ERROR
          WHEN 3.
            MESSAGE e056.  "CREATE ERROR
          WHEN 4.
            MESSAGE e057.  "LIFETIME ERROR
          WHEN 5.
            MESSAGE e058.  "LIFETIME DYNPRO DYNPRO LINK
        ENDCASE.
    Creating object for the Splitter Container.
        CREATE OBJECT w_split_container
          EXPORTING
            parent            = w_custom_container
            orientation       = 0
            sash_position     = 30
            with_border       = 2
          EXCEPTIONS
            cntl_error        = 1
            cntl_system_error = 2
            OTHERS            = 3.
        CASE sy-subrc.
          WHEN 1.
            MESSAGE e054. "CNTL_ERROR
          WHEN 2.
            MESSAGE e055. "CNTL_SYSTEM_ERROR
        ENDCASE.
    Creating Grid Control.
        CREATE OBJECT w_grid1
          EXPORTING
            i_parent = w_split_container->top_left_container.
        CREATE OBJECT w_grid2
          EXPORTING
            i_parent = w_split_container->bottom_right_container.
    Building field catalog for ALV.
    Fieldcat for the Detail Record.
        PERFORM build_fieldcat        USING:  c_1 c_code c_output c_check
                                              c_comcode c_olength,
                                              c_2 c_fileno c_output c_check
                                              c_filenum c_olength,
                                              c_3 c_dedcod c_output c_check
                                              c_dedcode c_olength,
                                              c_4 c_dedfac c_output c_check
                                              c_dedf c_olength.
    FieldCatlog for the Error Records.
        PERFORM build_fieldcat_error  USING:  c_1 c_pernr c_error c_check
                                              c_person c_olength,
                                              c_2 c_desc c_error c_check
                                              c_descp c_olength.
    ALV Display.
        CALL METHOD w_grid1->set_table_for_first_display
    EXPORTING
       i_buffer_active               =
       i_bypassing_buffer            =
       i_consistency_check           =
       i_structure_name              =
       is_variant                    =
       i_save                        =
       i_default                     = 'X'
       is_layout                     =
       is_print                      =
       it_special_groups             =
       it_toolbar_excluding          =
       it_hyperlink                  =
       it_alv_graphics               =
       it_except_qinfo               =
       ir_salv_adapter               =
          CHANGING
            it_outtab                     = t_error
            it_fieldcatalog               = t_fieldcat_error
       it_sort                       =
       it_filter                     =
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4
        CASE sy-subrc.
          WHEN 1.
            MESSAGE e076. "invalid parameter combination
          WHEN 2.
            MESSAGE e001. "program error
          WHEN 3.
            MESSAGE e078. "too many lines
        ENDCASE.
        CALL METHOD w_grid2->set_table_for_first_display
    EXPORTING
       i_buffer_active               =
       i_bypassing_buffer            =
       i_consistency_check           =
       i_structure_name              =
       is_variant                    =
       i_save                        =
       i_default                     = 'X'
       is_layout                     =
       is_print                      =
       it_special_groups             =
       it_toolbar_excluding          =
       it_hyperlink                  =
       it_alv_graphics               =
       it_except_qinfo               =
       ir_salv_adapter               =
          CHANGING
            it_outtab                     = t_output
            it_fieldcatalog               = t_fieldcat
       it_sort                       =
       it_filter                     =
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4
        CASE sy-subrc.
          WHEN 1.
            MESSAGE e076. "invalid parameter combination
          WHEN 2.
            MESSAGE e001. "program error
          WHEN 3.
            MESSAGE e078. "too many lines
        ENDCASE.
      ELSE.
        CALL METHOD w_grid1->refresh_table_display
          EXPORTING
            i_soft_refresh = 'X'.
        CALL METHOD w_grid2->refresh_table_display
          EXPORTING
            i_soft_refresh = 'X'.
      ENDIF.
    Hope it Helps,
    Jayant Sahu.

  • How to get check box in alv grid list output

    hi gurus,
    can anyone inform me
    how to get check box in alv output it should not be a pop up window
    thank you
    regards
    kals.

    or
    hi go through the fallowing code.
    code*&----
    *& Report YGS_ALV_BOM *
    REPORT YGS_ALV_BOM .
    TABLES : MAST,STKO,STPO.
    TYPE-POOLS: SLIS.
    TYPES : BEGIN OF TY_MAST,
    CHECK_BOX,
    MATNR TYPE MAST-MATNR,
    WERKS TYPE MAST-WERKS,
    STLAN TYPE MAST-STLAN,
    STLNR TYPE MAST-STLNR,
    STLAL TYPE MAST-STLAL,
    END OF TY_MAST.
    TYPES : BEGIN OF TY_STKO,
    STLTY TYPE STKO-STLTY,
    STLNR TYPE STKO-STLNR,
    STLAL TYPE STKO-STLAL,
    STKOZ TYPE STKO-STKOZ,
    BMENG TYPE STKO-BMENG,
    BMEIN TYPE STKO-BMEIN,
    END OF TY_STKO.
    TYPES : BEGIN OF TY_STPO,
    LIGHTS,
    STLTY TYPE STPO-STLTY,
    STLNR TYPE STPO-STLNR,
    STLKN TYPE STPO-STLKN,
    STPOZ TYPE STPO-STPOZ,
    IDNRK TYPE STPO-IDNRK,
    MENGE TYPE STPO-MENGE,
    MEINS TYPE STPO-MEINS,
    END OF TY_STPO.
    DATA : IT_MAST TYPE TABLE OF TY_MAST,
    WA_MAST TYPE TY_MAST,
    IT_STKO TYPE TABLE OF TY_STKO,
    WA_STKO TYPE TY_STKO,
    IT_STPO TYPE TABLE OF TY_STPO,
    WA_STPO TYPE TY_STPO.
    DATA : lt_fieldcat TYPE slis_t_fieldcat_alv,
    ls_layout TYPE slis_layout_alv,
    ls_event TYPE slis_alv_event,
    lt_event TYPE slis_t_event,
    it_sortinfo type slis_t_sortinfo_alv,
    ls_header TYPE slis_listheader,
    lt_header TYPE slis_t_listHEADER.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    SELECT-OPTIONS : S_MATNR FOR MAST-MATNR.
    START-OF-SELECTION.
    PERFORM GET_DATA.
    PERFORM BUILD_FIELDCAT USING LT_FIELDCAT.
    PERFORM BUILD_LAYOUT.
    END-OF-SELECTION.
    PERFORM DISPLAY_DATA.
    *& Form GET_DATA
    text
    --> p1 text
    <-- p2 text
    form GET_DATA .
    REFRESH : IT_MAST.
    SELECT MATNR
    WERKS
    STLAN
    STLNR
    FROM MAST
    INTO CORRESPONDING FIELDS OF TABLE IT_MAST
    WHERE MATNR IN S_MATNR.
    endform. " GET_DATA
    *& Form BUILD_FIELDCAT
    text
    --> p1 text
    <-- p2 text
    form BUILD_FIELDCAT USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    REFRESH : LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 1.
    L_FIELDCAT-FIELDNAME = 'MATNR'.
    L_FIELDCAT-TABNAME = 'IT_MAST'.
    L_FIELDCAT-REF_FIELDNAME = 'MATNR'.
    L_FIELDCAT-REF_TABNAME = 'MAST'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 2.
    L_FIELDCAT-FIELDNAME = 'WERKS'.
    L_FIELDCAT-TABNAME = 'IT_MAST'.
    L_FIELDCAT-REF_FIELDNAME = 'WERKS'.
    L_FIELDCAT-REF_TABNAME = 'MAST'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 3.
    L_FIELDCAT-FIELDNAME = 'STLNR'.
    L_FIELDCAT-TABNAME = 'IT_MAST'.
    L_FIELDCAT-REF_FIELDNAME = 'STLNR'.
    L_FIELDCAT-REF_TABNAME = 'MAST'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    endform. " BUILD_FIELDCAT
    *& Form BUILD_LAYOUT
    text
    --> p1 text
    <-- p2 text
    form BUILD_LAYOUT .
    CLEAR LS_LAYOUT.
    LS_LAYOUT-BOX_FIELDNAME = 'CHECK_BOX'.
    LS_LAYOUT-BOX_TABNAME = 'IT_MAST'.
    endform. " BUILD_LAYOUT
    *& Form DISPLAY_DATA
    text
    --> p1 text
    <-- p2 text
    form DISPLAY_DATA .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    I_STRUCTURE_NAME =
    IS_LAYOUT = LS_LAYOUT
    IT_FIELDCAT = LT_FIELDCAT
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = IT_MAST
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform. " DISPLAY_DATA
    FORM PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
    SET PF-STATUS 'YSTATUS' OF PROGRAM SY-REPID
    EXCLUDING RT_EXTAB.
    ENDFORM.
    FORM USER_COMMAND USING RF_UCOMM TYPE SY-UCOMM
    SELFIELD TYPE SLIS_SELFIELD.
    CASE RF_UCOMM.
    WHEN '&NEXT'.
    PERFORM GET_DATA_BOM .
    PERFORM BUILD_FIELDCAT_BOM USING LT_FIELDCAT.
    PERFORM BUILD_LAYOUT_BOM.
    PERFORM DISPLAY_DATA_BOM.
    ENDCASE.
    ENDFORM.
    *& Form GET_DATA_BOM
    text
    --> p1 text
    <-- p2 text
    form GET_DATA_BOM .
    CLEAR : WA_STPO,
    WA_MAST.
    REFRESH : IT_STPO.
    DATA : IT_CHECK TYPE TABLE OF TY_MAST.
    LOOP AT IT_MAST INTO WA_MAST.
    IF WA_MAST-CHECK_BOX EQ 'X'.
    APPEND WA_MAST TO IT_CHECK.
    ENDIF.
    ENDLOOP.
    SELECT STLTY
    STLNR
    STLKN
    VGKNT
    IDNRK
    MENGE
    MEINS
    FROM STPO
    INTO CORRESPONDING FIELDS OF TABLE IT_STPO
    FOR ALL ENTRIES IN IT_CHECK
    WHERE IDNRK EQ IT_CHECK-MATNR.
    CLEAR WA_STPO.
    LOOP AT IT_STPO INTO WA_STPO.
    SELECT SINGLE * FROM MAST WHERE MATNR EQ WA_STPO-IDNRK.
    IF SY-SUBRC = 0.
    WA_STPO-LIGHTS = '2'.
    ELSE.
    WA_STPO-LIGHTS = '1'.
    ENDIF.
    MODIFY IT_STPO FROM WA_STPO.
    ENDLOOP.
    endform. " GET_DATA_BOM
    *& Form BUILD_FIELDCAT_BOM
    text
    --> p1 text
    <-- p2 text
    form BUILD_FIELDCAT_BOM USING LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA : L_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    REFRESH : LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 1.
    L_FIELDCAT-FIELDNAME = 'STLTY'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'STLTY'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 2.
    L_FIELDCAT-FIELDNAME = 'STLNR'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'STLNR'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 3.
    L_FIELDCAT-FIELDNAME = 'STLKN'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'STLKN'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 4.
    L_FIELDCAT-FIELDNAME = 'IDNRK'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'IDNRK'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    L_FIELDCAT-COL_POS = 5.
    L_FIELDCAT-FIELDNAME = 'MENGE'.
    L_FIELDCAT-TABNAME = 'IT_STPO'.
    L_FIELDCAT-REF_FIELDNAME = 'MENGE'.
    L_FIELDCAT-REF_TABNAME = 'STPO'.
    APPEND L_FIELDCAT TO LT_FIELDCAT.
    endform. " BUILD_FIELDCAT_BOM
    *& Form BUILD_LAYOUT_BOM
    text
    --> p1 text
    *<-- p2 text
    form BUILD_LAYOUT_BOM .
    CLEAR : LS_LAYOUT.
    LS_LAYOUT-LIGHTS_FIELDNAME = 'LIGHTS'.
    LS_LAYOUT-LIGHTS_TABNAME = 'IT_STPO'.
    endform. " BUILD_LAYOUT_BOM
    *& Form DISPLAY_DATA_BOM
    text
    --> p1 text
    <-- p2 text
    form DISPLAY_DATA_BOM .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND_BOM'
    I_CALLBACK_TOP_OF_PAGE = 'TOP9'
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = 'ALV_BACKGROUND'
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT = LS_LAYOUT
    IT_FIELDCAT = LT_FIELDCAT
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    I_HTML_HEIGHT_TOP =
    I_HTML_HEIGHT_END =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = IT_STPO
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform. " DISPLAY_DATA_BOM
    FORM TOP9 .
    CLEAR LS_HEADER.
    REFRESH LT_HEADER.
    LS_HEADER-TYP = 'H'.
    LS_HEADER-INFO = 'BILL OF MATERIALS'.
    APPEND LS_HEADER TO LT_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = LT_HEADER
    I_LOGO = 'ENJOYSAP_LOGO'
    I_END_OF_LIST_GRID =
    ENDFORM.
    FORM USER_COMMAND_BOM USING RF_UCOMM_BOM LIKE SY-UCOMM
    SEL_FIELD TYPE SLIS_SELFIELD.
    CASE RF_UCOMM_BOM.
    WHEN '&IC1'.
    SET PARAMETER ID 'MAT' FIELD WA_STPO-IDNRK.
    SET PARAMETER ID 'WRK' FIELD WA_MAST-WERKS.
    SET PARAMETER ID 'CSA' FIELD WA_MAST-STLAN.
    CALL TRANSACTION 'CS03' AND SKIP FIRST SCREEN.
    ENDCASE.[/code]

  • Hide/Remove Subtotal Icon in ALV Grid report output.

    Hi,
            Is ther a way to remove or hide the Subtotal icon in the ALV Grid report output?
    Thanks & Regards,
    Praveen.

    Hi,
    You can add names of the buttons(which you want to hide) to internal table and pass this internal table for tool bar excluding parameter while calling ALV.
    Here as shown in below code, 'Sorting, Ascending,Descending' buttons are removed from the tool bar list. 
    data : lt_exclude TYPE ui_functions.
    ls_exclude = cl_gui_alv_grid=>MC_FC_SORT.
      APPEND ls_exclude TO lt_exclude .
      ls_exclude = cl_gui_alv_grid=>MC_FC_SORT_ASC.
      APPEND ls_exclude TO lt_exclude .
      ls_exclude = cl_gui_alv_grid=>MC_FC_SORT_DSC.
      APPEND ls_exclude TO lt_exclude .
        CALL METHOD alvgd->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
         IT_TOOLBAR_EXCLUDING          = lt_exclude
    Regards,
    Maharshi Vyas

  • Avoid ALV output screen in submit statement

    hello,
    I have created one FM.in that FM i am calling one zreport using submit statement as i want to access that zreport's internal table.so i have done that using IMPORT and EXPORT statement and i am getting values in my FM.
    but my problem is when i execute that FM it stops and display the ALV output of zreport and then when i press back button it gives me FM's output.i dont want that ALV output.can anybody help me that how to omit this output screen?
    regards
    soniya s.

    Hi,
    Use option EXPORTING LIST TO MEMORY with statement SUBMIT.
    Regards,
    Nikhil
    Edited by: Nikhil Kayal on May 13, 2009 1:32 PM

  • Selection screen in ALV output

    Hi Experts,
    My requirement is - A selection screen should pop up on the click of a button in the ALV output. Using the parameters I input on the selection screen anothor ALV should be displayed on the same page at the bottom. I'm displaying ALV using cl_gui_alv_grid.
    Thanks.
    Ajith

    Hi Nimesh,
    The requirement has slightly been updated so as to display the 2nd ALV is another screen.
    As you suggested I used the call selection screen. How ever I did not use events for the same. I called the selection screen on checking sy-ucomm in PAI.
    After I input the values in the pop up selection screen , even if I click the cancel button(at bottom) or the close button( top corner)  the execution still  follows and the second ALV is displayed.
    Please help me in this so that If I click on cancel or close the second ALV is not displayed and the control remains in the first ALV
    Thank you.
    Edited by: Ajith  Krishna on Oct 31, 2008 10:24 PM

  • Date format needs to be in selection screen mm/dd/yyyy but in alv output ..

    hi
    i need help on displaying date in alv output
    date format needs to be in selection screen mm/dd/yyyy but in alv output ..it should be displayed as yyyymmdd
    regards
    Nishant

    hi,
    you are passing the value to ALv using an internal table.
    so store the format  YYYYMMDD date in the internal table and pass it to ALV.
    use the below FM
    DD/MM/YYYY -> YYYYMMDD
    <b>CONVERSION_EXIT_PDATE_INPUT</b>
    rgds
    Anver

  • I would like to be able to pipe output to the screen as well as to 'append' it to an array

    I would like to be able to pipe output to the screen as well as to 'append' it to a variable.
    For example, for something like this:
    $result =@()
    $result += Invoke-Command -cn $servers -scriptblock { foo }
    I would like to be able to see on the screen the running output of
    Invoke-Command -cn $servers -scriptblock { foo }
    as well as capture each result to the $result variable.

    Just wrap the expression in parens:
    ($result += Invoke-Command -cn $servers -scriptblock { foo })
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

Maybe you are looking for

  • Performance problems with external sounds and Sound class

    I'm using Sound & SoundChannel classes to load and play external MP3s and I'm seeing terrible playback performance on my 3G phone. Audio starts out ok, but will gradually get more and more choppy and eventually crashes the app. The MP3s themselves ar

  • How do I keep more than one safari page open at the same time?

    New to Mac.  I'm used to being able to have several applications open at the same time, and able to check emails, eBay, camera for downloading photos, etc., but when trying this on Mac, I can't seem to figure out how to swing from email to something

  • Unrecognized operation - using utl_dbws

    -29532 ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: Caught exception while handling request: unrecognized operation: {http://hristdb/MyWebService1.wsdl}rminfo Any idea? CREATE OR REPLACE PROCEDURE

  • I think my hard drive crashed....

    Hi, When I turn on my computer (a Power Mac G4 Tower)it sounds as if the disc has crashed. I have two hard drives running in it, and when I start up the computer holding the 'option' key, neither of them show up. When I turn it on without holding any

  • Why is my new Imac so slow?

    I received yesterday my brand new 21.5 inch Imac, with 2.7 Ghz, 16 gig, 1 TB. My previous imac was a 20 inch basic version from 2007 so i thought it was time for an update. Also I have 5 users sometimes all open at the same time and the mac was too s