Skip to Content
author's profile photo Former Member
Former Member

Table modify in BSP

Hello All,

I have a tableview with entries from a Database table.

I have 3 columns in this table view.

Out of all the 3 columns ,I made only one column editable ( 2nd column ).

1, Now if i change the value in the 2nd column the internal table of the table view must get modified with the changed value .

After that I'll modify the corresponding database table

I want this to be acheived without selecting any line of the tableview after the changes.

can it be done ? I want this is to be chieved after a button "SAVE' on page , not on table view.

I am able to modify internal table on a table view event but i am not able to find data on Click of SAVE button lying on Page

Please let me know how to do this

Rajiv

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jan 04, 2008 at 04:17 PM

    Search this BSP fourm with modify or update tableview, you will get plenty of threads for the same.

    Raja T

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Rajiv,

      here I am giving the code that I used.

      data: loc_table_event type ref to cl_htmlb_event_tableview,

      lt_selectedkeytab type STRING_TABLE,

      visible_first_row type STRING,

      loc_ind type selectedrow,

      loc_sel_rows type selectedrows.

      call method cl_hrrcf_iterator=>get_tv_attr

      exporting

      p_tv_id = 'TV'

      p_component_id = me->component_id

      po_request = me->request

      importing

      p_visible_first_index = visible_first_row

      pt_selected_keys = lt_selectedkeytab

      po_tv_event = loc_table_event.

      refresh loc_sel_rows.

      call method loc_table_event->get_rows_selected

      receiving selected_rows = loc_sel_rows

      loop at loc_sel_rows into loc_ind.

      ///you need to write this code for each cell you want to get data form table view I wrote for 1st and 2nd fields.///

      wa-field1 = loc_table_event->get_cell_value(

      row_index = loc_ind-index

      column_index = 1 ).

      wa-field2 = loc_table_event->get_cell_value(

      row_index = loc_ind-index

      column_index = 2 ).

      modify int_table index loc_ind-index from wa .

      endloop.

      Reward points if useful

      vijay

  • author's profile photo Former Member
    Former Member
    Posted on Jan 05, 2008 at 05:55 AM

    you need to get the edited data form table view and update the intenal table.

    Can you paste your code that you wrote for SAVE button.

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Vijay

      I have written following code : I am chekcing for table view and a event is fired on screen for save with event id 'SAVE'

      if tv is not initial.

      DATA: gv_row TYPE string,

      gv_len TYPE i,

      cell_id TYPE string,

      wa_test LIKE LINE OF torder,

      value1 type string.

      LOOP AT torder INTO wa_test.

      CLEAR gv_row.

      gv_row = sy-tabix.

      gv_len = STRLEN( gv_row ).

      gv_len = gv_len - 1.

      CONCATENATE 'helptable' '_' gv_row(gv_len) '_' '3'

      INTO cell_id .

      value1 = request->get_form_field( name = cell_id ).

      IF wa_test-description value1.

      CLEAR wa_test-description.

      wa_test-description = value1.

      MODIFY torder FROM wa_test.

      ENDIF.

      ENDLOOP.

      endif.

      rajiv

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.