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

Similar Messages

  • 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

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

  • 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

  • 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

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

  • 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

  • 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

  • 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

  • Hi PF-STATUS in ALV

    Hi,
    How to use custom defines PF-STATUS in ALV Grid.
    Please Give me suggestion this is very imprtant.

    Hi,
    You can create a PF status, say ZPF3 which is an exact copy of STANDARD of program SAPLSALV through transaction SE41 (Menu Painter). You can exclude certain buttons that you do not want and add more also.
    To set the PF status as say ZPF3 for your ALV grid and to handle user-command, you can use the following code piece.
    call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
      I_INTERFACE_CHECK                = ' '
      I_BYPASSING_BUFFER               = ' '
      I_BUFFER_ACTIVE                  = ' '
       i_callback_program                = v_repid
       i_callback_pf_status_set          = 'PF_STATUS_GRID1'
       i_callback_user_command           = 'USER_COMM'
      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                         = s_layout
       it_fieldcat                       = t_fcat_grid1[]
      IT_EXCLUDING                     =
      IT_SPECIAL_GROUPS                =
       it_sort                           = t_sort_grid1
      IT_FILTER                        =
      IS_SEL_HIDE                      =
      I_DEFAULT                        = 'X'
      I_SAVE                           = ' '
      IS_VARIANT                       =
      it_events                         = t_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                          = t_report
      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.                    " report_display
    *&      Form  pf_status_grid1
          Description: Set PF_STATUS for the 1st grid
    form pf_status_grid1 using rt_extab type slis_t_extab.
      set pf-status 'ZPF3'.
    endform. "pf_status_grid1
    *&      Form  USER_COMM
          Description: Handling click on the button 'Grand Total'
    form user_comm using ucomm like sy-ucomm ls_selfield type slis_selfield.
      case ucomm.
        when '&TOT'.
          perform fieldcat_build_grid2.
          perform sort_grid2.
          perform display_grandtotal.
      endcase.
    endform.                    "USER_COMM
    Reward points for useful answers.

  • PF-STATUS IN ALV Reports

    Hi
    i want to use SET PF-STATUS in ALV Grid display
    this is my code,can u tl me wts the wrong and any modification is needed.
    TYPE-POOLS: SLIS.
    TYPES: BEGIN OF I_MARA,
           MATNR LIKE MARA-MATNR,
           MTART LIKE MARA-MTART,
           MEINS LIKE MARA-MEINS,
           GROES LIKE MARA-GROES,
           VOLUM LIKE MARA-VOLUM,
           END OF I_MARA.
    DATA: IT_MARA TYPE STANDARD TABLE OF I_MARA INITIAL SIZE 0.
    DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          REPID TYPE SY-REPID,
          GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: I_TITLE_MARA TYPE LVC_TITLE VALUE 'GRID DISPLAY'.
    START-OF-SELECTION.
    PERFORM DATA_RETRIEVAL.
    PERFORM BLD_FLDCAT.
    PERFORM BLD_LAYOUT.
    PERFORM DISPLAY_ALV_REPORT.
    FORM BLD_FLDCAT.
    FLDCAT-FIELDNAME = 'MATNR'.
    FLDCAT-SELTEXT_M = 'MATERIAL NUMBER'.
    FLDCAT-COL_POS = 0.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'MTART'.
    FLDCAT-SELTEXT_M = 'MATERIAL TYPE'.
    FLDCAT-COL_POS = 1.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'MEINS'.
    FLDCAT-SELTEXT_M = 'UNIT OF MEASURE'.
    FLDCAT-COL_POS = 2.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'GROES'.
    FLDCAT-SELTEXT_M = 'SIZE'.
    FLDCAT-COL_POS = 3.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VOLUM'.
    FLDCAT-SELTEXT_M = 'VOLUME'.
    FLDCAT-COL_POS = 4.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    ENDFORM.
    FORM BLD_LAYOUT.
    GD_LAYOUT-NO_INPUT = 'X'.
    GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    GD_LAYOUT-ZEBRA = 'X'.
    GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.
    ENDFORM.
    FORM DISPLAY_ALV_REPORT.
    REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = REPID
       I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
      I_CALLBACK_USER_COMMAND           = ' '
       I_CALLBACK_TOP_OF_PAGE            = '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_TITLE_MARA
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = GD_LAYOUT
       IT_FIELDCAT                       = FLDCAT[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
       I_SAVE                            = 'X'
      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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = IT_MARA
    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.
    FORM DATA_RETRIEVAL.
    SELECT MATNR MTART MEINS GROES VOLUM
    INTO TABLE IT_MARA FROM MARA
    UP TO 40 ROWS.
    ENDFORM.
    FORM TOP_OF_PAGE.
    DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
          WA_HEADER TYPE SLIS_LISTHEADER.
    WA_HEADER-TYP = 'H'.
    WA_HEADER-INFO = 'THIS IS MY FIRST ALV'.
    APPEND WA_HEADER TO T_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-INFO = 'THIS IS SECOND'.
    APPEND WA_HEADER TO T_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = T_HEADER
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    ENDFORM.
    FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
    SET PF-STATUS 'ZSTAT'.
    ENDFORM.
    when i double click on ZSTAT ,it shows the prg is currently edit by (user-name).
    thanks in advance.

    1.   
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_CALLBACK_PROGRAM                = W_REPID
       <b> I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'</b>
    2.
    FORM <b>PF_STATUS</b> using RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD1' EXCLUDING RT_EXTAB.
    ENDFORM.                    "PF_STATUS
    3.
    FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
                            P_SELFLD TYPE SLIS_SELFIELD.
      DATA : L_REP_MODE.                "report mode
      CASE P_UCOMM.
      ENDCASE.
    ENDFORM.

  • PF status of Selection screen and ALV Grid

    Hi,
    I need to create a report where on clicking the<b> 'ENTER'</b> key on application toolbar   on the <b>selection-screen</b> the processing logic should get  executed ( instead of clicking execute  pushbutton).
    For this i need to capture the function code associated with ENTER key on selection screen. How can i find this?
    Also , on clicking enter i have to display <b>an ALV grid</b> with the <b>SAVE</b> key activated on the toolbar.How can i activate SAVE key on application toolbar of ALV GRID. (<b>Selection-screen should not have save key</b> )
    thanks,
    vartika

    Hi
    you can just copy the alv standard pf status  into your alv.
    goto se41.
    enter "SAPLSLVC_FULLSCREEN"
    then copy the standard pf status " STANDARD_FULLSCREEN" to your program "xyz".
    in your prog, when you call the alv grid,
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
        i_callback_program                = l_v_repid
        i_callback_pf_status_set         = 'SET_PF_STATUS'  <----
        i_callback_user_command           = 'USER_COMMAND'
        i_callback_top_of_page            = 'ALV_TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    tHEN CPOY PASTE THIS CODE:
    NOTE:  No need to make a perform for this....
    *       FORM SET_PF_STATUS                                         *
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS '/FIR/RRF2S0BG_ALV'.
      "Copy of standard pf_status from
    ENDFORM.                    "set_pf_status
    Now can see the full tool bar enabled in your alv grid.
    delete all the unwanted buttons from your programs pf status .
    Hope that helps.
    Cheers
    Ravish Garg.
    <i>
    Reward if useful</i>

  • ALV grid to list processing and GUI status

    Hi,
    In a customized program the report output is in ALV grid which is interactive. On selecting a record and pressing SAVE button a BAPI runs in background. In order to display BAPI error message the leave to list-processing has been used. But GUI status is not working in list display and can not exit or go back from here to main selection screen.
    when try to see program name & screen no it displays
    Program - SAPLKKBL
    Menu - STANDARD_FULLSCREEN
    pls advise how to go back from list to main screen or ALV output.
    thanks
    anya

    Hi Anya,
    As per my understanding, this is your prog flow:
    *Main ALV Display.
    *Select record.
    *Click on Button SAVE.
    *Handle Event.
    *Call BAPI for processing based on selection.
    Now at this point why dont you colect the error messages from the BAPI, and display it in a POP-UP ALV display?
    You need not e very much worried about the PF status and all. Also this POP-UP will be placed on the MAIN ALV. So when you close the POP-UP it will come back to the main ALV.
    By this when you press the BACK button of the main ALV, it will take you back to the selection scree.
    Please let me know if i am missing something.
    ags

  • ALV Grid- to avoid message in status bar

    Hi,
    When ever i am doing sum in ALV Grid. I got the following message in statusbar.
    ' The field BETRAG_ITEM cannot be totalled of field overflow '
    I am using currency field of 13 length and 2 decimals (Output length as 18 characters). How can i will aviod this message. could you please help me.
    For right answer  i can reward the points.
    Regards
    Bhupal Reddy

    HI,
    Make the output length in the fieldcat for the particular fields as 18.
    reward if helpful,
    regards,
    nazeer

  • ALV GRID PF status.

    Hi,
        I am using the function module REUSE_ALV_GRID_DISPLAY and I have created the pf status
    after keeping PF status in report when I download data into excel only header is getting downloaded into excel but line item data is missing in the excel
    Please help me to sort out this issue.
    Thanks in advance.

    Hi,
    In se41, create your pf status.
    then in extras go to adjust templates.
    In adjust templates, select List viewer. All the standard status for alv ll be imported.
    Now change the application toolbar with your requirement.
    Download and check now the excel sheet.
    The same problem i had, and solved by doing this. It worked fine then.
    Hope this helps.
    Regards,
    Dhasarathy. K

Maybe you are looking for

  • Clarification on how to use Xserve Raid and Fibre Channel without xsan.

    First let me apologize for not responding earlier to your response, I tend to get busy and then forget to check back here. Tod, the answer to your question is No, only one computer is accessing the xserve raid files at any one time and that is via Fi

  • Is SharePoint Enterprise Needed For Digital Signatures?

    Hey SharePoint Fam, Had a request come in for Digital Signature use and was wondering is this even possible without Enterprise version?  We are on Standard 2010 version...... Thanks n advance

  • UITextField from .xib file doesn't show

    A UITextField from .xib file doesn't show when it's page comes up on the iPhone simulator. The View looks fine in Interface Builder, and no warnings are thrown to Console or IB's Info window. On the Simulator the View comes up and a Label and a Switc

  • Skype: Microphone input won't work

    Good evening, after multiple tests and trying out the error resolving hints I found on the arch forums (with reference to the skype forums) I am still not able to get some input which can be heard by my counterpart. Here's a screenshot of alsamixer.

  • Allow stacks in collections

    I have my collection organized by collections, not by folders. However, Lightroom2 only allows me to use the wonderful stack functionality in the folders, not inside of collections. This for all intents and purposes that the stacks function, which sh