Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

editing particular row in table control

Former Member
0 Likes
641

Hi,

I need to change values in particular rows which are displayed in table control.

Do You know how to do it?

If it is possible to set editable flag for rows?

BR,

Mariusz

3 REPLIES 3
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
578

Hi,

Yes you can do that.

Follow these steps:-

it_zekpo is my internal table w/o header line,

wa_zekpo is work area.

Name of input/output fields on screen are:-

wa_zekpo-field1,

wa_zekpo-field2, and so on...

Take the group1 for all textboxes as 'ABC' in the table control

Try using code:-

At screen logic:


PROCESS BEFORE OUTPUT.
*  MODULE status_8003.
 
  LOOP WITH CONTROL po_tb.
    MODULE read_data.
  ENDLOOP.
 
PROCESS AFTER INPUT.
*  MODULE user_command_8003.
 
  LOOP WITH CONTROL po_tb.
    MODULE modify_data.
  ENDLOOP.
 

In PBO


*&---------------------------------------------------------------------*
*&      Module  READ_DATA  OUTPUT
*&---------------------------------------------------------------------*
MODULE read_data OUTPUT.
  READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
 
  data : line_count type i.
 
  describe it_zekpo
  lines line_count.
 
  po_tb-lines = line_count + 10.
  "to increase the number of lines in table control dynamically
 
ENDMODULE.                 " READ_DATA  OUTPUT

In PAI


*&---------------------------------------------------------------------*
*&      Module  MODIFY_DATA  INPUT
*&---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
  MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
  "this will modify the contents of existing line into internal table
ENDMODULE.                 " MODIFY_DATA  INPUT

After you can use you code to update the ztable from the updated internal table.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Edited by: Tarun Gambhir on Feb 24, 2009 10:21 AM

Read only

Former Member
0 Likes
578

Hi

You needn't set an editable flag to edit rows of a table control. You can edit them anyways. In order to update the edited values you must write code in PAI.

PAI.

loop at itab.

module update.

endloop.

Here itab is with header line and my db tbl is ystudent.

MODULE update INPUT.

itab-id = ystudent-id.

itab-name = ystudent-name.

update ystudent from itab.

ENDMODULE. " update INPUT

Hope this helps

Regards,

Jayanthi.K

Read only

0 Likes
578

The case is:

In one column I need to have editable and not editable rows.

I don't know if it any table where you can defined which rows are editable or not.

BR,

Mariusz