2009 Feb 23 1:57 PM
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
2009 Feb 24 4:36 AM
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
2009 Feb 24 4:48 AM
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
2009 Feb 24 10:58 AM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |