Initializing a table view

Hi,
I am having a table view with some data populated in it.
I want to clear the data in the table view anad initialize it on click of a button. Can some one please help me in resolving this issue.
Thanks,
Ravi G

Hi Ravi,
In the controller, method DO_PREPARE_OUTPUT, just clear the collection and build the table:
data:
coll_wrapper        TYPE REF TO cl_bsp_wd_collection_wrapper.
if lv_event eq 'RESET'.
     coll_wrapper = typed_context->TV->get_collection_wrapper( ).
     coll_wrapper->clear_collection( ).
     typed_context->TV->build_table( ).
endif.
where TV is your tableview context node and lv_event a new attribute to store server event value (adjust method DO_HANDLE_EVENT)
Regards,
Fabian

Similar Messages

  • OBI crashing when creating a view on an analysis (initially created table view works fine)

    Wondering if anyone else has experienced this. It seems pretty wierd because the initial view gets created.
    This is what happens:
    I create a new analysis. Data source doesn't matter. I have tried Sample App Lite & 2 different Essbase cubes.
    Drop some columns on the criteria
    Click Results. It displays a table view. I can save it and view it etc.
    If I try to create a 2nd view of any type including another table the front-end will hang, displaying "Processing, please wait"
    Logging onto the server we will see that there is a windows dialog box stating "nqssserver.exe has stopped working. Windows can check online for a solution........"
    It eventually times out. I think nqsserver.exe restarts by itself. The view doesn't get created.
    OBI 11.1.1.7
    Any ideas?
    - Daniel

    Hi Daniel,
    We need to dive to much more granular level, to identify the cause for this kind of issue. Some analysis on the coredump (search for .dmp) produced by your windows OS using Windebug utility, running through console~obis1.log etc might have to be done to catch the culprit.
    Note: I do not remember exactly, but there is are configuration steps available in my oracle support, to enable core dump on windows boxes (at least for Dr Watson though!!). You might want to have a look.
    If you think there are any visible messages in the log, you could post here; I could help you read through them.
    Dhar

  • How to make a single row as editable in a table view?

    Hello Friends,
    As per the requirement,i have created a new table view with table row level actions. But I am able to achieve the delete functionality. But for edit action, if i lock the corresponding entity also it is not becoming as edit.
    Let me know any ideas to achieve this??
    Thanks in Advance.
    Regards,
    Ravi

    Hi Raviteja,
    In your row level buttons if you want to edit a row you have to fallow this steps..
    1) get the selected record by using index.
    2) get the action mean which action you want to perform ( edit or delete like).
    3) lock the current entity.
    4) get the custom or comp controller instance based on get the current record.
    5) edit the row..
    sample code for this..
    DATA:
         lv_index          TYPE int4,
         lr_current        TYPE REF TO if_bol_bo_property_access,
         lr_entity         TYPE REF TO cl_crm_bol_entity,
         lv_event          TYPE string,
         lv_dummy          TYPE string,
         lr_core           TYPE REF TO cl_crm_bol_core,
         lv_one_click_lock TYPE sysubrc,
         lr_col            TYPE REF TO if_bol_bo_col,
         lr_coco           TYPE REF TO component ctrl class name (impl class),
         lr_cuco           TYPE REF TO custom cntrl class name ( impl.)
       CALL METHOD cl_thtmlb_util=>get_event_info
         EXPORTING
           iv_event = htmlb_event_ex
         IMPORTING
           ev_index = lv_index.
       CHECK lv_index IS NOT INITIAL.
    * Get the current entity
       lr_entity ?= me->typed_context->urcnode->collection_wrapper->find( iv_index = lv_index ).
       CHECK lr_entity IS BOUND.
    * Get the action clicked on
       SPLIT htmlb_event_ex->event_defined AT '.' INTO lv_event lv_dummy.
    * Try to lock the current entity
       lv_one_click_lock = cl_crm_uiu_bt_tools=>set_one_click_lock( me->typed_context->cnode->collection_wrapper ).
       CASE lv_event.
    *   Edit the current Partner
         WHEN 'EDIT'.
           IF lv_one_click_lock <> 2 AND lr_entity->is_send_active( ) = abap_true.
             lr_coco ?= me->comp_controller.
             CHECK lr_coco IS BOUND.
             lr_current = lr_coco->typed_context->cnode->collection_wrapper->find( iv_bo = lr_entity ).
    *       if entity is not yet there: add it to component controller collection
             IF lr_current IS NOT BOUND .
               lr_coco->typed_context->cnode->collection_wrapper->add( lr_entity ).
               lr_current = lr_coco->typed_context->cnode->collection_wrapper->find( iv_bo = lr_entity ).
             ENDIF.
             CHECK lr_current IS BOUND.
             lr_cuco ?= me->get_custom_controller( 'compname/cnameCuCo' ). "#EC NOTEXT
             lr_cuco->typed_context->cnode->on_new_focus( lr_current ).
             me->set_editable( ).
           ENDIF.
    if this is not work then go through this link..
    OCA edit button problem
    Thanks & Regards,
    Srinivask

  • Problem in the Table view of VC model

    Hi all,
    We have a created a table view using the BI query as source.
    the table view has say 4 fields (Serial NO., Plant key, Material and Quantity) initially before submitting the parameters, once we enter some parameters and press submit button some extra fields are getting added at the end of the existing fields.
    i.e the final result is Serial NO., Plant key, Material and Quantity, Plant, Material, Quantity. last 3 fields are undesired.
    This is happening only when we select few fields in the define / Test Query setting (we are doing this to avoid unwanted fields while exporting data to excel).
    Is there a way to avoid this addition of extra fields in the table view.
    any help is highly appreciated.
    regards,
    Rk.

    Hi
    Are you getting these extra columns in 'Table' or while executing 'Define / Test Query'?
    If you are getting this in table then dont select anything while dragging the table from query. (When the systems ask to select the fields) Select the fields after creating the table & then see what is happening.
    Regards
    Sandeep

  • How to create variant for table/view ?

    Hi,
    When I go through SM30, I find a radio button called variant. I don't know the effect.
    Can anyone tell me how to create variant for table / view ?
    I want to know when we need to create variant for table/view.
    Best regards,
    Chris Gu

    hi ,
    Whenever you start a program in which selection screens are defined, the system displays a set of input fields for database-specific and program-specific selections. To select a certain set of data, you enter an appropriate range of values.
    For further information about selection screens, refer to Selection Screens in the ABAP User's Guide.
    If you often run the same program with the same set of selections (for example, to create a monthly statistical report), you can save the values in a selection set called a variant
    Procedure
    To create a new variant:
           1.      On the ABAP Editor initial screen, enter the name of the program for which you want to create a variant, select Variants, and choose Change.
           2.      On the variant maintenance initial screen, enter the name of the variant to be created.
    Note the naming convention for variants (see below).
           3.      Choose Create.
    If the program has more than one selection screen, a dialog box for screen assignment appears. The dialog box does not appear if the program only has one selection screen. The selection screen appears in this case.
           4.      If there is more than one selection screen, select the screens for which you want to create the variant
    5.      Choose Continue.
    The (first) selection screen for the report appears.
    If your program has more than one selection screen, use the scroll buttons in the left-hand corner of the application toolbar to navigate between them and to fill the fields with values. If you keep scrolling forwards, the Continue button appears on the last selection screen.
           6.      Enter the desired selection values, including multiple selection and dynamic selection.
           7.      Choose Continue.

  • To determine the number of rows selected in a table view (BSP)

    Hi,
    My requirement is:
    I would be selecting 1 row from a table view ( which is made multiselect for another requirement) , and press a button.
    The functionality of button is to open a popup window based on the row selected.
    I want to display an error message if more than 1 row is selected, and button is clicked.
    Message will say that "you cannot select more than 1 row".
    For this,  I need to know how I can get the number of selected rows in a table view.
    I tried using the below code.
    But I feel this will work only in DO_HANDLE_DATA method.
    The popup would open, even before control comes in this method.
      CALL METHOD cl_hrrcf_iterator=>get_tv_index
        EXPORTING
          p_id               = p_tableview_id
          pt_form_fields = table_form_fields
        IMPORTING
          pt_indices      = sel_row_index_tab.
    Could you please provide me with a solution.
    Quick replies will be highly appreciated.
    Thanks,
    Nisha Vengal.

    Hi ,
    Your TV :
    <htmlb:tableView id              = "tv1l"
                                   design          = "alternating"
                                   visibleRowCount = "10"
                                   fillUpEmptyRows = "true"
                               onRowSelection  = "MyEventRowSelection" <----This is the event you have to use
                                   selectionMode   = "MULTILINEEDIT"
                                  filter          = "SERVER"
                                   table           = "<%= some table %>" >
    in DO_REQUEST:
    DATA:  tv                  TYPE REF TO cl_htmlb_tableview,
           tv_event          TYPE REF TO cl_htmlb_event_tableview ,
           event             TYPE REF TO if_htmlb_data.
    event = cl_htmlb_manager=>get_event( request ).
    IF event IS NOT INITIAL AND event->event_name = htmlb_events=>tableview.
      tv_event ?= event.
      CASE event->event_server_name.
        WHEN 'MyEventRowSelection'.
    count = count + 1 .
    if count ne 1 .
    errmsg = 'Your message'.
    endif.
    ENDCASE.
    ENDIF.
    in View/Layout:
    <% if errmsg is not initial. %>
    <s cript t y p e   =   t e x t / j a v a s c r i p t >
    a l e r t ("<%= errmsg %>") .
    </ s c r i p t>
    <% clear errmsg. %>
    <% endif. %>
    errmsg is a class attribute of type string and count is also a class attribute of type c .
    Regards,
    Anubhav.
    Reward if useful
    Edited by: Anubhav Jain on Sep 19, 2008 3:08 PM

  • Button is not coming in the first row of a table view

    Hi,
    I am having an assignment block in which i have added a button in DO_PREPARE_OUTPUT method. It is displaying in the second line in the header of the table view and the first line shows the excel and personalization buttons. I want all these buttons to display on the same line in the assignment block.
    the .html code is below
       <%@page language="abap" %>
    <%@extension name="thtmlb" prefix="thtmlb" %>
    <%@extension name="chtmlb" prefix="chtmlb" %>
    <%@extension name="bsp" prefix="bsp" %>
    <%@extension name="tajax" prefix="tajax" %>
    <%
      data: lv_xml          type string value is initial.
      DATA: lv_displayMode  TYPE crmt_boolean.
      lv_xml    = controller->CONFIGURATION_DESCR->GET_CONFIG_DATA( ).
      lv_displayMode = controller->view_group_context->is_view_in_display_mode( controller ).
    %>
    <%
      IF lv_displayMode eq abap_true.
    %>
    <%--<chtmlb:tableExtension tableId = "ResultList"
                           layout  = "FIXED" >--%>
    <chtmlb:configTable id                    = "Table"
                        navigationMode        = "BYPAGE"
                        onRowSelection        = "select"
                        selectedRowIndex      = "<%= ADMINS->SELECTED_INDEX %>"
                        selectedRowIndexTable = "<%= ADMINS->SELECTION_TAB %>"
                        selectionMode         = "<%= ADMINS->SELECTION_MODE %>"
                        table                 = "//ADMINS/Table"
                        usage                 = "ASSIGNMENTBLOCK"
                        visibleRowCount       = "6"
    <%--                    actions          = "<%= controller->gt_button %>"--%>
    <%--                    actionsMaxInRow       = "6"--%>
                        width                 = "100%"
    <%--                    headerVisible         = "TRUE"--%>
                        hasLeadSelection      = "X"
                        personalizable        = "FALSE"
                        downloadToExcel       = "FALSE"
                        showNoMatchText       = "FALSE"
                         />
    <%--</chtmlb:tableExtension>                     --%>
    <%
      ELSE .
    %>
    <chtmlb:tableExtension tableId = "Table"
                           layout  = "FIXED" >
    <chtmlb:configTable id               = "Table"
                        displayMode      = "<%= lv_displayMode %>"
                        navigationMode   = "BYPAGE"
                        onRowSelection   = "select"
                        selectedRowIndex = "<%= ADMINS->selected_index %>"
                        table            = "//ADMINS/Table"
                        usage            = "ASSIGNMENTBLOCK"
                        visibleRowCount  = "6"
                        selectionMode    = "<%= ADMINS->SELECTION_MODE %>"
                        allRowsEditable  = "TRUE"
                        personalizable   = "FALSE"
                        downloadToExcel  = "FALSE"
                        headerVisible    = "TRUE"
                        hasLeadSelection = "X"
                        visibleFirstRow       = "<%= ADMINS->visible_first_row_index %>"
                        actions          = "<%= controller->gt_button %>"
    <%--                actionsMaxInRow       = "6"--%>
                        width            = "100%" />
    </chtmlb:tableExtension>
    <%
      ENDIF .
    %>
    Could you please let me know where i went wrong.

    In your code
    if(rs.next()){
      depflights = new ArrayList();
       while(rs.next()){ ...when you call rs.next() in the if statement, the resultset cursor has been placed on the first record and you are not reading it. So, you never get the first record.
    Change your code to remove that if condition and simply initialize the ArrayList.

  • SWI5 transaction - is there a table view ?

    Hi
    I am trying to pull a report of outstanding approval inbox items (TS1230097 - for leave requests) that I see when I go to tcode SWI5 for managers. If I run a report it does not give me the manager id in it which I need.
    Is there a table view for SWI5 information possibly or can anyone suggest another transaction that can be used to see the current manager associated with outstanding leave request items (when I use various SWI* or PTARQ reports they do not show me the current manager in situations in which leave request items have been forwarded to new managers and so are unreliable. I'm just wondering if there's any other report/transaction I can use therefore.
    Thanks for your help
    Nicola

    Hi,
    Nicola paste this code in se38 and execute it.
    TYPE-POOLS : slis.
    TABLES : swwuserwi,swwwihead,bseg,bkpf.
      TYPE DECLARATION   *************************************
    TYPES : BEGIN OF TY_SWWUSERWI,
            USER_ID      TYPE SWWUSERWI-USER_ID,
            WI_ID        TYPE SWWUSERWI-WI_ID,
            TASK_OBJ     TYPE SWWUSERWI-TASK_OBJ,
            END OF TY_SWWUSERWI.
    TYPES : BEGIN OF TY_SWWWIHEAD,
            WI_ID        TYPE SWWWIHEAD-WI_ID,
            WI_LANG      TYPE SWWWIHEAD-WI_LANG,
            WI_TEXT      TYPE SWWWIHEAD-WI_TEXT,
            WI_RHTEXT    TYPE SWWWIHEAD-WI_RHTEXT,
            WI_STAT      TYPE SWWWIHEAD-WI_STAT,
           WI_CD        TYPE SWWWIHEAD-WI_CD,
           WI_CT        TYPE SWWWIHEAD-WI_CT,
            END OF TY_SWWWIHEAD.
    TYPES : BEGIN OF TY_TEMP,
            BUKRS TYPE BUKRS,
            BELNR TYPE BELNR_D,
            GJAHR TYPE GJAHR,
            END OF TY_TEMP.
    TYPES : BEGIN OF TY_BSEG,
            BUKRS TYPE BSEG-BUKRS,
            BELNR TYPE BSEG-BELNR,
            GJAHR TYPE BSEG-GJAHR,
            WRBTR TYPE BSEG-WRBTR,
            LIFNR TYPE BSEG-LIFNR,
            ZUONR TYPE CHAR10,
            END OF TY_BSEG.
    TYPES : BEGIN OF TY_CEPC,
            PRCTR TYPE CEPC-PRCTR,
            ABTEI TYPE CEPC-ABTEI,
            END OF TY_CEPC.
    TYPES : BEGIN OF TY_BKPF,
            BUKRS TYPE BKPF-BUKRS,
            BELNR TYPE BKPF-BELNR,
            GJAHR TYPE BKPF-GJAHR,
            BLDAT TYPE BKPF-BLDAT,
            BUDAT TYPE BKPF-BUDAT,
            XBLNR TYPE BKPF-XBLNR,
            END OF TY_BKPF.
    TYPES : BEGIN OF TY_LFA1,
            LIFNR TYPE LFA1-LIFNR,
            NAME1 TYPE LFA1-NAME1,
            END OF TY_LFA1.
    TYPES : BEGIN OF TY_FINAL,
            USER_ID     TYPE SWWUSERWI-USER_ID,
            WI_ID        TYPE SWWUSERWI-WI_ID,
            BUKRS       TYPE BSEG-BUKRS,
           WI_TEXT     TYPE SWWWIHEAD-WI_TEXT,
            WRBTR       TYPE BSEG-WRBTR,
            BELNR       TYPE BELNR_D,
            LIFNR       TYPE LFA1-LIFNR,
            NAME1       TYPE LFA1-NAME1,
            BLDAT       TYPE BKPF-BLDAT,
            XBLNR       TYPE BKPF-XBLNR,
            GJAHR       TYPE GJAHR,
            ABTEI       TYPE CEPC-ABTEI,
            BUDAT       TYPE BKPF-BUDAT,
            END OF TY_FINAL.
      DATA TYPE DECLARATION   *************************************
    DATA : it_swwuserwi TYPE STANDARD TABLE OF ty_swwuserwi,
           it_swwwihead TYPE STANDARD TABLE OF ty_swwwihead,
           it_final TYPE STANDARD TABLE OF ty_final,
           it_temp TYPE STANDARD TABLE OF ty_temp,
           it_bseg TYPE STANDARD TABLE OF ty_bseg,
           it_cepc TYPE STANDARD TABLE OF ty_cepc,
           it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
           it_lfa1 TYPE STANDARD TABLE OF ty_lfa1,
           wa_swwuserwi TYPE ty_swwuserwi,
           wa_swwwihead TYPE ty_swwwihead,
           wa_final TYPE ty_final,
           wa_bseg TYPE ty_bseg,
           wa_cepc TYPE ty_cepc,
           wa_bkpf TYPE ty_bkpf,
           wa_lfa1 TYPE ty_lfa1,
           wa_temp TYPE ty_temp.
    DATA: wa_sort TYPE LINE OF slis_t_sortinfo_alv,
          it_sort TYPE slis_t_sortinfo_alv.
    DATA: it_field_cat TYPE slis_t_fieldcat_alv,
          ws_sort TYPE slis_t_sortinfo_alv,
          g_variant TYPE disvariant,
          ws_layout TYPE slis_layout_alv."slis_t_fieldcat_alv.
    DATA: IT_EVT_TAB         TYPE SLIS_T_EVENT,
          IS_LS_EVENT        TYPE SLIS_ALV_EVENT.
    DATA: C_TOP            TYPE SLIS_FORMNAME          VALUE 'TOP_OF_PAGE',
          IS_EVT             TYPE SLIS_ALV_EVENT     .
    DATA: REC_LAYOUT         TYPE SLIS_LAYOUT_ALV.
    *rec_layout TYPE lvc_s_layo.
    DATA: IS_LS_LINE         TYPE SLIS_LISTHEADER,
          IT_TOP             TYPE SLIS_T_LISTHEADER.
    DATA: TEXT(60) TYPE C,
          text1 TYPE char10,
          text2 TYPE char20,
          text3 TYPE char20,
          ebeln TYPE char10,
          year  TYPE char4.
    DATA: user TYPE SY-uname.
    DATA: lang  TYPE sww_lang VALUE 'EN',
          c_x TYPE char1 VALUE 'X',
          C_FLAG TYPE CHAR1 VALUE IS INITIAL,
               status1 TYPE sww_wistat VALUE 'READY',
          status2 TYPE sww_wistat VALUE 'STARTED'.
      INPUT OPTIONS   ***********************************************
    INITIALIZATION.
    DATA: C_PF_STAT        TYPE SLIS_FORMNAME          VALUE 'PF_STAT',
          C_USERC          TYPE SLIS_FORMNAME          VALUE 'PURVESH',
          C_TOP_OF_PAGE    TYPE SLIS_FORMNAME          VALUE 'TOP_OF_PAGE'.
      SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
      PARAMETERS     : USERID LIKE USREFUS-BNAME MODIF ID 001.
      SELECT-OPTIONS : COMP   FOR BSEG-BUKRS NO INTERVALS.
      SELECT-OPTIONS : YEAR1  FOR BSEG-GJAHR NO INTERVALS.
      SELECT-OPTIONS : DOC    FOR BSEG-BELNR.
      SELECT-OPTIONS : VEND   FOR BSEG-LIFNR NO INTERVALS.
      SELECT-OPTIONS : DAT    FOR BKPF-BUDAT.
      SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR userid.
      PERFORM f4_help_fname.
    *&      Form  F4_HELP_FNAME
          text
    -->  p1        text
    <--  p2        text
    FORM F4_HELP_FNAME .
    data: begin of itab occurs 0,
    BNAME like USREFUS-BNAME,
    USERALIAS like USREFUS-USERALIAS,
    end of itab .
    select BNAME
    USERALIAS
    from USREFUS into corresponding fields of table itab.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    retfield = 'BNAME'
    dynpprog = SY-repid
    dynpnr = SY-dynnr
    dynprofield = 'USERID'
    value_org = 'S'
    TABLES
    value_tab = ITAB.
    *IF sy-subrc 0.
    *ENDIF.
    ENDFORM.                    " F4_HELP_FNAME
    **********************************************START - OF - SELECTION*******************************************
    START-OF-SELECTION.
      PERFORM init.
      PERFORM buildfieldcat.
      PERFORM displayalv.
    END-OF-SELECTION.
    *&      Form  INIT
          text
    -->  p1        text
    <--  p2        text
    FORM INIT .
      IF USERID IS NOT INITIAL.
        SELECT USER_ID
                 WI_ID
                 TASK_OBJ
                 INTO TABLE IT_SWWUSERWI
                 FROM SWWUSERWI
                 WHERE USER_ID = USERID AND NO_SEL NE c_x.
    endif.
      IF IT_SWWUSERWI IS NOT INITIAL.
        SELECT WI_ID
               WI_LANG
               WI_TEXT
               WI_RHTEXT
               WI_STAT
              WI_CD
              WI_CT
               INTO TABLE IT_SWWWIHEAD
               FROM SWWWIHEAD
               FOR ALL ENTRIES IN IT_SWWUSERWI
               WHERE WI_ID = IT_SWWUSERWI-WI_ID AND WI_LANG = lang.
        IF IT_SWWWIHEAD IS NOT INITIAL.
          LOOP AT IT_SWWWIHEAD INTO WA_SWWWIHEAD.
            SPLIT WA_SWWWIHEAD-WI_TEXT AT SPACE INTO TEXT TEXT1 TEXT2.
            WA_TEMP-BUKRS = TEXT2+0(4).
            WA_TEMP-BELNR = TEXT2+4(10).
            WA_TEMP-GJAHR = TEXT2+14(4).
            APPEND WA_TEMP TO IT_TEMP.
            CLEAR : WA_TEMP.
          ENDLOOP.
            LOOP AT IT_SWWUSERWI INTO WA_SWWUSERWI.
              READ TABLE IT_SWWWIHEAD INTO WA_SWWWIHEAD WITH KEY  WI_ID = WA_SWWUSERWI-WI_ID WI_LANG = lang.
                  WA_FINAL-USER_ID      = WA_SWWUSERWI-USER_ID.
                  WA_FINAL-WI_ID        = WA_SWWUSERWI-WI_ID.
             WA_FINAL-WI_TEXT      = WA_SWWWIHEAD-WI_TEXT.
                  APPEND WA_FINAL TO IT_FINAL.
                  CLEAR : WA_FINAL,WA_SWWWIHEAD,WA_SWWUSERWI,WA_TEMP,WA_BSEG,WA_BKPF,WA_LFA1,WA_CEPC.
                ENDIF.
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
        DELETE ADJACENT DUPLICATES FROM it_final.
      ENDIF.
    ENDFORM.                    " INIT
    *&      Form  DISPLAYALV
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAYALV .
      REC_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      REC_LAYOUT-ZEBRA             = 'X'.
      REC_LAYOUT-F2CODE            = SY-REPID.
      REC_LAYOUT-WINDOW_TITLEBAR   = 'Workitem summery'.        "#EC NOTEXT
      REC_LAYOUT-COLTAB_FIELDNAME  = 'COLOR'.
      REC_LAYOUT-DETAIL_TITLEBAR   = 'Workitem Summery'.        "#EC NOTEXT
    WS_LAYOUT-ColWIDTH_OPTimize = 'X'.
    WS_LAYOUT-ZEBRA             = 'X'.
      wa_sort-tabname = 'IT_FINAL'.
      wa_sort-fieldname = 'USER_ID'.
    wa_sort-spos = 9.
    wa_sort-subtot = 'X'.
      APPEND wa_sort to it_sort.
      CLEAR wa_sort.
       PERFORM GET_EVT_UP.
    PERFORM alv_text.
    PERFORM top_of_page.
    *rec_layout-grid_title   = 'Report for WI Analysis'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-repid
         i_callback_pf_status_set = c_pf_stat
          I_CALLBACK_USER_COMMAND  = C_USERC
         I_CALLBACK_TOP_OF_PAGE   = C_TOP_OF_PAGE
          i_grid_title             = text-024
          is_layout                = rec_layout
          it_fieldcat              = it_field_cat
          it_sort                  = it_sort
          I_DEFAULT                = 'X'  "allow default variant
          i_save                   = 'A'
          is_variant               = g_variant
         IT_EVENTS                = IT_EVT_TAB
        TABLES
          t_outtab                 = it_final
        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.                    " DISPLAYALV
    *&      Form  build_catalog
          text
         -->P_TABNAME    text
         -->P_FIELDNAME  text
         -->P_DO_SUM     text
         -->P_SELTEXT    text
         -->P_X          text
         -->P_Y          text
    FORM build_catalog  USING  p_tabname   TYPE slis_fieldcat_alv-tabname
                               p_fieldname TYPE slis_fieldcat_alv-fieldname
                               p_do_sum     TYPE slis_fieldcat_alv-do_sum
                               p_seltext   TYPE slis_fieldcat_alv-seltext_l
                               p_x         TYPE c
                               p_y         TYPE c.
      DATA : wa_fieldcat TYPE slis_fieldcat_alv,
             pos TYPE i VALUE 0.
      pos = pos + 1.
      wa_fieldcat-col_pos     = pos.
      wa_fieldcat-tabname     = p_tabname.
      wa_fieldcat-fieldname   = p_fieldname.
      wa_fieldcat-do_sum      = p_do_sum .
      wa_fieldcat-seltext_l   = p_seltext.
      wa_fieldcat-HOTSPOT      = p_x.
      wa_fieldcat-fix_column  = p_y.
      APPEND wa_fieldcat TO it_field_cat .
      CLEAR wa_fieldcat.
    ENDFORM.                    "build_catalog
    *&      Form  PURVESH
          text
         -->L_UCOMM    text
         -->W_SELFIELD text
    FORM PURVESH USING L_UCOMM  TYPE SY-UCOMM   W_SELFIELD  TYPE SLIS_SELFIELD ."#EC CALLED
    BREAK AAB_PURVESH.
      CASE L_UCOMM.
        IF  USERID IS NOT INITIAL.
          user = userid.
        ELSE.
          user = sy-uname.
        ENDIF.
        WHEN '&IC1' or 'ZWORK_LOAD'.
          READ TABLE IT_FINAL INTO WA_FINAL INDEX W_SELFIELD-TABINDEX.
          IF SY-SUBRC = 0.
            IF user NE SY-UNAME.
              CALL FUNCTION 'SAP_WAPI_FORWARD_WORKITEM'
              EXPORTING
                WORKITEM_ID  = WA_FINAL-WI_ID
                USER_ID      = SY-UNAME
                LANGUAGE     = SY-LANGU
                DO_COMMIT    = 'X'
                CURRENT_USER = user.
              IMPORTING
                RETURN_CODE          =
                NEW_STATUS           =
              TABLES
                MESSAGE_LINES        =
                MESSAGE_STRUCT       =
                USER_IDS             =
            ENDIF.
            CALL FUNCTION 'SAP_WAPI_EXECUTE_WORKITEM'
              EXPORTING
                WORKITEM_ID          =  WA_FINAL-WI_ID
                LANGUAGE             = SY-LANGU
              IMPORTING
                NEW_STATUS           =
                RETURN_CODE          =
              TABLES
                MESSAGE_LINES        =
                MESSAGE_STRUCT       =
           DELETE IT_FINAL WHERE WI_ID = WA_FINAL-WI_ID.
           PERFORM displayalv.
          ENDIF.
      ENDCASE.
    ENDFORM.                    "PURVESH
    *&      Form  GET_EVT_UP
          text
    -->  p1        text
    <--  p2        text
    FORM GET_EVT_UP .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          I_LIST_TYPE     = 0
        IMPORTING
          ET_EVENTS       = IT_EVT_TAB
        EXCEPTIONS
          LIST_TYPE_WRONG = 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.
      ELSE.
        SORT IT_EVT_TAB   BY NAME.
        READ TABLE IT_EVT_TAB WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO IS_LS_EVENT BINARY SEARCH.
        IF SY-SUBRC = 0.
          MOVE C_TOP TO IS_LS_EVENT-FORM.
          MODIFY IT_EVT_TAB FROM IS_LS_EVENT INDEX SY-TABIX TRANSPORTING FORM.
        ENDIF.
        READ TABLE IT_EVT_TAB  INTO IS_EVT WITH KEY NAME = SLIS_EV_USER_COMMAND BINARY SEARCH.
        IF SY-SUBRC EQ 0.
          IS_EVT-FORM = 'PURVESH'.
          MODIFY IT_EVT_TAB  FROM IS_EVT TRANSPORTING FORM WHERE NAME = IS_EVT-NAME.
        ENDIF.
      ENDIF.
    ENDFORM.                    " GET_EVT_UP
    *&      Form  ALV_TEXT
          text
    -->  p1        text
    <--  p2        text
    FORM ALV_TEXT .
      CLEAR IS_LS_LINE.
      IS_LS_LINE-TYP = 'H'.
      IS_LS_LINE-INFO = 'Workload Analysis Report'.             "#EC NOTEXT
      APPEND IS_LS_LINE TO IT_TOP.
      WRITE: 'RunDate:' TO TEXT,
             SY-DATUM TO TEXT+10,
             ', Time :' TO TEXT+20,                             "#EC NOTEXT
             SY-UZEIT TO TEXT+27,
             ', User :' TO TEXT+38,                             "#EC NOTEXT
             SY-UNAME TO TEXT+46.
      IS_LS_LINE-TYP = 'S'.
      IS_LS_LINE-INFO = TEXT.
      APPEND IS_LS_LINE TO IT_TOP.
      CLEAR TEXT.
    ENDFORM.                    " ALV_TEXT
    *&      Form  TOP_OF_PAGE
          text
    -->  p1        text
    <--  p2        text
    FORM TOP_OF_PAGE .
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_TOP.
    using this code specify only buildfieldcatalog and there is a custom inbox ready for you
    here you can specify userid and from alv report you can execute workitem of any user.
    Hope magic Works!
    Regards,
    Purvesh.

  • Reg Issues in table View

    Hi Experts,
       I have few questations in tableView(not using MVC). I am using simple forms with flologic and iterators.
    1. In table View I have around 12 to 15 columns and occuping fill screen with scroll bars.

    Hi Ray,
    For your second question
    In one of my tableview I have a DDLB in a column,based on value selected in this DDLB , the next two columns that are inputfields are enabled and disabled.
    The code in render cell start is:
    when 'ZZREQUIRED'. <--DDLB
            if p_edit_mode is not initial.
              data: required type ref to cl_htmlb_dropdownlistbox.
              required = cl_htmlb_dropdownlistbox=>factory( id = p_cell_id
                                                         table = m_required_ref
                                                      selection = m_row_ref->zzrequired
                                                      ons elect = 'required'
                                                      nameofkeycolumn = 'NAME'
                                                      nameofvaluecolumn = 'VALUE' ).
              p_replacement_bee = required .
              reqtype = required->selection .<--Read the value selected in DDLB
            endif.
    when 'ZZENDDA'. <--Inputfield baesd on selection in DDLB
    data: obj_fr_zzendda type ref to cl_bsp_find_and_replace,
                  obj_zzendda type ref to cl_htmlb_inputfield,
                  obj_bee_zzendda  type ref to cl_bsp_bee_table.
    if p_edit_mode is not initial.
    if reqtype = 'FROM' or reqtype = 'ON'.
                clear : find , replace .
                concatenate '<input on Cha nge=isitToday(this.value,"' p_cell_id '");' into replace .
                find = '<input' .
                replace = replace.
                obj_fr_zzendda = cl_bsp_find_and_replace=>factory( find = find
                                                                    replace = replace
                                                                    mode =  `FIRST_OCCURRENCE` ).
                obj_zzendda = cl_htmlb_inputfield=>factory( id = p_cell_id type = 'date' showhelp = ' ' disabled = 'true' ).
                obj_zzendda->value = m_row_ref->zzendda.
                create object obj_bee_zzendda.
                obj_bee_zzendda->add( level = 1 element = obj_fr_zzendda ).
                obj_bee_zzendda->add( level = 2 element = obj_zzendda ).
                p_replacement_bee = obj_bee_zzendda.
              endif.
              clear reqtype.
            endif.
    Where reqtype is defined in attributes as Instance Public String
    Similarly you can read the value of one column in your tableview and enable or disable all other fields in that row depending on its value.
    Regards,
    Anubhav

  • Cell Binding/Table View Iterator

    Hi Friends,
    I am getting error while editing the particular cell of column table view. when I enter the changes, they are not updating in the cell.I used the following code.
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS .
    APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
    <def>-COLUMNNAME = 'RELDATE'. <def>-EDIT = 'X'.
    method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_ROW_START .
    m_row_ref ?= p_row_data_ref.
    endmethod.
    method
    IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START .
    CASE p_column_key.
    WHEN 'RELDATE'.
    IF p_edit_mode IS NOT INITIAL.
      DATA: Rdate TYPE STRING.
      Rdate = m_row_ref->RELDATE.
      p_replacement_bee = CL_HTMLB_INPUTFIELD=>FACTORY(
                              id        = p_cell_id
                              value     = Rdate
                               type      = 'DATE'
                               VALUE = PCELL_BINDING
                                showHelp  = 'TRUE'
                                encode = 'TRUE').
    I am bit confused abt MVC.Please mail me the exact code changes to be done in MVC-Class controller.
    Regards
    CSM Reddy

    Pls check the code, & mail me back in case of any errors.
    method DO_HANDLE_EVENT .
    DATA: itabtype  type standard table of stdview1.
    DATA: tv TYPE REF TO cl_htmlb_tableview.
      tv ?= cl_htmlb_manager=>get_data(
                              request      = runtime->server->request
                              name         = 'tableView'
                              id         = 'stdview1' ).
      IF tv IS NOT INITIAL.
        DATA: tv_data TYPE REF TO cl_htmlb_event_tableview.
        tv_data = tv->data.
        IF tv_data->prevselectedrowindex IS NOT INITIAL.
          FIELD-SYMBOLS: <row> like LINE OF ITABTYPE .
         READ TABLE ITABTYPE INDEX tv_data->prevselectedrowindex
         ASSIGNING <row>.
          DATA value TYPE string.
          value = tv_data->get_cell_id( row_index    =
                       tv_data->prevselectedrowindex
                                         column_index = '6' ).
          DATA: inputfield TYPE REF TO cl_htmlb_inputfield.
          inputfield ?= cl_htmlb_manager=>get_data(
                              request      = request
                              name         = 'DESCRIPTION'
                              id           = value ).
    <row>-DESCRIPTION = inputfield->value.
    ENDIF.
    ENDIF.
    Regards
    CSM Reddy

  • Open a new mail item in Lotus notes with all names from table view..

    HI
    the requirement is like this .. There is a table view with checkboxes..
    Now user will select the particular checkboxes and one mail should be created in Lotus Notes with all the user ids selected.
    How do i achieve
    1) Selecttion of either all ( Select ALl/deselect all ) or some users funtionality in table view
    2) Opening a new mail item with all users selected.

    Hi Raja
    The problem is this
    I have 2 buttons mail to Selected  and mail to all .
              <htmlb:button id            = "b_mailtosel"
                            text          = "Mail to Selected"
                            onClick = "onInputProcessing(b_mailtosel)" />
              <htmlb:button id            = "b_mailtoall"
                            text          = "Mail to all"
                            onClick = "onInputProcessing(b_mailtoall)" />
    Table view below is having this value..
    <htmlb:tableView id             = "tab1_list"
                          table          = "<%= i_list %>"
                           footerVisible  = "false"
                           selectionMode = "MULTISELECT"
                           design          = "ALTERNATING"
                           emptyTableText = "No data available"
                           width          = "100%"
                            >
    OninPut processing
    WHEN 'b_mailtosel'.
          application->s_flag = '1'.
          l_tv ?= cl_htmlb_manager=>get_data( request = request
                                               name    = 'tableView'
                                               id      = 'tab1_list' ).
          IF NOT l_tv IS INITIAL.
            table_event = l_tv->data.
            IF NOT table_event->PREVSELECTEDROWINDEXTABLE IS INITIAL.
            i_selected_mail = table_event->PREVSELECTEDROWKEYTABLE.
            ENDIF.
          ENDIF.
    table_event->PREVSELECTEDROWKEYTABLE is blank since there is no key column defined in the Tableview  ( since this combination doesnt work with select all ) .
        WHEN 'b_mailtoall'.
        cl_htmlb_manager=>check_tableview_all_rows(
          rowcount = rowcount
          request = request
          id = 'tab1_list'
          check = 'X'
          application->s_flag = '1'.
          l_tv1 ?= cl_htmlb_manager=>get_data( request = request
                                               name    = 'tableView'
                                               id      = 'tab1_list' ).
          IF NOT l_tv1 IS INITIAL.
            table_event1 = l_tv1->data.
            IF NOT table_event1->PREVSELECTEDROWINDEXTABLE IS INITIAL.
            i_selected_mail = table_event1->PREVSELECTEDROWKEYTABLE.
            ENDIF.
          ENDIF.
    NO DATA is coming in Select all too..
    HOw do i frame my code to atleast get the values...

  • ALV pop-up via ALV table view

    Hello Folks,
    I have an ALV table view, after selecting any line item in the view i have button "DETAIL" which would pop up another view with the details in ALV view again.
    I have done the below steps but iam unable to get the alv pop-up with details. I would really appreciate if anyone can help me with this.
    My main view <i>V_OVERVIEW</i> is the initial Table view and i have created another View <i>V_POPUP</i> which just has a Viewcontainer. <i>V_OVERVIEW</i> is embeded in window <i>W_MAIN</i> and <i>V_POPUP</i> is embeded in <i>W_POPUP</i>.
    The view V_POPUP has the following code in its MODIFYVIEW method.
    DATA:node_wage TYPE REF TO if_wd_context_node,
           node_detail type ref to if_wd_context_node,
           lt_sltd_elmnts TYPE wdr_context_element_set,
           lr_element TYPE REF TO if_wd_context_element,
           wa_detail TYPE if_v_pop_up=>element_wage_benefit,
           it_detail TYPE if_v_pop_up=>elements_wage_benefit.
      data : lt_ssn type table of ZUT_XFERRED_SSN,
             lt_return type table of bapiret2.
      node_wage = wd_context->get_child_node( 'WAGE_BENEFIT' ).
      lt_sltd_elmnts = node_wage->get_selected_elements( abap_true ).
      lr_element->get_static_attributes(
        IMPORTING static_attributes = wa_detail ).
      CALL FUNCTION 'ZZ_GET_DETAIL'
        EXPORTING
          i_ob_key = objectkey
          i_quarter  = -quarter
        TABLES
          T_DTL  = lt_dtl
          T_RETURN   = lt_return.
      navigate from <CONTEXT> to <TP_RATES> via lead selection
      node_detail = wd_context->get_child_node( name =
                       ig_componentcontroller=>wdctx_ssn_details ).
      node_detail->bind_elements( new_items = lt_dtl ).
    The main View V_OVERVIEW has the button "DETAIL" which calls the window W_POPUP to show view V_POPUP embeded in it as a popup, here is the code in the Button handler
    DATA:
        l_api_main TYPE REF TO if_wd_view_controller,
        l_window_manager TYPE REF TO if_wd_window_manager,
        l_popup TYPE REF TO if_wd_window,
        l_cmp_api TYPE REF TO if_wd_component.
    * Pop to confirm
      CLEAR : l_api_main, l_cmp_api,
              l_window_manager, l_popup.
      l_api_main = wd_this->wd_get_api( ).
      l_cmp_api = wd_comp_controller->wd_get_api( ).
      l_window_manager = l_cmp_api->get_window_manager( ).
      l_popup = l_window_manager->CREATE_WINDOW(
      WINDOW_NAME = 'W_POP_UP'
      TITLE = 'Details' ).
      l_popup->open( ).

    hey folks nevermind i got it.
    Thanks

  • Problem with maintain table views SM30 Transaction

    Hello All,
    i have a problem with the table maintenance view SM30, it doesn't permit me to modify the rows in the table.
    we have added a field into the table and when i tried to change the table view from menu: Utilities ==> table maintenance generator==> change the system propose me a message that the screen 0001 will be deleted and recreated...but the system has deleted the screen and doesn't recreate it...in somewehere on internet we find that we should use the transaction SE55 menu:
    Environment==> modification ==> Maintenance screen ==> button Layout which open the tool Screen Painter and from that we have created our screen with 4 fields of our table...our result that the screen is created and i can see it from the SM30 transaction but i can't insert rows in the table...when i try to go to maintain table: menu: Utilities ==> Table maintenance generator to try if i can modify something the system give me a message: "set the compare flag dialog ZIV_DP_PLCHAR_LA"
    the ZIV_DP_PLCHAR_LA is the name of my table...
    can you give me some advices please how should i do to fix this problem to insert rows in table throughout the transaction
    SM30 "maintain table views: initial screen"
    if i want to delete the screen from the SE55 transaction to recreate it newly what should i do to take care about some options
    to have a new screen?
    thanks for all
    Bilal

    Hi
    First delete the old table maintainence generator.
    Now Recreate the screen and your table is good to go..
    These error messages come when we add new fields and different version of the table maintainence generator in database.

  • Calling a Breadcrumb image inside a Table view column

    Hi
    I want a sample code to call any bread crumb related image inside a table view column.
    Please help with a code snippet.

    I mean that, inside the iterator class of the tableView, write this code in the RENDER_CELL_START method.
    method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
      CASE p_column_key.
        WHEN 'ICON'.
    p_replacement_bee = CL_HTMLB_IMAGE=>FACTORY(       id        = p_cell_id                              src      = '@3J@'  ).
        ENDCASE.
    Inside the method, GET_COLUMN_DEFINITIONS you need to append a column for icon, see the code below:
    APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
        <def>-COLUMNNAME = 'ICON'.
        <def>-TITLE      = 'Display Icon'.
    For more info you can refer to weblog on HTMLB TableView Iterator by Brian.
    Hope I am clear.
    Regards,
    Ravikiran.C

  • Check box in tabel view?when to use itereator and when to use table view

    hi,
    I want to have a check box along with the other 7fields  in the table view.
    when the checkbox is checked and the merge complete push button is clicked, the respective code for merge is to be executed.
    how can I do this?
    could anyone tell me hw to get a check boz in table view
    when to use a  iterator in BSP, how table view n iterator in comparision ae used or function/work.
    Regards,
    Pavan P.

    Hi Pavan,
    Table View is an BSP element used to display mass data in a layout similar to a table (table view).
    <b>Iterator</b>is an attribute to modify rendering row-by-row, and make it dependent on the clicked row. In this way, you define an action from a particular line. This action is defined in columnDefinitions or overWriteDefinitions.
    <htmlb:tableView id = "tvX"
                     headerText          = "Department List"
                     design              = "standard"
                     headerVisible       = "true"
                     width               = "30%"
         selectedRowKeyTable = "<%= selectedrowindextable %>"
         onRowSelection      = "MyEventRowSelection"
         sort                = "server"
         keepSelectedRow     = "TRUE"
         selectionMode       = "MULTISELECT"
         table               = "<%= i_dept %>" >
    </htmlb:tableview>
    In your <b> OnInputProcessing </b>, Use this Iterator table to get the data of selected records.
    IF selectedrowindextable[] IS NOT INITIAL.
    DESCRIBE TABLE selectedrowindextable LINES no .
    Rgds,
    Jothi.
    Pls do close the thread if ur problem is solved.

Maybe you are looking for

  • Invoke Error while inserting consumed JMS Topic msg in table thru DBadapter

    Hi All, To brief abt my requirement, I am integrating Peoplesoft HRMS module with Oracle SOA i.e., + 1. PS HRMS module will publish a JMS msg into a JMS Topic 2. I will consume the same msg using JMS adapter consume operation in my SOA project 3. The

  • Creation of Maintenance Plan through IBIP t.code

    Hi, I want to create the Maintenance Plan in Mass using the IBIP t.code. I am using Record name as IBIPMPLA, and trying to create the Plan but instead of providing Plan description in t he file error is coming for Plan description. If any procedure i

  • HT1203 How do you share between users with Windows 8

    I have two user accounts on my computer. How do I share my music between them with iTunes with Windows 8.

  • Missing Purchase Order - Numbering Issue

    Hello, We have entered a PO which has been printed. However if the PO number is viewed it reflects a different PO. Does SAP then reuse the number should another PO be created before. Surely it would keep the allocated number available unless the PO w

  • Freight in Purchase Order

    Hi Guru's,                 I want to raise a PO in which my transportation vendor is different then material vendor but I want to inventories the freight cost on material purchased. So, how this can be done. Plz give solution asap ..URGENT... Will as