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

Setting Deletion Indicator in a Table Control

Former Member
0 Likes
916

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>.

1 ACCEPTED SOLUTION
Read only

yavuzasik
Participant
0 Likes
771

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 .

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 .

3 REPLIES 3
Read only

yavuzasik
Participant
0 Likes
772

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 .

Read only

Former Member
0 Likes
771

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

Read only

0 Likes
771

Yes if deletion_flag is the only field you want to change.