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: 

Module Pool help need on clicking back

Former Member
0 Kudos

Hi all,

I have created my own module pool program, in that I have a screen where I used 3 alv, 20 Input fields and 3 check boxes no fields are mandatory. The 3 alv is a editable alv.

My issue is if the user changed some data in the screen and without saving, if he clicks on the "BACK" button a pop up has to populate regarding you want to save the data or not? and if user haven't done anything popup should not appear.

Here my doubt is as there is too many fields in the screen how come I know that the user has edited or entered some value on any of the fields. Its very tough to write code on the base of conditions of each field.

Can anybody help me out in this............

Thanks n advance,

Vichu

1 ACCEPTED SOLUTION

brad_bohn
Active Contributor
0 Kudos

Have you tried checking SY-DATAR? Can't say whether it works with editable ALV's or not - I've never had the need to use one in 15 years. Otherwise, split the screen design into multiple screens, tabs, etc. to make the checking easier. Having so many fields and grids in one screen does not sound like a good approach.

6 REPLIES 6

Former Member
0 Kudos

H.

I would suggest using Table Control for your case.

But even if you used ALV then there is no need to check which filed changed. You just update the entire row.

Ashutosh

brad_bohn
Active Contributor
0 Kudos

Have you tried checking SY-DATAR? Can't say whether it works with editable ALV's or not - I've never had the need to use one in 15 years. Otherwise, split the screen design into multiple screens, tabs, etc. to make the checking easier. Having so many fields and grids in one screen does not sound like a good approach.

Former Member
0 Kudos

Hi guys,

Thanks for your quick reply............

For alv no problem i already have the code to check whether alv changed or not........... i just wanted to know the screen fields changed or not........... as you said the sy-datar i will try to use that and let you know is it working or not........

1 small doubt should i directly believe that this system command will work perfectly for the fields in the screen??????

Thanks alot for your help guys..........

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi,

You can make use of the system field SY-DATAR, it will set to X when a screen field is modofied.

SY-DATAR - In transaction programming this field indicates the change of data on the screen. In the PBO part you may set default values of the input fields of the dynpro. In the PAI part you can check if they were changed. If SY-DATAR is set, then the user has modified or entered new data on the screen.

@Brad - You are right Brad, it wont work in ALV i guess.

@OP - Instead you can use Container alv , where you can get the changed data easily with some methods

Refer :link:[ALV|http://wiki.sdn.sap.com/wiki/display/ABAP/GetChangedValueInALVGridDynamically.]

Check the method handle_data_changed and how its used.

Edited by: Keshav.T on Jun 4, 2010 11:47 PM

0 Kudos

Hi,

sy-datar works with most of the controls except table control - I did it before by manual checking.

I'm not sure with ALV, you need to check.

Regards,

Khanh

Former Member
0 Kudos

Hi,

You can do:

1. For any screen changes: SY-DATAR (is set per screen, so save the changes during PAI of tab-screen(s).).

2. For text changes: call method editor->get_text_as_stream during PAI

can return the text-modified status (importing parameter: is_modified =3D text_mod).

Sy-datar is not set when just changing text in the text-editor).

With that I have an easy way to prevent my pop-up box from appearing, when no change was made in edit-mode.

You can also use the FM dynp_values_read. The documentation is pretty good.

May it helps you.

Regards.

Deepak Sharma