12-18-2008 10:08 AM
Hello Friends,
In my dialog program i have tablecontrol and one push button for update, if the user edit 3 rows of data in table control and press update button so after updating all the rows the user should get a message saying all the records are updated.
how can i show this message after 3 record is updated means how can i check whether 3rd record is updated or not so that i can display a message.
regards,
Sunny
12-18-2008 10:20 AM
Hi Sunny ,
Ask your user to select the line before updating the database...
In this case what you can do is update the selected lines its totally upto the user preference whether to update single or multiple records.......
Thnks
Sahil
12-18-2008 11:51 AM
Hello Sunny,
After executing your update query, the number of records that are hit in the database table is stored into the system field 'SY-DBCNT'.
Use this field to check how many records are updated and use this value with the success message to display '_ records updated.'
To check whether the previous query was successfully executed or not, use system field 'SY-SUBRC'.
If SY-SUBRC = 0, this means the database is hit by the query, else the query was not successfully executed.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
12-19-2008 8:12 AM
thnks for the reply tarun.
as my table control data is stored in work area so i have written loop statement in pai event so for each record the update or modify statement is getting executed, in this such situation i cannot check sy-dbcnt and how many rows will be updated tht are not pre determined.
12-18-2008 12:10 PM
12-18-2008 1:08 PM
Do it like this
"You can find this line in PAI in one of the module
UPDATE <STD_TABLE> FROM TABLE <TABLE_CONTROL_DISPLAY_TABLE>.
"after this line code like this
IF SY-SUBRC = 0.
MESSAGE ' & number of records updated' TYPE 'S' WITH SY-DBCNT.
ENDIF.
12-26-2008 5:10 AM