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

Saving particular record from Table control

Former Member
0 Likes
758

HI All,

I am using table control without wizard .

Few of the columns in the table control are editable while others are readonly.

If the table control displays 5 records, and only 2nd and 4th rows are modified,

In this case I want to update the date in the database table only for the rows I have modified (i.e.. 2nd and 4th row), and not the other rows that are unchanged..

Plz let me know how do I come to know which field is edited and which one is not.

Waiting for reply.

Regards,

Renuka

6 REPLIES 6
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
724

You can try a logic like,

Before moving the data to the table control just move all the records to a internal table(it).

Now in PAI after modification,

Loop at the table control records and read the (it) , check if the valeu differs comparing both.

Hope you got it.

Read only

0 Likes
724

Hi Keshav,

thanks for the reply...

The way you have mentioned here, does a manual chek..

I am looking for a standard way to know the edited fields of the table control.

If no other option is available then I will go with the option you told about.

DO let me know is there any standard way to do it..

Using any of the attributes/properties of the table control etc...

Regards,

Renuka

Read only

0 Likes
724

Hi Renuka,

You can use field statement and On request along with Chain End chain statements


PROCESS AFTER INPUT.
CHAIN.
FIELD: <Field name 1>,
<Field name 2>,...<Field name n>.
MODULE <module>ON CHAIN-REQUEST.
ENDCHAIN.

1) If you use the ON REQUEST addition in a MODULE statement after FIELD, the module is

called only if the user enters a new value in that field.

2)Within a CHAIN block, you must use the ON CHAIN-REQUEST addition. The module is then

called if the user changes the contents of at least one screen field within the CHAIN block.

3) With this condition, module mod is called only if the value of the screen field dynp_field has been changed by input after the event PBO. It is considered as input if the existing input is overwritten with the same value or if the initial value of the field is entered explicitly.

This will solve your problem.

regards,

Kiruba.

Read only

0 Likes
724

Hi Kiruba,

Can you plz elaborate the same, give sommore detail.

Sample code will be a great help

Regards,

Renuka

Read only

0 Likes
724

Hi Renuka,

You can do it by 2 ways,

1) Simply you can use modify statement to update database .It modifies the entry if it is already exists in database or else it will insert into the database.

2) using OnRequest along with field statement .

a) Add a flag field in the structure which you are using for the table control to set if value got changed

b) If you are using OnRequest along with field statement , if vaue got changed in the particular field , it will enter into the module in the on request statement, inside the module , you can update the flag field.so at the end while updating you can identify which row has changed using the flag.


PROCESS AFTER INPUT
Loop at internal table "used in the table control
Field : xyz.
Module mod ON REQUEST "This module will called only if value got changed after PBO, inside the module , set the flag in the structure
endloop
 

I think it will be enough to solve your problem it cannot be elaborated more than this .

Read only

0 Likes
724

Hi Kiruba,

Thanks for the reply.

It worked for me..

Its solved.

Regards,

Renuka