Help req : alv grid with multiple row selection

Hi all sap gurus,
i have a alv list display program , in which i can select the o/p rows(multiple rows)
and perform some actiom based on some icons .
now i have to convert this in to grid display
this is initial code i.e for list
DATA :  BEGIN OF itab OCCURS 0.
        INCLUDE STRUCTURE ztest.
DATA :  checkbox type c.
DATA : END OF itab.
s_layout-box_fieldname = 'CHECKBOX'.
  ty_events-name = slis_ev_top_of_page.
  ty_events-form =  'TOP_OF_PAGE'.
  APPEND ty_events TO it_events.
ALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            i_program_name     = v_repid
            i_internal_tabname = 'ITAB'
            i_inclname         = v_repid
       CHANGING
            ct_fieldcat        = build_fieldcatalog.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
     EXPORTING
   I_INTERFACE_CHECK              = ' '
   I_BUFFER_ACTIVE                = ' '
     i_callback_program             = v_repid
     i_callback_pf_status_set       = 'SET_PF_STATUS'
     i_callback_user_command        = 'USER_COMMAND'
     i_structure_name               = 'ITAB'
     is_layout                      = s_layout
     it_fieldcat                    = build_fieldcatalog[]
   IT_EXCLUDING                   =
   IT_SPECIAL_GROUPS              =
   IT_SORT                        =
   IT_FILTER                      =
   IS_SEL_HIDE                    =
   I_DEFAULT                      = 'X'
   I_SAVE                         = ' '
   IS_VARIANT                     =
     it_events                      = 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                    = itab
     EXCEPTIONS
       program_error                = 1
       OTHERS                       = 2
  IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
  IF ucomm = 'DELE'.
    LOOP AT iTAB WHERE CHECKbox = 'X' .
    ENDLOOP.
    MODIFY  ztEST FROM TABLE itAB.
  ENDIF.
  selfield-refresh = 'X'.
ENDFORM.
NOW I HAVE A LIST O/P WHERE I CAN SELECT THE BOX AND CLICK DELETE ICON.
NOW I WANT TO CHANGE TO GRID, SO I KEPT EVERYTHING SAMRE AND I CHANGED  " LIST" TO "GRID"
NOW TWO THINGS HAPPEND
1) I SEE A EMPTY COLUMN IN THE O/P , I GUESS THATS BECAUSE CHECKBOSX IN INTERNAL TABLE , SO I REMOVED IT
SO THIS MADE ME TO REMOVE
IF ucomm = 'DELE'.
    LOOP AT iTAB." WHERE CHECKbox = 'X' .------PROBLEM
    ENDLOOP.
    MODIFY  ztEST FROM TABLE itAB.
  ENDIF.
  selfield-refresh = 'X'.
NOW I DON'T SEE THE EMPTY COLUMN , BUT NOW PROBLEM  IS I CANNNOT DISTINGUISH AS TO WHICH IS SELECTED AND AT ANY POINT OF TIME I CANSELECT ONLY ROW.
ALL I WANT IS
1) I WANT TO SELECT MULTIPLE ROWS AND SHOULD BE ABLE TO KNOW WHICH ROWS WERE SELECTED IN THE O/P SCREEN.
IN THE LIST DISPLAY I HAD CHECKBOX = 'X' FOR ALL THE ROWS THAT WERE SELECTED , I WANT THE SIMILAR THING in grid display
LET ME KNOW whether this can be done without USING 00 LANG.
thanks

Hi Swati,
Below code might help full for you. Description: is It selects multiple rows from ALV and display it on the next ALV.
*************************Reward Point If help full********************************************
*& Report   z7cc_alv_oops_show_next_alv                                *
*&          DEVELOPERS NAME : CHIDANAND CHAUHAN
*&          DATE: SATURDAY 08-07-2006
*&          DESCRIPTION: TO CREATE AN OBJECT ORIENTED ALV
REPORT      z7cc_alv_oops_show_next_alv MESSAGE-ID  z5hs .
DATA : BEGIN OF it_mara OCCURS 0,
  mark  TYPE flag,
  matnr TYPE matnr,
  mtart TYPE mtart,
  meins TYPE meins,
END OF it_mara.
DATA : BEGIN OF it_mara1 OCCURS 0,
*  mark  type flag,
  matnr TYPE matnr,
  mtart TYPE mtart,
  meins TYPE meins,
END OF it_mara1.
DATA : BEGIN OF it_mara2 OCCURS 0,
*  mark  type flag,
  matnr TYPE matnr,
  mtart TYPE mtart,
  meins TYPE meins,
END OF it_mara2.
DATA : t_fieldcat TYPE lvc_t_fcat,
         t_fieldcat1 TYPE lvc_t_fcat,
      s_fieldcat LIKE LINE OF t_fieldcat.
DATA : s_layout TYPE lvc_s_layo.
DATA : control TYPE REF TO cl_gui_custom_container,
       grid  TYPE REF TO cl_gui_alv_grid.
DATA: BEGIN OF wa ,
  mark  TYPE flag,
  matnr TYPE matnr,
  mtart TYPE mtart,
  meins TYPE meins,
END OF wa.
*       CLASS lcl_events_box DEFINITION
CLASS lcl_events_box DEFINITION.
  PUBLIC SECTION.
    METHODS :
*Handler_Data_Changed for event Data_Changed of cl_gui_alv_grid
*imporTing er_data_changed,
    handler_user_command FOR EVENT user_command OF cl_gui_alv_grid
    IMPORTING e_ucomm,
    handler_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
    IMPORTING e_object e_interactive.
ENDCLASS.                    "lcl_events_box DEFINITION
*       CLASS lcl_events_box IMPLEMENTATION
CLASS lcl_events_box IMPLEMENTATION.
* method to handle the user command.
  METHOD handler_user_command.
    PERFORM form_usercommand CHANGING e_ucomm.
  ENDMETHOD.                    "Handler_user_command
*& Mehod to handle the toolbar.
  METHOD handler_toolbar.
    PERFORM form_toolbar CHANGING e_object e_interactive
    e_object->mt_toolbar.
  ENDMETHOD.                    "Handler_ToolBar
ENDCLASS.                    "lcl_events_box IMPLEMENTATION
START-OF-SELECTION.
  DATA : w_events TYPE REF TO lcl_events_box.
  SELECT matnr mtart meins FROM mara INTO CORRESPONDING FIELDS OF TABLE
  it_mara.
  CALL SCREEN 100.
*&      Module  pbo_module  OUTPUT
*       text
MODULE pbo_module OUTPUT.
  IF grid IS INITIAL.
    CREATE OBJECT control
      EXPORTING
        container_name     = 'CUST_CTRL'.
    CREATE OBJECT grid
      EXPORTING
        i_parent          = control.
    PERFORM build_catalog.
    PERFORM build_catalog1.
    PERFORM build_layout.
    CALL METHOD grid->set_table_for_first_display
      EXPORTING
        is_layout       = s_layout
      CHANGING
        it_outtab       = it_mara[]
        it_fieldcatalog = t_fieldcat.
    CREATE OBJECT w_events.
    SET HANDLER : w_events->handler_toolbar FOR grid,
                  w_events->handler_user_command FOR grid.
    CALL METHOD grid->set_toolbar_interactive.
  ELSE.
    CALL METHOD grid->refresh_table_display.
  ENDIF.
ENDMODULE.                 " pbo_module  OUTPUT
*&      Form  BUILD_CATALOG
FORM build_catalog .
  s_fieldcat-col_pos = '1'.
  s_fieldcat-fieldname = 'MARK'.
  s_fieldcat-checkbox = 'X'.
  s_fieldcat-edit = 'X'.
  APPEND s_fieldcat TO t_fieldcat.
  CLEAR s_fieldcat.
  s_fieldcat-col_pos = '2'.
  s_fieldcat-fieldname = 'MATNR'.
  s_fieldcat-scrtext_m = 'MATERIAL'.
  APPEND s_fieldcat TO t_fieldcat.
  s_fieldcat-col_pos = '3'.
  s_fieldcat-fieldname = 'MTART'.
  s_fieldcat-scrtext_m = 'MATERL TYPE'.
  APPEND s_fieldcat TO t_fieldcat.
  s_fieldcat-col_pos = '4'.
  s_fieldcat-fieldname = 'MEINS'.
  s_fieldcat-scrtext_m = 'UOM'.
  APPEND s_fieldcat TO t_fieldcat.
ENDFORM.                    " BUILD_CATALOG
*&      Form  BUILD_LAYOUT
*       text
*  -->  p1        text
*  <--  p2        text
FORM build_layout .
  s_layout-zebra = 'X'.
* S_LAYOUT-CWIDTH_OPT = 'X'.
  s_layout-grid_title = 'Material Details'.
ENDFORM.                    "BUILD_LAYOUT
" BUILD_LAYOUT////////////////////////////////////
" USER_COMMAND_0100  INPUT
*&      Form  FORM_USERCOMMAND
*       text
*      <--P_E_UCOMM  text
FORM form_usercommand  CHANGING p_e_ucomm.
  CASE p_e_ucomm.
    WHEN 'INT1'.
      DO.
        READ TABLE it_mara INDEX sy-index TRANSPORTING mark matnr.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        IF it_mara-mark = 'X'.
          READ TABLE it_mara INTO wa TRANSPORTING matnr mtart meins .
          MOVE-CORRESPONDING wa TO it_mara1.
          READ TABLE it_mara1 TRANSPORTING matnr mtart meins .
          MOVE-CORRESPONDING it_mara1  TO it_mara2.
          APPEND it_mara2.
          CALL METHOD grid->set_table_for_first_display
            EXPORTING
              is_layout       = s_layout
            CHANGING
              it_outtab       = it_mara2[]
              it_fieldcatalog = t_fieldcat1.
*       SET PARAMETER ID 'MAT' FIELD IT_MARA-MATNR.
*       CALL TRANSACTION 'MM02'.
        ENDIF.
*      ENDIF.
      ENDDO.
  ENDCASE.
ENDFORM.                    " FORM_USERCOMMAND
*&      Form  FORM_TOOLBAR
*       text
*      <--P_E_OBJECT  text
*      <--P_E_INTERACTIVE  text
*      <--P_E_OBJECT_>MT_TOOLBAR  text
FORM form_toolbar  CHANGING p_e_object TYPE REF TO
cl_alv_event_toolbar_set
p_e_interactive
mt_toolbar TYPE ttb_button.
  DATA wal_button TYPE stb_button.
*WAL_BUTTON-ICON = ICON_status_reverse.
  wal_button-text = 'GO'.
  wal_button-quickinfo = 'PROCEED'.
  wal_button-function = 'INT1'.
  wal_button-butn_type = 0.
  wal_button-disabled = space.
  INSERT wal_button  INTO p_e_object->mt_toolbar INDEX 1.
ENDFORM.                    " FORM_TOOLBAR
*&      Module  PF-STATUS  OUTPUT
*       text
MODULE pf-status OUTPUT.
  SET PF-STATUS 'Z7CCSTAT'.
ENDMODULE.                 " PF-STATUS  OUTPUT
*&      Module  USER_COMMAND_0100  INPUT
*       text
MODULE user_command_0100 INPUT.
  CASE sy-ucomm.
    WHEN 'BACK'.
      LEAVE PROGRAM.
    WHEN 'CANCEL'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
*&      Form  BUILD_CATALOG1
*       text
*  -->  p1        text
*  <--  p2        text
FORM build_catalog1 .
  s_fieldcat-col_pos = '1'.
  s_fieldcat-fieldname = 'MATNR'.
  s_fieldcat-scrtext_m = 'MATERIAL'.
  APPEND s_fieldcat TO t_fieldcat1.
  s_fieldcat-col_pos = '2'.
  s_fieldcat-fieldname = 'MTART'.
  s_fieldcat-scrtext_m = 'MATERL TYPE'.
  APPEND s_fieldcat TO t_fieldcat1.
  s_fieldcat-col_pos = '3'.
  s_fieldcat-fieldname = 'MEINS'.
  s_fieldcat-scrtext_m = 'UOM'.
  APPEND s_fieldcat TO t_fieldcat1.
ENDFORM.                    " BUILD_CATALOG1

Similar Messages

  • Back from ALV Grid with multiple refresh

    I have a report that from a selection screen shows an editable ALV Grid, and after I save it, it will refresh the grid.
    My problem is when I hit the BACK button it returns to the "previous grid" instead of the selection screen
    I am using the following:
    WHEN 'BACK_C'.
      LEAVE to SCREEN '0'.
    How can I force it to go back to the selection screen?
    sidenote: I have tried using call
    selection-screen '1000'
    but it adds a new problem as in the selection screen hitting back will return to the grid and I can never exit the report.

    Neither solution works.
    If it helps, I'm refreshing the grid with:
    DATA : ref_grid TYPE REF TO cl_gui_alv_grid.
      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.
    CALL METHOD ref_grid->refresh_table_display( ).
    It seems when I refresh the grid it generates a completely independent grid screen and there's no way to skip them all and return to the selection screen.

  • ALV Grid with Multiple Headers

    Dear All ,
    I want to know is it possible to display Multiple header in the ALV Grid Display it is possible in List Display that i dne but i want in
    My requirment is :
                Header  1                                          |                           Header 2
       SubHeader 1       |   SubHeader 2              |    SubHeader 3      |   SubHeader 4
            R1                    |              R2                    |         R1                    |              R2                    |
            R1                    |              R2                    |         R1                    |              R2                    |
            R1                    |              R2                    |         R1                    |              R2                    |
            R1                    |              R2                    |         R1                    |              R2                    |
            R1                    |              R2                    |         R1                    |              R2                    |
            R1                    |              R2                    |         R1                    |              R2                    |
    Header line 1 and Header line 2 in this format .
    How it could be possible Please suggest or its not at all possible .  Please suggest .
    Thanks & Regards,
    Aryan

    >
    Aryan@sap wrote:
    > That i will do in end but i want with ALV Grid . If it wont be possible with ALV grid i will finally do with ALV List .
    > If any solution possible through ALV Grid then Please Suggest .
    Then go for ALV List. But i am not sure if you can achieve this using the method suggested by Soumyaprakash.
    You can give it a try though.
    It is possible because that I have seen in standard here i cant paste the screen shot . but how its comming tht i am not able to analysis .
    This is news to me now. Which standard code are you referring to?
    Good luck !!

  • ALV Grid multiple row selection, disabling some

    Does anyone know if it is possible to have an ALV grid with multiple row selection allowed but for some rows the row selection is disabled?
    Kind regards,
    John.

    Hi John,
    You can add a check box and select multiple rows. I am using the same technique. I have used OO.
    a) Use Even handler "Double Click"
    b)Using "SELECT_ALL_ENTRIES  CHANGING PT_OUTTAB TYPE STANDARD TABLE" and I am sorting based Check box selection.
    Need more help please let me know. I will send you the code.
    Lanka
    Message was edited by: Lanka Murthy

  • Multiple row selection in ADF Table using addition column with checkbox

    I am using ADF table(Jdeveloper11g) and i want to selecte multiple rows it may be more than one OR all rows.
    For that i added one Column to the table with Header Delete and checkbox
    <af:table....
    <af:column sortProperty="Delete" headerText="Delete" width="100"
    sortable="false">
    <af:selectBooleanCheckbox label="#{row.favoriteId}"
    valueChangeListener="#{Mybean.onCheck}"
    id="checkbox" autoSubmit="true">
    </af:selectBooleanCheckbox>
    </af:column>
    </af:table>
    backing bean:Here i added code to get Value of one column with id favoriteId and use an arrayList(listForDelete) to monitor the state of the checkboxes
    public void onCheck(ValueChangeEvent valueChangeEvent) {
    BindingContainer bindings = getBindings();
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind =
    (DCIteratorBinding)bindings.get("getUserFavoritesByUserIDIterator");
    if (iterBind != null && iterBind.getCurrentRow() != null) {
    RichSelectBooleanCheckbox ch = (RichSelectBooleanCheckbox)valueChangeEvent.getSource();
    if (!ch.isSelected()) {
    Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
    listForDelete.add(issueId);
    else
    Long issueId = (Long)iterBind.getCurrentRow().getAttribute("favoriteId");
    listForDelete.remove(issueId);
    Problem is that when i select single row checkBox, onCheck() method of backing bean gets called multiple times(equals to the number of rows)
    I think this is beacuse of <af:selectBooleanCheckbox id is same that is "checkbox" but i am not sure.Even i tried to assign some unique id but no any success in assigning Id with value Expression.
    I also find related post
    Re: ADF Table Multiple row selection by Managed Bean
    but that is related to Select All rows or Deselect all rows from table.
    From the simillar post i follow the steps given by Frank.but problem with below step
    ->have an af:clientAttribute assigned to the checkbox with the following EL #{row.key} ,here I added <af:clientAttribute name="#{row.key}"></af:clientAttribute> and i am getting error
    Error(64,37):  Static attribute must be a String literal, its illegal to specify an expression.
    Please let me know if any one had already implemented same test case.
    Thanks for all help
    Jaydeep
    Edited by: JaydeepJ on Aug 7, 2009 4:42 AM

    just to update after the rollback is called in the cancel button i wrote following code which does not change the row focus to the first row
    DCBindingContainer bc =
    (DCBindingContainer)BindingUtils.getBindingContext().getCurrentBindingsEntry();
    DCIteratorBinding profItr =
    bc.findIteratorBinding("ProfileSearchInstIterator");
    Row cRow = profItr.getRowAtRangeIndex(0);
    if(cRow != null){
    System.out.println("Current row is not null so fixed ");
    profItr.setCurrentRowIndexInRange(0);
    RowKeySetImpl rks = new RowKeySetImpl();
    ArrayList keyList = new ArrayList();
    keyList.add(cRow.getKey());
    rks.add(keyList);
    profileTable.setSelectedRowKeys(rks);
    AdfFacesContext.getCurrentInstance().addPartialTarget(profileTable);
    }

  • ALV Grid with Popup Window

    Hey @all,
    I want to make a ALV Grid with a Popup Window. The idea is that there is a field for notes and when you click on this field a popup window should be opened where you can insert more text or if text already exists only the first column of the text is shown in field until you click on the field.
    Is there any possibility to do it this way? Do I have to make a second Grid for this Popup Window? Do anybody have an example how to solve this problem?
    Thank you in advance for your answers!
    Greetings,
    Alexander

    *& Report  Z_VISHVAS_ALV1
    report  z_vishvas_alv1.
    type-pools: slis.
    data: begin of i_outtab occurs 0.
            include structure sflight.
    data:   w_chk type c.                  "For multiple selection
    data: end of i_outtab.
          I_OUTTAB TYPE SFLIGHT OCCURS 0,
    data: i_private type slis_data_caller_exit,
          i_selfield type slis_selfield,
          w_exit(1) type c.
    parameters: p_title type sy-title.
    start-of-selection.
      select * from sflight into table i_outtab.
      call function 'REUSE_ALV_POPUP_TO_SELECT'
           exporting
                i_title                 = p_title
                i_selection             = 'X'
                i_zebra                 = 'X'
              I_SCREEN_START_COLUMN   = 0
              I_SCREEN_START_LINE     = 0
              I_SCREEN_END_COLUMN     = 0
              I_SCREEN_END_LINE       = 0
                i_checkbox_fieldname    = 'W_CHK'
              I_LINEMARK_FIELDNAME    =
              I_SCROLL_TO_SEL_LINE    = 'X'
                i_tabname               = 'I_OUTTAB'
                i_structure_name        = 'SFLIGHT'
              IT_FIELDCAT             =
              IT_EXCLUDING            =
              I_CALLBACK_PROGRAM      =
              I_CALLBACK_USER_COMMAND =
               IS_PRIVATE             = I_PRIVATE
         importing
                es_selfield             = i_selfield
                e_exit                  = w_exit
           tables
                t_outtab                = i_outtab
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc <> 0.
       MESSAGE i000(0k) WITH sy-subrc.
      endif.
    *****the internal table is modified with a cross sign for marking the
    ***rows selected
      loop at i_outtab where w_chk = 'X'.
        write: /  i_outtab-carrid, i_outtab-price.
      endloop.

  • ALV grid with 2 labels on the output

    Hi,
    I am trying ALV  Grid with two labels using Function modules.
    in the output, it should appear like...
    Header1 | Header2 | Header3 | Header4 |
    T21
    T22
    T31
    T32
    First line is for Header lable and second line is for item lable under corresponding Header labels.
    Pls. can any suggest me a solution for this..
    Thanks
    PRa

    Using the Gird Functions it is not possible, you can get the with the help of ALV list function.
    If you use this aproach you will loose some Functionalities, Your Report Output will Distorted.
    cehck this image..
    http://img100.imageshack.us/img100/3846/output6ef.th.gif
    REPORT ZTEST_ALV message-id zz .
    TYPE-POOLS: SLIS.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
    IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    L_LAYOUT type slis_layout_alv,
    x_events type slis_alv_event,
    it_events type SLIS_T_EVENT.
    DATA: BEGIN OF ITAB OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    MALE type i,
    female type i,
    END OF ITAB.
    SELECT VBELN
    POSNR
    FROM VBAP
    UP TO 20 ROWS
    INTO TABLE ITAB.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-SELTEXT_L = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'MALE'.
    X_FIELDCAT-SELTEXT_L = 'MALE'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 3.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'FEMALE'.
    X_FIELDCAT-SELTEXT_L = 'FEMALE'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 3.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    x_events-NAME = SLIS_EV_TOP_OF_PAGE.
    x_events-FORM = 'TOP_OF_PAGE'.
    APPEND x_events TO iT_EVENTS.
    CLEAR x_events .
    L_LAYOUT-NO_COLHEAD = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = L_LAYOUT
    IT_FIELDCAT = IT_FIELDCAT
    it_events = it_events
    TABLES
    T_OUTTAB = ITAB
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    FORM TOP_OF_PAGE.
    *-To display the headers for main list
    FORMAT COLOR COL_HEADING.
    WRITE: / SY-ULINE(103).
    WRITE: / SY-VLINE,
    (8) ' ' ,
    SY-VLINE,
    (8) ' ' ,
    SY-VLINE,
    (19) '***'(015) centered,
    sy-vline.
    WRITE: / SY-VLINE,
    (8) 'VBELN'(013) ,
    SY-VLINE,
    (8) 'POSNR'(014) ,
    SY-VLINE,
    (8) 'MALE'(016) ,
    sy-vline,
    (8) 'FMALE'(017) ,
    sy-vline.
    FORMAT COLOR OFF.
    ENDFORM.

  • Handle multiple rows selection on Matrix

    Hi all,
    i'd like to know if someone could help me with multiple selections on matrix via shift + left mouse button on a matrix.
    I got a matrix with one column containing a checkbox for selection. The matrix, on a UDO Form, is defined as auto selecting, so multiple selection of rows is allowed.
    I want to add the rows selected by the checkbox (using shift + left mouse button on the selection start and selection end) column to the matrix selected rows collection.
    Is there any chance to catch an event handling this situation?
    I can add the rows in the matrix selected rows collection clicking the checkboxes one by one, but when i use the multiple selection i can't get any event handling this.
    I know i couldn't use the checkbox for the selection and use instead the native function of sap b1 matrix., but this way is faster (and more clear, because you see the check when a row is selected) when you have multiple rows selected one by one
    I hope i've been clear enough, and hope somene can give me an hint.
    Thanks in advance.

    Hi Cesidio,
    if I understand you correctly you want to select one row than shift+mouseclick some rows lower and the result should be, that all rows are selected ?
    You can achieve this by catching the itempressed event and querying pVal.Modifiers.
    This is an example for Grid :
    private void Grid0_PressedAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
                if (pVal.Modifiers == SAPbouiCOM.BoModifiersEnum.mt_SHIFT)
                    int lastRowSelected =Grid0.Rows.SelectedRows.Item(Grid0.Rows.SelectedRows.Count-1,SAPbouiCOM.BoOrderType.ot_RowOrder);
                    if (lastRowSelected < pVal.Row)
                        for (int i = pVal.Row; i > lastRowSelected; i--)
                            Grid0.Rows.SelectedRows.Add(i);
    regards,
    Maik

  • Web dynpro screen with multiple rows with columns that can be edited

    Web dynpro screen with multiple rows with columns that can be edited individually:
    Hi
    I am busy creating a screen in web dynpro for ABAP which we would like to make available via Portal ESS (Portal 7).
    I need to add 'n type of table (or almost something like Excel) or something in which someone can type a few paycode numbers (there should be lets say 10 blank rows in which info can be typed in and if I click on a button or so, more rows must be added if necessary.  Then in the other colums stuff like amounts must be entered which one should also be able to edit then and there.
    Can anyone assist in what I can use for this?  There does not seem to be some existing element that I can use.
    Help will be appreciated.
    Regards
    Debbie

    Hi Debbie,
    Whiel Creating table you need to be care full that use chose INPUT FIELD as the CELL EDITOR. Just guessing that if ur table is not editable u might have choosen TextView as default cell editor type.
    check link for details on TABLE UI
    [http://help.sap.com/saphelp_erp2005/helpdata/EN/b5/ac884118aa1709e10000000a155106/frameset.htm]
    easy way is to first add UI ELEMENT TABLE to your VIEW, then right click over it & select create binding from context. After you have a pop up where you can select what columns you want what should be its cell editor etc.
    Greetings
    Prashant

  • OO ALV grid with a header line is this possible?

    Howdy!
    I have a requirement where I need to produce an ALV grid with the following format:
    <b>Text 1     Text 2  Text 3                  Text 4
                              Text 6
    Col_1 Col_2 Col_3 Col_4 Col_5 Col_6 Col_7 Col_8 Col_9 
    Cell conents -
    Cell conents -
    Cell conents -
    Cell conents -
    Cell conents -
    </b>
    Anyone got any idea on how to get the 'TEXT' fields into the ALV grid? These are dynamic texts that would basically display details of data entered in the selection screen.
    The ALV title line is limited to 70 characters and I can't think of another way of doing this.
    The texts need to appear on the ALV grid becasue the user would like to download them to Excel in addition to the ALV cell contents using the standard ALV functionality.
    Any ideas would be appreciated!
    Message was edited by: Robert

    I'm thinking that this may not work because it is not a full screen grid and the grid container does not care about the container on top of it so, it most likely would not print it.   Implement this example program, you can see how this would work for you if you were using the FM.
    report zrich_0001
           no standard page heading.
    * Global ALV Data Declarations
    type-pools slis.
    data: begin of i_alv occurs 0,
          matnr type mara-matnr,
          end of i_alv.
    * Miscellanous Data Declarations
    data: fieldcat type slis_t_fieldcat_alv,
          events   type slis_t_event,
          list_top_of_page type slis_t_listheader,
          top_of_page  type slis_formname value 'TOP_OF_PAGE'.
    start-of-selection.
      perform initialization.
      perform get_data.
      perform call_alv.
    end-of-selection.
    *  Form  Initialization
    form initialization.
      clear i_alv.       refresh i_alv.
      perform eventtab_build using events[].
    endform.
    *  Form  Get_Data
    form  get_data.
      select matnr into table i_alv
                  from mara up to 100 rows.
    endform.
    *  CALL_ALV
    form call_alv.
      data: variant type  disvariant.
      data: repid type sy-repid.
      repid = sy-repid.
      variant-report = sy-repid.
      variant-username = sy-uname.
      perform build_field_catalog.
      perform comment_build using list_top_of_page[].
    * Call ABAP List Viewer (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat        = fieldcat
                i_callback_program = repid
                is_variant         = variant
                it_events          = events[]
                i_save             = 'U'
           tables
                t_outtab           = i_alv.
    endform.
    * EVENTTAB_BUILD
    form eventtab_build using events type slis_t_event.
    * Registration of events to happen during list display
      data: tmp_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = events.
      read table events with key name = slis_ev_top_of_page
                               into tmp_event.
      if sy-subrc = 0.
        move top_of_page to tmp_event-form.
        append tmp_event to events.
      endif.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      clear: fieldcat. refresh: fieldcat.
      data: tmp_fc type slis_fieldcat_alv.
      tmp_fc-reptext_ddic = 'Material'.
      tmp_fc-fieldname    = 'MATNR'.
      tmp_fc-tabname      = 'I_ALV'.
      tmp_fc-outputlen    = 18.
      append tmp_fc to fieldcat.
    endform.
    * COMMENT_BUILD
    form comment_build using list_top_of_page type
                                            slis_t_listheader.
      data: tmp_line type slis_listheader.
      clear tmp_line.
      tmp_line-typ  = 'H'.
      tmp_line-info = 'Here is a line of text'.
      append tmp_line to list_top_of_page.
      clear tmp_line.
      tmp_line-typ  = 'S'.
      tmp_line-key  = 'Key1'.
      tmp_line-info = 'Here is a value'.
      append tmp_line to list_top_of_page.
      clear tmp_line.
      tmp_line-typ  = 'S'.
      tmp_line-key  = 'Key2'.
      tmp_line-info = 'Here is another value'.
      append tmp_line to list_top_of_page.
    endform.
    * TOP_OF_PAGE
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                i_logo             = 'ENJOYSAP_LOGO'
                it_list_commentary = list_top_of_page.
    endform.
    Regards,
    Rich Heilman

  • Multiple Row selection in JSP using checkbox - Oracle BPM 10gR3

    Dear BPM Experts,
    Has anyone invoked JSP from Oracle BPM 10gR3 screen flow that has the following UI requirement.
    1. When UI is loaded user is presented with multiple rows of pre-populated data(each column of the row represents attributes of a BPM object) with checkbox against each of the rows for user to select one, many and all rows.
    2. User has option to select one, many and all rows and submit the form.
    3. Upon submission, the all data related to selected rows only should made available to a BPM process(either using Global Creation or Global Interactive activity)
    I was able to have the JSP created with FTL tags but unable to transmit the data back to BPM process. Same has been accomplished using BPM Presentation. Can any one please help me with the JSP implementation? It is little urgent, so your early intervention is much solicited and coveted.
    I will send you guys the code I have in case you need to review.
    Regards,
    Subho

    Hi friends
    I need to do the same feature, select elements, but in a tree object. I've followed the same approach - using a selectBooleanCheckBox in each node of the Tree. But, when I submit the page, the boolean property of my TreeNode object isnt changed.
    An Idea?
    thanks a lot!

  • ALV Hierarchical With multiple boxes

    Hello.
    I have an alv hierarchical with multiple boxes.
    Can I  insert a buttom in Gui status of alv that allows me to  expand  all the boxes of  hierarchy?
    Regards
    Angela

    Hi Narendra,
    Try this program:
    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
    Hope this helps you.
    Regards,
    Chandra Sekhar

  • How can i create a grid with summary row

    Hello Professionals,
    I'm wondering how could i create a grid like the grid below, i want to create a grid with summary row,
    i have tried to create it using collapsing but it didn't work as required.
    Any suggestions?, i want to know just the starting point so i can make deep investigations.
    Thanks in Advance,

    Hi Karem,
    this can be achieved by just assigning a datatable containing the data plus some formatting of grid. Meaning there is no feature for that.
    The datatable can be filled manually or by sql query. Then you have to attach some events for updating the values ( validate after for gid item ).
    A small example for a sql query showing last month quotations and orders with summary :
    select 1 as Sort,cast(DocNum as varchar) as DocNum,DocTotal,convert(varchar, DocDate,104) from OQUT where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    UNION ALL
    Select 2 as Sort,'Summary ( Quotation ) : ',sum(DocTotal), convert(varchar,  DATEADD(month, -1, GETDATE()),104)+' - '+convert(varchar,   GETDATE(),104) from OQUT where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    UNION ALL
    select 3 as Sort,cast(DocNum as varchar) as DocNum,DocTotal,convert(varchar, DocDate,104) from ORDR where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    UNION ALL
    Select 4 as Sort,'Summary ( Order ) : ',sum(DocTotal), convert(varchar,  DATEADD(month, -1, GETDATE()),104)+' - '+convert(varchar,   GETDATE(),104) from ORDR where DocDate between  DATEADD(month, -1, GETDATE()) AND GETDATE()
    ORDER by Sort
    regards,
    Maik

  • ALV GRID with own EXCEL-Template

    Hallo,
    I have Problem with using ALV-Grid with a own created
    template.
    At First I copy the SAP_OM.XLS template to CUS_OM.XLS.
    Then I update it by deleting all sheets, but not RAWDATA.
    When I use this template in ALV-GRID, it would be the right one, but it his no Data.
    The security settings in Excel are correct.
    Can anyone help me to show the data like the normal
    ALV-GRID??
    thanks Dieter

    Hi
    Check this link...
    How to send data  to different tabs of an excel sheet?

  • ALV GRID with icon fields. When exports to Excel, icon fields are emtpy.

    Hi all,
    In our SAP system (6.0 ECC) we've noticed the following behaviour:
    In ALV GRID with icons (color lights for example...) when we export the list to Excel format with the standard button bat, the icon column is always empty.
    We think that in previous SAP version (4.7), the code corresponding to the icon appeared (For example @08@ for green light).
    It's possible to have tha same functionality in this new version like in 4.7?
    Regards.
    Edited by: Ole ES on Nov 17, 2010 6:05 PM

    Hi,
    Check the format in which you export to Excel (MHTML, XML, ...) and try antoher one.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/66/79ad48157f11d2953700a0c930328a/content.htm
    I think the integrated Excel mode shows '@08@'.
    Best regards,
    Guillaume

Maybe you are looking for

  • Login settings will not update the local testing server files

    When uploading to web server from local testing server, changing login settings in the control panel does not update the local testing server Restrict Access to page files. Causing login on website not to function. It does however update the Connecti

  • Unable to insert records in PRPS and PROJ tables.

    I want   to insert entries in PROJ and PRPS  tables with new company code. I am selecting entries  with existing company code and changing old co. code to new co. code in work area. Then I am using insert PRPS from work area in the same way inserting

  • Row and Column transpose question

    Dear Support , I would like to transpose one internal table , for example : Column : MATERIAL , QTY , DATE               MA1          ,  100  , 2009-01-01               MA2          ,  200  , 2009-01-01               MA3          ,  200  , 2009-03-02

  • Frontpanel freezes when an event of an already closed event structure occurs

    Hello, I´d be very glad if someone could explain to me the behaviour of the attached short and simple vi. If you press the OK button #1 once and then the OK button #2 the vi finishes, but if you press the first button more than once before pressing t

  • HT1420 were is the store menu to authorize computers

    WOW these menu's not user friendly were is store menu ?