Screen GUI Status Query ( ALV Grid)

Hi All,
I am having an ALV grid on a screen .
I want to check the contents of the grid at the press of enter button, at present i have to press the check button available on the ALV grid to check the contents of the grid.
Pls suggest

Make sure that you set "ENTER" as the key which is to trigger the edit event.
        call method alv_grid->set_table_for_first_display
            exporting
                 is_layout              = lt_layout
                 it_toolbar_excluding   = lt_exclude
            changing
                 it_outtab       = ialv[]
                 it_fieldcatalog = fieldcat[].
<b>
* If cancelling points, register "ENTER" as event
* and create the event receiver
         call method alv_grid->register_edit_event
                        exporting
                           i_event_id = cl_gui_alv_grid=>mc_evt_enter.
</b>
*   create Event Receiver
          create object event_receiver.
*   handler for ALV grid
          set handler event_receiver->handle_data_changed for alv_grid.
Regards,
Rich Heilman

Similar Messages

  • Problem in GUI status of ALV Grid

    Hello All Experts,
    I have a following issue.
    Am displaying a report using   REUSE_ALV_GRID_DISPLAY. I have copied the GUI status from standard GUI   STANDARD_FULLSCREEN. Now when i dispaly the report i get  select all ICON just before my first column(Marked in red below). i do not need this icon, i have checked in my GUI status also this icon does not exist. can you please help me how to remove this icon.
    This is how i have declared the field catalog for my first column.
      fieldcatalog-fieldname    = text-013.
      fieldcatalog-seltext_m   = text-014.
      fieldcatalog-col_pos      = 0.
      fieldcatalog-outputlen    = 3.
      fieldcatalog-emphasize  = gc_x.
      fieldcatalog-key            = gc_x.
      fieldcatalog-checkbox   = gc_x.
      fieldcatalog-edit            = gc_x.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    Am really thankful to your resposes.
    Regards,
    Satish

    i tested with
    REUSE_ALV_GRID_DISPLAY and it works fine as you want
    report ztestalv.
    type-pools:
      slis.
    data:
      i_usr02 type table of usr02,
      afield  type slis_fieldcat_alv,
      sp_group      type slis_sp_group_alv,
      t_listheader  type slis_t_listheader with header line,
      t_layout      type slis_layout_alv,
      t_fieldcat    type slis_t_fieldcat_alv,
      t_spec_groups type slis_t_sp_group_alv,
      event         type slis_alv_event,
      t_events      type slis_t_event,
      g_variant     like disvariant,
      gx_variant    like disvariant,
      g_exit(1)     type c,
      g_save(1)     type c,
      g_repid       like sy-repid,
      msgtyp        like sy-msgty,
      lt_dynpread   like dynpread occurs 1 with header line.
    start-of-selection.
      select * from usr02 into table i_usr02
      up to 200 rows.
    end-of-selection.
      t_layout-detail_initial_lines = 'X'.
      t_layout-detail_popup         = 'X'.
      t_layout-f2code               = 'PIC1'.
      t_layout-get_selinfos         = 'X'.
      t_layout-group_change_edit    = 'X'.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        exporting
          i_structure_name = 'USR02'
        changing
          ct_fieldcat      = t_fieldcat
        exceptions
          others           = 4.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = 'ZTESTALV'
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USR_CMD'
          i_structure_name         = 'USR02'
          is_layout                = t_layout
          it_fieldcat              = t_fieldcat
          it_special_groups        = t_spec_groups
          i_default                = 'X'
          i_save                   = g_save
          is_variant               = g_variant
          it_events                = t_events
        tables
          t_outtab                 = i_usr02
        exceptions
          program_error            = 1
          others                   = 2.
    make sure your field ls_layout-box_fieldname is blank, as you using the checkbox

  • Regarding PF Status In ALV Grid Dispaly

    Hi..
    Can you please tell me how to set PF status in ALV Grid Display.
    Regards
    Sandeep.

    hi,
    if u use REUSE_ALV_LIST_DISPLAY copy the standard GUI-Status named STANDARD from function group SALV in your program
    if u use REUSE_ALV_GRID_DISPLAY_LVC or REUSE_ALV_GRID_DISPLAY copy the standard GUI-Status named STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN in your program
    after  that you cas set the pf-status in this way:
    >CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'                   
    > EXPORTING                                               
    >    i_callback_program                = sy-cprog         
    >    i_callback_pf_status_set          = 'STATUS'
    >    i_callback_user_command           = 'USERCOMMAND'    
    >   is_layout                           = st_layout         
    >   it_fieldcat                          = st_fieldcat      
    >  TABLES                                      
    >    t_outtab                          = outtab 
    or
    >CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'              
    > EXPORTING                                              
    >    i_callback_program                = sy-cprog         
    >    i_callback_pf_status_set          = 'STATUS'  
    >    i_callback_user_command           = 'USERCOMMAND'   
    >    is_layout_lvc                     = wa_slis_layout  
    >    it_fieldcat_lvc                   = tb_slis_fieldcat
    >  TABLES                                                
    >    t_outtab                          = tb_app          
    where USERCOMMAND and STATUS are 2 forms in your program.
    >FORM status USING pfstat TYPE slis_t_extab.
    > SET PF-STATUS 'STANDARD' EXCLUDING pfstat.
    >ENDFORM.
    >
    > ...
    >
    >FORM usercommand USING okcode LIKE sy-ucomm
    >                       wa_selfield TYPE slis_selfield.
    >  CASE okcode.
    >      .... 
    >  ENDCASE
    >ENDFORM.
    Bye.
    Marco

  • Can anyone tell me how to use GUI status in ALV report.

    Can anyone tell me how to use GUI status in ALV report. I want to use  buttons in ALV report.

    Juheb,
    see the link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    Adding a button on the ALV grid using OOPs
    check these sites.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-ALVControllingStandard+Buttons&
    chk this.
    alv-pfstatus:
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_pfstatus.htm
    then how to capture that button click.
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_ucomm.htm
    REPORT ZTESTALV.
    TYPE-POOLS: SLIS.
    *- Fieldcatalog
    DATA: IT_FIELDCAT  TYPE LVC_T_FCAT,
          IT_FIELDCAT1  TYPE SLIS_T_FIELDCAT_ALV..
    *- For Events
    DATA:IT_EVENTS TYPE SLIS_T_EVENT.
    DATA:  X_FIELDCAT  TYPE LVC_S_FCAT,
            X_FIELDCAT1  TYPE SLIS_FIELDCAT_ALV.
    DATA:X_LAYOUT TYPE LVC_S_LAYO.
    "{ FOR DISABLE
    DATA: LS_EDIT TYPE LVC_S_STYL,
          LT_EDIT TYPE LVC_T_STYL.
    "} FOR DISABLE
    DATA: BEGIN OF IT_VBAP OCCURS 0,
          VBELN LIKE VBAP-VBELN,
          POSNR LIKE VBAP-POSNR,
          HANDLE_STYLE TYPE LVC_T_STYL, "FOR DISABLE
       <b>   BUTTON(10),</b>
         END OF IT_VBAP.
    DATA: LS_OUTTAB LIKE LINE OF IT_VBAP.
    SELECT VBELN
           POSNR
           UP TO 10 ROWS
          INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
          FROM VBAP.
    DATA:L_POS TYPE I VALUE 1.
    CLEAR: L_POS.
    L_POS = L_POS + 1.
    <b>X_FIELDCAT-SELTEXT = 'Button'.
    x_fieldcat-fieldname = 'BUTTON'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-OUTPUTLEN = '10'.
    X_FIELDCAT-style = X_FIELDCAT-style bit-xor
                      cl_gui_alv_grid=>MC_STYLE_BUTTON bit-xor
                      cl_gui_alv_grid=>MC_STYLE_ENABLEd.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.</b>
    L_POS = L_POS + 1.
    X_FIELDCAT-SELTEXT = 'VBELN'.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-OUTPUTLEN = '10'.
    x_fieldcat-ref_field = 'VBELN'.
    x_fieldcat-ref_table = 'VBAK'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_POS = L_POS + 1.
    X_FIELDCAT-SELTEXT = 'POSNR'.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS    = L_POS.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-OUTPUTLEN = '5'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_POS = L_POS + 1.
    "{FOR DISABLE HERE 6ROW IS DISABLED
    SY-TABIX = 6.
    LS_EDIT-FIELDNAME = 'VBELN'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 10.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    *LS_EDIT-FIELDNAME = 'POSNR'.
    *LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    *LS_EDIT-STYLE2 = SPACE.
    *LS_EDIT-STYLE3 = SPACE.
    *LS_EDIT-STYLE4 = SPACE.
    *LS_EDIT-MAXLEN = 6.
    *INSERT LS_EDIT INTO TABLE LT_EDIT.
    INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
    MODIFY IT_VBAP INDEX SY-TABIX FROM LS_OUTTAB  TRANSPORTING
                                      HANDLE_STYLE .
    X_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
    "} UP TO HERE
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
      EXPORTING
        I_CALLBACK_PROGRAM = SY-REPID
        IS_LAYOUT_LVC      = X_LAYOUT
        IT_FIELDCAT_LVC    = IT_FIELDCAT
      TABLES
        T_OUTTAB           = IT_VBAP[]
      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.
    Don't forget to reward if useful....

  • ABAP Query - ALV Grid Calculation

    Can anybody tell me whether in ABAP Query when you execute the Query in SQ01 its shows the report in ALV Grid format. In ALV Grid format there are some standard calculation are available like
    TOtal
    Mean value
    Minmum
    Maximum
    Count
    The above calculation can be done for each column.
    My Query is it possible to put our own simple calculation
    through some coding for overall summation fields instead of this std. calculation.
    Example : Unrestricted moved Qty Summation divided by INspection lot qty summation * 100
    The output of this calculation is called First pass yield.
    This calculation i done for each line item by creating a Additional field with ABAP coding.The overall meanvalue calcualtion of this addtional fields column is not suits the customer expectation.They want the calculation to be done by the system like what i had explained in the example.

    Hi,
    Here is a code for a single grid.
    In the screen layout,make a custom container (Icon with C ) and name it in Capital letters as CONTAINER.The code below in bold letters is what exactly you want.I ve given a small example on how to use ALV:
    REPORT SAMPLE.
    DATA: alv type ref to cl_gui_alv_GRID,
    cont type ref to cl_gui_custom_container,
    itab_spfli type table of spfli.
    START-OF-SELECTION.
    select * from spfli into table itab_spfli.
    call screen 100.
    END-OF-SELECTION.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    seT PF-STATUS 'GUI'.
    SET TITLEBAR 'xxx'.
    if cont is initial.
    CREATE OBJECT cont
    EXPORTING
    CONTAINER_NAME = 'CONTAINER'.
    CREATE OBJECT ALV
    EXPORTING
    I_PARENT = CONT.
    CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_STRUCTURE_NAME = 'SPFLI'
    CHANGING
    IT_OUTTAB = itab_spfli
    Now for your requirement,you can create two custom containers in the screen layout and two different alv grid instances.ie:
    DATA: alv1 type ref to cl_gui_alv_GRID,
    cont1 type ref to cl_gui_custom_container
    alv2 type ref to cl_gui_alv_GRID,
    cont2 type ref to cl_gui_custom_container.
    To select data from first grid,you can use events on double_click and fetch information and then display it in the second grid.
    <b>SOME MATERIAL REGARDING ALV:</b>
    www.abap4.it/download/ALV.pdf <b>(very useful)</b>
    http://www.sapdevelopment.co.uk/reporting/alvhome.htm
    <b>-->download the PDF from following link.</b>
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm
    <b>SAMPLE PROGRAMS IN ALV:</b>http://www.geocities.com/victorav15/sapr3/abap_ood.html#d_grid
    <b>DEMO PROGRAMS IN ALV:</b>BCALV*
    Regards,
    Beejal
    **Reward if this helps

  • PF Status and ALV GRID

    Hello Experts!
    I've created a screen with an alv_grid and a custom pf_status, I have a custome button defined in the pf_status, I need to pass the command executed from the pf_status to the alv_grid.
    Is this possible?
    My user refuses to use the alv_grid toolbar.

    Hi there
    Do the following
    1) separate off the functions you want the standard SAP GUI (SE41) to do - I usually choose the standard 3 buttons BACK, EXIT, CANCEL and just use these in your PAI. ( You set the status in the PBO)
    2) Now for the Grid toolbars you need to define event handlers for ON TOOLBAR, and ON USER COMMAND and have methods for these. You need to register the events as well.
    I'm using my own ALV GRID class but it refrences CL_GUI_ALV_GRID so you could code something like this..
    in the constructor
    the variable z_object is simply a refrence to type cl_gui_alv_grid. GRID1 is also defined as a reference to cl_gui_alv_grid.
    As an import parameter to the constructor I also pass the name of the program - which is quite useful as I can then in various methods of the class do a Perfom (XXXX) in program (yyyy) if found.
    method constructor .
    create object grid_container1
            exporting
    *           container_name = 'CCONTAINER1'.
        container_name = cfname.
        create object  grid1
           exporting
              i_parent = grid_container1.
        set handler z_object->on_user_command for grid1.
        set handler z_object->on_toolbar for grid1.
        set handler z_object->handle_data_changed for grid1.
        set handler z_object->handle_data_changed_finished for grid1.
        set handler z_object->on_dubbelklik for grid1.
        set handler z_object->on_hotspot for grid1.
        call method grid1->register_edit_event
            exporting
               i_event_id = cl_gui_alv_grid=>mc_evt_enter.
      endmethod.
    Now for the on_toolbar and on_user_command methods.
    method on_toolbar .
    type-pools icon.
    clear ls_toolbar.
         move  0 to ls_toolbar-butn_type.
         move 'EXCEL' to ls_toolbar-function.
         move  space to ls_toolbar-disabled.
         move  icon_xxl to ls_toolbar-icon.
         move 'Excel' to ls_toolbar-quickinfo.
         move  'EXCEL' to ls_toolbar-text.
         append ls_toolbar to e_object->mt_toolbar.
        perform   toolbar  in program (caller) if found
         using e_object.
    endmethod.
    method on_user_command .
    *        FOR EVENT before_user_command OF cl_gui_alv_grid
    *        IMPORTING
    *          e_ucomm
    *          sender
    case e_ucomm.
          when 'EXIT'.
            leave program.
          when 'EXCEL'.
           call method me->download_to_excel.
          when 'SAVE'.
          when 'PROC'.
            call method me->process.
          when 'REFR'.
            call method me->refresh.
            when 'SWITCH'.
            call method me->switch.
           when 'TEST'.
            call method me->get_cell.
           endcase.
    endmethod.
    The toolbar event  is particularly useful if you want to add / remove standard functionality to the standard toolbar.
    As I've definedined my class with SE24 rather than inline code then I don't need the FOR EVENT statement in the method -- if your class is ïn line "i.e part of the abap" then you'll need those statements..
    When you now press one of the grid toolbar buttons your ON_USER_COMMAND Method will be executed with the FCODE assigned to the button passed as a parameter e_ucomm.
    You can also intercept the Standard SAP  ALV toolbars as well as the on user command event gets handled BEFORE the SAP code.
    For example as I previously posted you can intercept say the standard  sort ascending  button  (code &SORT_ASC)  issue a popup and carry on.
    Cheers
    jimbo

  • How to capture the checkbox status in ALV Grid display

    I need some immediate help regarding Grid ALV.
    My Requirement: I need to display an ALV grid report along with checkboxes. Further, I need to provide an option wherein the user can checkboxes and select the records that I need to process further (by clicking the process button on the ALV Report).
    My Query: The problem here is that I am not able to capture the status of the checkboxes. This means that I am not able to capture which of the records have been selected by checking their resp checkboxes.
    Solutions that I have tried: I have tried capturing the same at user command by checking the value in slis_selfield. But all the records show the value as 1 for the checkbox field.
    Kinldy suggest how to go about it.
    I am not using Object Oriented ALV. Please suggest something to be used in ALV Grid display in 4.6C version.
    Regards,
    Namrata

    Here is a Sample code , it might help you
    TABLES : sflight.
    TYPE-POOLS: slis.
    DATA : w_repid LIKE sy-repid.
    w_repid = sy-repid.
    DATA: BEGIN OF it_sflight OCCURS 0,
      checkbox(1),
      carrid LIKE sflight-carrid,
    END OF it_sflight.
    *layout
    DATA: wa_layout TYPE slis_layout_alv.
    *field catalog
    DATA: it_fieldcatalog TYPE slis_t_fieldcat_alv,
              wa_fieldcatalog TYPE slis_fieldcat_alv.
    START-OF-SELECTION.
      SELECT carrid FROM sflight
         INTO CORRESPONDING FIELDS OF TABLE it_sflight.
    END-OF-SELECTION.
      CLEAR it_fieldcatalog.
      REFRESH it_fieldcatalog.
      wa_fieldcatalog-fieldname = 'CHECKBOX'.
      wa_fieldcatalog-outputlen = '3'.
      wa_fieldcatalog-col_pos = '1'.
      wa_fieldcatalog-seltext_m = 'Chk'.
      wa_fieldcatalog-checkbox = 'X'.
      wa_fieldcatalog-edit = 'X'.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
      CLEAR wa_fieldcatalog.
      wa_fieldcatalog-fieldname = 'CARRID'.
      wa_fieldcatalog-outputlen = '10'.
      wa_fieldcatalog-col_pos = '2'.
      wa_fieldcatalog-seltext_m = 'Carrid'.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
      CLEAR wa_fieldcatalog.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = w_repid
          is_layout = wa_layout
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat = it_fieldcatalog
        TABLES
          t_outtab = it_sflight
        EXCEPTIONS
          program_error = 1
          OTHERS = 2.
    *& Form USER_COMMAND
    FORM user_command USING p_ucomm TYPE sy-ucomm
      p_selfld TYPE slis_selfield.
      CASE p_ucomm.
       WHEN '&DATA_SAVE'.
          DATA ref1 TYPE REF TO cl_gui_alv_grid.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
             IMPORTING
               e_grid = ref1.
          CALL METHOD ref1->check_changed_data.
          LOOP AT it_sflight WHERE checkbox = 'X'.
             DELETE it_sflight INDEX sy-tabix.
          ENDLOOP.
          p_selfld-refresh = 'X'.
      ENDCASE.
    ENDFORM. "user_command

  • GUI status in ALV

    Hai i copied standard gui status in my alv report.
    i hav req. to do..when i click on exit(%EX) and cancel(RW)it should appear pop-up window..with two buttons "do u want to exit". if yes..should exit the report and if no..continue with current screen.
    i have 6 secondary lists..should i write the code in all the 6 ucomm(s) or only once is needed.?
    plz give me code for this.??

    hai check my code...i added like this. its not working
    FORM usecomm USING ucomm LIKE sy-ucomm fields TYPE slis_selfield.
    case sy-ucomm.
    when '%EX' OR 'RW'.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
      EXPORTING
       TITLEBAR                    = 'EXIT'
      DIAGNOSE_OBJECT             = ' '
        text_question               = 'Do u want to exit?'
      TEXT_BUTTON_1               = 'Ja'(001)
      ICON_BUTTON_1               = ' '
      TEXT_BUTTON_2               = 'Nein'(002)
      ICON_BUTTON_2               = ' '
      DEFAULT_BUTTON              = '1'
      DISPLAY_CANCEL_BUTTON       = 'X'
      USERDEFINED_F1_HELP         = ' '
      START_COLUMN                = 25
      START_ROW                   = 6
      POPUP_TYPE                  =
    IMPORTING
      ANSWER                      =
    TABLES
      PARAMETER                   =
    EXCEPTIONS
      TEXT_NOT_FOUND              = 1
      OTHERS                      = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endcase.
    CASE ucomm.
      WHEN '&IC1'.
      IF fields-fieldname = 'SALES_OFF'.
      READ TABLE tbl_basic_list INDEX fields-tabindex.
      SELECT vkgrp FROM s707
      INTO TABLE tbl_first_list
      FOR ALL ENTRIES IN tbl_basic_list
      WHERE vkbur EQ tbl_basic_list-vkbur
        AND vkbur EQ fields-value.
       SELECT bezei FROM tvgrt INTO CORRESPONDING FIELDS OF TABLE
       tbl_first_list WHERE vkgrp = tbl_first_list-vkgrp AND
                            spras = sy-langu.
    SELECT avkgrp bbezei INTO CORRESPONDING FIELDS OF TABLE
    tbl_first_list FROM s707 AS a INNER JOIN tvgrt AS b
    ON avkgrp = bvkgrp
    WHERE b~spras = sy-langu
       AND a~vkbur = fields-value.
    DELETE ADJACENT DUPLICATES FROM tbl_first_list.
    APPEND tbl_first_list.
    IF NOT tbl_first_list IS INITIAL.
       LOOP AT tbl_first_list.
         CONCATENATE tbl_first_list-vkgrp '-'
                     tbl_first_list-bezei INTO
                     tbl_first_list-sgroup
                     SEPARATED BY space.
    concatenate tbl_first_list-vkgrp+0(1)
                 tbl_first_list-vkgrp+2(1) into
                 tbl_first_list-sort.
          MODIFY tbl_first_list INDEX sy-tabix.
       ENDLOOP.
    ENDIF.
    ELSE.
       CALL FUNCTION 'POPUP_TO_INFORM'
         EXPORTING
           titel         = repid
           txt1          = sy-subrc
           txt2          = 'No data found!'
      TXT3          = ' '
      TXT4          = ' '
    ENDIF.
    PERFORM fcat_first_list.
    PERFORM fieldcat_sort USING gs_sort[].
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
        I_INTERFACE_CHECK                 = ' '
        I_BYPASSING_BUFFER                =
        I_BUFFER_ACTIVE                   = ' '
          i_callback_program                = sy-cprog
          i_callback_pf_status_set          = 'PF_STATUS'
          i_callback_user_command           = 'USECOMM1'
        I_CALLBACK_TOP_OF_PAGE            = ' '
        I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
        I_CALLBACK_HTML_END_OF_LIST       = ' '
        I_STRUCTURE_NAME                  =
        I_BACKGROUND_ID                   = ' '
        I_GRID_TITLE                      =
        I_GRID_SETTINGS                   =
          is_layout                         = layout
          it_fieldcat                       = fcat1[]
        IT_EXCLUDING                      =
        IT_SPECIAL_GROUPS                 =
          it_sort                           = gs_sort[]
        IT_FILTER                         =
        IS_SEL_HIDE                       =
        I_DEFAULT                         = 'X'
        I_SAVE                            = ' '
        IS_VARIANT                        =
          it_events                         = events1[]
        IT_EVENT_EXIT                     =
        IS_PRINT                          = gs_print
        IS_REPREP_ID                      =
        I_SCREEN_START_COLUMN             = 0
        I_SCREEN_START_LINE               = 0
        I_SCREEN_END_COLUMN               = 0
        I_SCREEN_END_LINE                 = 0
        IT_ALV_GRAPHICS                   =
        IT_ADD_FIELDCAT                   =
        IT_HYPERLINK                      =
        I_HTML_HEIGHT_TOP                 =
        I_HTML_HEIGHT_END                 =
        IT_EXCEPT_QINFO                   =
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER           =
        ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = tbl_first_list
        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.
       CASE sy-subrc.
        WHEN '1'.
          MESSAGE s000.
        WHEN OTHERS.
          MESSAGE s001.
      ENDCASE.
    ENDIF.
    ENDCASE.
    ENDFORM.
    Make corrections...it's not working here

  • GUI STATUS IN ALV USING OOPS

    How can we set GUI STATUS  in a alv program using oops...Is there any method we need to use for this ????

    Hi,
    Just call screen from your program as below .
    call screen 9001.
    In the PBO of the screen,write the following code
    MODULE status_9001 OUTPUT.
      SET PF-STATUS 'ZSTATUS'.
      SET TITLEBAR 'ZTITLE'.
    ENDMODULE.                 " STATUS_9001  OUTPUT

  • Facing probelm in PF status in ALV Grid display

    HI,
    i have created a ALV grid intractive report in that i have a check box and Traffice lights , when user select the check box and press save then then traffice light color should changes to green it's doing well..but my problem is..for second time display i am calling same function module to display with chnaged traffice light color.here my probelm is after second time display when i press back it's taking me to first list not to the selection-screen. pls suggest me wot to do now for directly going to selection-screen.
    Thanks,
    saleem.
    points to awarded for all usefull answers.

    Hi again,
    1.
    <b> and press save then</b> then traffice light color should changes to green it's doing well..but
    U must have written some code
    when the BOLD occurs.
    2. This must be the call back command
      (FORM subrouritine, which the alv call backs,
       on a user command)
    3. In the same u have to write.
    4. For your reference,
       just copy paste this code.
    a) it will show records from t001 table
    b) if u double-click on any row,
        it will change the 2nd column to 'CLICKED'
        and refresh the data again.
       (it won't show alv once more in new screen)
      c) then when u do back, it will go back.
      d) See BOLD code.
    5.
    REPORT abc.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0.
            INCLUDE STRUCTURE t001.
    DATA : flag tyPE c,
           END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvly TYPE slis_layout_alv.
    Select Data
    SELECT * FROM t001 INTO TABLE itab.
    *------- Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      CHANGING
        ct_fieldcat            = alvfc
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    Display
    alvly-box_fieldname = 'FLAG'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        it_fieldcat             = alvfc
        i_callback_program      = sy-repid "<-------Important
        i_callback_user_command = 'ITAB_USER_COMMAND' "<------ Important
        is_layout               = alvly
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    CALL BACK FORM
    FORM itab_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
    slis_selfield.
    IMPORTANT.
    <b> 
      data : m type sy-index.
      m =  whatrow-tabindex.
      itab-butxt = 'CLICKED'.
      modify itab index m.
      whatrow-refresh = 'X'.</b>
    ENDFORM. "ITAB_user_command
    regards,
    amit m.

  • Problem in pf status in alv grid

    Hi ,
    In alv grid in fm reuse_alv_grid_display under parameter   I_CALLBACK_PF_STATUS_SET   = STATUS
    FORM STATUS_SET USING LS_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'XYZ' EXCLUDING EXTAB.
    ENDFORM.
    Now i have to set back & exit button in my std toolbar.
    I double clicked on XYZ & then control moves to menu painter & i defined all above mentioned button in application toolbar.
    I activated but the mentioned buttons are not displaying in output.
    Anybody will suggest me what i have to do in this case??

    hi
    good
    go through this links
    http://sap.ittoolbox.com/code/archives.asp?i=10&d=3603&a=s
    http://sap.ittoolbox.com/code/archives.asp?i=10&d=1917&a=s
    this ll give you complete idea about the pf status in alv.
    thanks
    mrutyun^

  • Create blank screen space between two ALV grids

    I want to create some blank screen space between the two ALV grids I have on the screen.  Can someone tell me how to do this?
    Thanks and best regards,
    Sandy

    You don't have link the two containers.
    I guess you have a grid and tree control that you want to display. So, use a different container for each of these controls, so that they appear differently.
    If you don't want space in between them, you can have one container and split that into and display the tree and grid in each of the split portions.
    The advantage with this will be you can resize the tree/grids using the vertical line that separates them.
    Take a look at WE02 transaction to see what I am trying to explain.
    Regards,
    Ravi

  • PF Status in ALV grid

    I've created a pf status 'STD' by copying that of SAPLSALV 's standard pf-status.
    I've a menu entry to add. which i 've done.
    Then i've attached the pf-status 'STD' to my program.
    Now when user chooses one column and clicks on it i have to show a message as to which column is being picked and how many similar entries are existing. Basically count the number of entries.
    M using FM 'REUSE_ALV_GRID_DISPLAY' for showing output.
    How can i achieve this?Plz provide some sample code for better understanding.
    Plz help.

    hi annie,
    look at the follwing code for better understanding
    *&      Form  zf_user_command
          text
    -->  p1        text
    <--  p2        text
    FORM ZF_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                                      RS_SELFIELD TYPE SLIS_SELFIELD .
        CASE R_UCOMM. "FCODE
        WHEN 'VA03'.
          READ TABLE I_SALES_FINAL INTO WA_SALES_FINAL INDEX RS_SELFIELD-TABindex.
          SET PARAMETER ID 'AUN' FIELD RS_SELFIELD-VALUE.
          CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN .
          MESSAGE I102 WITH RS_SELFIELD-VALUE .
        WHEN '&IC1'.   "for hotspot with VBELN, POSNR, MATNR, KUNNR.
          IF RS_SELFIELD-FIELDNAME = 'MATNR'.
          SET PARAMETER ID 'MAT' FIELD RS_SELFIELD-VALUE.
          CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
          RETURN.
            MESSAGE I103 WITH RS_SELFIELD-VALUE .
          ENDIF.
    IF RS_SELFIELD-FIELDNAME = 'VBELN'.
          SET PARAMETER ID 'AUN' FIELD RS_SELFIELD-VALUE.
          CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
          RETURN.
            MESSAGE I104 WITH RS_SELFIELD-VALUE .
          ENDIF.
      ENDCASE.
    ENDFORM.                    " zf_user_command
    reward point if useful
    Rohan

  • Screen gui status supress

    experts
    in sales order screen i added a application toolbar button ,now i dont want to show that button in va02, but showed be visible in va01 and va03 , tell me where to write the code  and how to supress the icon in va02 alone?

    Hi
    In main program search for SET PF-STATUS Double click on this , It will take to u to menu painter..There we have MENU BAR
    APP TOOL BAR AND FUNCTION KEYS...wat ever u want u can remove over there

  • Pf status & user-command in alv grid

    Hi Friends,
    I have one query for ALV grid.
    Actually my requirement is like that
    Whenever the user double click on grid the control moves to transaction 'VA01' tcode.
    I also wanted to set the gui status in ALV grid.
    How to do it??
    Plz tell me in detail.

    Very simple....
    copy paste this code.... remember I have created a GUI Status called ZALV_STATUS.
    So u will have to create this status to run ur program.
    U can come back if u have any doubts...
    *& Report  Z_ALV_TRAINING_LIST_HOTSPOT
    REPORT  Z_ALV_TRAINING_LIST_HOTSPOT.
    Type Pools Used  **********
    TYPE-POOLS : SLIS.
    Internal Tables Declare  ************
    DATA : it_document   type standard table of bkpf initial size 0 with header line,
           IT_FIELD_CAT  TYPE SLIS_T_FIELDCAT_ALV,
           it_alv_event  type SLIS_T_EVENT,
           fl_layout     type slis_layout_alv.
    Select Data  ***********
    start-of-selection.
    select * from bkpf into table it_document.
    Make Field Catalog  ******
    PERFORM MAKE_FIELD_CATALOG.
    Make Layout  *********
    perform sub_fill_layout.
    Make Events Table  *******
    perform sub_Fill_alv_event.
    Display ALV  *********
    PERFORM DISPLAY_ALV_LIST.
    *&      Form  make_field_catalog
          text
    -->  p1        text
    <--  p2        text
    FORM MAKE_FIELD_CATALOG .
    data : wa type slis_fieldcat_alv.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
      I_PROGRAM_NAME               =
      I_INTERNAL_TABNAME           =
       I_STRUCTURE_NAME             = 'bkpf'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_INCLNAME                   =
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        CT_FIELDCAT                  = it_field_cat
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 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.
    read table it_field_cat into wa index 3.
    wa-hotspot = 'X'.
    modify it_field_cat index 3 from wa.
    ENDFORM.                    " make_field_catalog
    *&      Form  display_alv_list
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_ALV_LIST .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM             = sy-repid
       I_CALLBACK_PF_STATUS_SET       = 'SET_MY_PF_STATUS'
      I_CALLBACK_USER_COMMAND        = ' '
       IS_LAYOUT                      = fl_layout
       IT_FIELDCAT                    = it_field_cat[]
      IT_SORT                        =
      I_DEFAULT                      = 'X'
       I_SAVE                         = 'X'
      IS_VARIANT                     = '/TEST_VV'
        IT_EVENTS                      = it_alv_event
      TABLES
        T_OUTTAB                       = it_document.
    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_alv_list
    *&      Form  sub_my_pf_event
          text
    -->  p1        text
    <--  p2        text
    FORM sub_my_pf_event using p_comm type sy-ucomm p_sEL_FIELD TYPE SLIS_SELFIELD.
      read table it_document index p_sel_field-tabindex.
      set parameter id 'BLN' field it_document-belnr.
      set parameter id 'BUK' field it_document-bukrs.
      set parameter id 'GJR' field it_document-gjahr.
      case p_comm.
        when 'PICK'.
          call transaction 'FB03' and skip first screen.
      endcase.
    ENDFORM.                    " sub_my_pf_event
    *&      Form  sub_Fill_alv_event
          text
    -->  p1        text
    <--  p2        text
    FORM sub_Fill_alv_event .
      data : wa type slis_alv_event.
      wa-name = 'USER_COMMAND'.
      wa-form = 'SUB_MY_PF_EVENT'.
      append wa to it_alv_event.
    ENDFORM.                    " sub_Fill_alv_event
    *&      Form  sub_fill_layout
          text
    -->  p1        text
    <--  p2        text
    FORM sub_fill_layout .
      fl_layout-f2code = 'PICK'.
      fl_layout-box_fieldname = 'BELNR'.
    ENDFORM.                    " sub_fill_layout
    *&      Form  SET_MY_PF_STATUS
          text
    -->  p1        text
    <--  p2        text
    FORM SET_MY_PF_STATUS USING    p_rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'ZALV_STATUS'.
    ENDFORM.                    " SET_MY_PF_STATUS
    Plz award points if it was helpful....
    Message was edited by:
            Varun Verma

Maybe you are looking for