2011 Sep 22 3:15 PM
Hi Guys
I have a table with numerous columns. The last column is a checkbox telling the user that a record is marked for deletion. This field is input disabled in the Layout. I have provided a button that when a line in the table control is selected and the button clicked the checkbox will be activated = 'X'.
I have written code in the PAI user command module (see below). Please could you tell me if this is the correct approach.
Kind Regards
CASE SAVE_OK.
when 'SET_DELETE'.
<work-area>-delete checkbox = 'X'.
MODIFY <internal table> FROM <work-area> INDEX vcontrol-current_line.
then later
WHEN 'SAVE'.
modify <database table> from table <internal table>.
2011 Sep 22 3:25 PM
It is a correct approach but be careful about MODIFY itab FROM wa INDEX tc-current_index.
Because this MODIFY command modifies all the entries in the itab even if a field of itab does not exist in the table control . So i advice you to use MODIFY with TRANSPORT option .
Thanks Chericheri
So my code now reads MODIFY <internal table> FROM <work area> INDEX <table control>-current_line transporting <deletion indicator field>.
Edited by: Brett Cunliffe on Sep 22, 2011 4:44 PM
2011 Sep 22 3:25 PM
It is a correct approach but be careful about MODIFY itab FROM wa INDEX tc-current_index.
Because this MODIFY command modifies all the entries in the itab even if a field of itab does not exist in the table control . So i advice you to use MODIFY with TRANSPORT option .
2011 Sep 22 3:43 PM
Thanks Chericheri
So my code now reads MODIFY <internal table> FROM <work area> INDEX <table control>-current_line transporting <deletion indicator field>.
Edited by: Brett Cunliffe on Sep 22, 2011 4:44 PM
2011 Sep 23 7:00 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |