Application Development 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: 

screen painter query

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

I355602
Advisor
Advisor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

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.

Former Member
0 Kudos

thnks