cancel
Showing results for 
Search instead for 
Did you mean: 

TableView & Iterator & Editing.

Former Member
0 Kudos

Hello,

I'm new on BSP.

I have a table view with an iterator.


                        <htmlb:tableView id              = "qualif_bo"
                                         table           = "<%= t_postes %>"
                                         emptyTableText  = "<%= otr(ZMOB/NORESULT) %>"
                                         iterator        = "<%= iterator_qualibo %>"
                                         sort            = "server"
                                         headerVisible   = "false"
                                         width           = "100%"
                                         design          = "alternating"
                                         footerVisible   = "false"
                                         visibleRowCount = "0"
                                         fillUpEmptyRows = "false" />

The cells ared editable .

I modify the cells values on the page and after I click on a button.

I would like on the 'do_handle_event' get the internal table 't_postes' updated (with the new values the user set).

How I have to do ?

Thank you.

B.Pochin

Message was edited by:

Bernard Pochin

Accepted Solutions (1)

Accepted Solutions (1)

raja_thangamani
Active Contributor
0 Kudos

Pls search this BSP forum, these kind of question discussed many times.

Raja T

Answers (2)

Answers (2)

Former Member
0 Kudos

I found a solution :

In the "do_handle_event" :


      REFRESH lt_form_fields.
      CALL METHOD request->get_form_fields
        CHANGING
          fields = lt_form_fields.

*----The fields to update.
      CLEAR l_para.
      MOVE 'ERDAT30/ERDAT30;ERDAT23/ERDAT23;ERDAT27/ERDAT27;ERDAT28/ERDAT28;ERDAT26/ERDAT26;ERDAT25/ERDAT25;ERDAT29/ERDAT29;FACT/FACT' TO l_para.

*----top_controller->t_postes is the source of the tableview and 'dos_qualif_bo' is the id.
      PERFORM fill_table IN PROGRAM zwm_mob_bsp_utility
              TABLES lt_form_fields top_controller->t_postes
              USING 'dos_qualif_bo' l_para 'M'.

The routine fill table :


FORM fill_table TABLES t_form_fields
                       t_result
                 USING l_id
                       l_corresp
                       l_mode.   " A : append - M : modify

  DATA : BEGIN OF t_field OCCURS 0,
           name(40),
           value(200),
         END OF t_field.

  DATA : l_name(60),
         l_index_lgn(3),
         l_index_field(3),
         l_suite(200),
         l_type,
         l_lgn_max TYPE i,
         l_column_names(200).

  FIELD-SYMBOLS: <f_field> , <f_result>.

  DATA : BEGIN OF t_corresp OCCURS 0,
           id(40),
           field(40),
         END OF t_corresp.
  DATA : BEGIN OF t_corresp2 OCCURS 0,
           id(40),
           field(40),
         END OF t_corresp2.

  LOOP AT t_form_fields.
    ASSIGN COMPONENT 'NAME' OF STRUCTURE t_form_fields TO <f_field>.
    t_field-name = <f_field>.
    ASSIGN COMPONENT 'VALUE' OF STRUCTURE t_form_fields TO <f_field>.
    t_field-value = <f_field>.
    APPEND   t_field.
  ENDLOOP.

* Alimentation de la table de correspondance
  SPLIT l_corresp AT ';' INTO TABLE t_corresp2.
  LOOP AT t_corresp2.
    SPLIT t_corresp2 AT '/' INTO t_corresp2-id t_corresp2-field.
    MODIFY t_corresp2.
  ENDLOOP.

* Nom des colonnes
  CONCATENATE l_id 'allcolumnnames'
     INTO l_name SEPARATED BY '_'.
  CONDENSE l_name NO-GAPS.
  READ TABLE  t_field WITH KEY name = l_name.
  l_column_names = t_field-value.
  SPLIT l_column_names AT '/' INTO TABLE t_corresp.
  LOOP AT t_corresp.
    READ TABLE t_corresp2 WITH KEY id = t_corresp-id.
    IF sy-subrc = 0.
      t_corresp-field = t_corresp2-field.
    ELSE.
      t_corresp-field = t_corresp-id.
    ENDIF.

    MODIFY t_corresp.
  ENDLOOP.

* Boucle sur les lignes

***    MODE MODIFY
  IF l_mode = 'M'.
    LOOP AT t_result.
      l_index_lgn = sy-tabix.

      LOOP AT t_corresp.
        l_index_field = sy-tabix.
        CONCATENATE l_id l_index_lgn l_index_field
           INTO l_name SEPARATED BY '_'.
        CONDENSE l_name NO-GAPS.
        READ TABLE t_field WITH KEY name = l_name.
*        CHECK sy-subrc = 0.
        if sy-subrc <> 0.
          t_field-name = l_name.
          t_field-value = ''.
        endif.
        ASSIGN COMPONENT t_corresp-field
               OF STRUCTURE t_result TO <f_field>.
        CHECK sy-subrc = 0.
        DESCRIBE FIELD <f_field> TYPE l_type.
        IF l_type = 'D'.
          CALL FUNCTION 'RP_FORMATING_DATE'
            EXPORTING
              date_i       = t_field-value
            IMPORTING
              date_o       = <f_field>
            EXCEPTIONS
              date_invalid = 1
              OTHERS       = 2.
          if t_field-value eq ''.
            <f_field> = '00000000'.
          endif.
          IF sy-subrc <> 0.

          ENDIF.
        ELSE.
          <f_field> = t_field-value.
        ENDIF.
      ENDLOOP.

      MODIFY t_result.
    ENDLOOP.
ENDIF.

Former Member
0 Kudos

I have already read the forum. I didn't find answers.

I use MVC, and I didn't have any event on the tableView because I'm clicking on a button. The property selection mode is set to 'none'.

I tried too in the iterator => VALUE = PCELL_BINDING but it doesn't work.

I'm going to try with hidden fields and field symbols, but I don't think, it's the better way.

Thank you

B.Pochin.