cancel
Showing results for 
Search instead for 
Did you mean: 

popup message to save data after change operation

Former Member
0 Kudos

Dear Experts,

I created a web application with create,change,save,display mode operations. when ever i go to change mode i can change data but how can i make save button as mandatory in change mode.

Bcs end user may press display or create button without pressing save button.

Thanks & Regards,

Anuvidhya T.

Accepted Solutions (1)

Accepted Solutions (1)

abhishek_gupta2
Participant
0 Kudos

Hi There ,

Create a global variable . say gv_flag .

Whenever you want to capture any actions say on press of save button, set this flag as X . So now you have a variable by which you can check which button has been pressed .

Now if this flag is set ( X) , trigger your pop - up .

Also remember to clear the flag value once you exit your app .

Also in my opinion use different variables for different actions . It makes life easier and helps to understand the flow better.

Please let me know if your problem is not solved .

Thanks ,

Abhishek

Edited by: Abhishek Gupta on Aug 27, 2010 2:19 PM

Former Member
0 Kudos

My problem solved.

Thanks Abhishek.

Regards,

Anuvidhya T.

Answers (3)

Answers (3)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Generally in SAP delivered applications we check the context change log or some other "dirty" flag to see if there is changed data before switching out of change mode or navigating to a new document. If the data is "dirty" we produce a dialog asking if the user wants to save their data before navigation. This isn't really making the save button mandatory, but instead reminding the user and giving them a simple opportunity to save before their data is lost.

Former Member
0 Kudos

Thank Manogna.

But my requirment is need to call the popup window when he press next action buttons( create , Display , Delete ).

i know the method to call popup window but how can i capture the action when he leave without saving data.

if i call the popup window from create/display/delete how would i know the user from change mode.

Regards,

Anuvidhya T.

ramakrishnappa
Active Contributor
0 Kudos

Dear Anuvidhya,

Since you are already familiar with the creation of popup window..

Please try the below simple steps to resolve this.

1. Create an attribute in COMPONENTCONTROLLER context as AT_CHANGED TYPE char1 ( dont forget to make it as PUBLIC )

2. Set this attribute , Once User presses the Change button. write the below statement in OnChange method.

wd_comp_controller->at_changed = 'X'.

3. Go to Onbefore action method

if  wd_comp_controller->at_changed is not initial.
     " call popup here
     endif.

4. Inside Create, Display, Delete button's methods .. excecute the logic only..

if  wd_comp_controller->at_changed IS initial.
 " write your respective logic
 endif.

----


I hope this will help you.

Regards,

Rama

Edited by: Rama krishna on Aug 26, 2010 4:44 PM

former_member1151507
Participant
0 Kudos

Hi Anuvidhya,

According to your requirement, we can make DISPLAY, CREATE buttons invisible / non-editable and SAVE button visible ( by binding the visibility property of buttons with attribute and set the value of that attribute accordingly) if the user clicks CHANGE button.

Hope this helps you.

Regards,

Manogna

Edited by: manogna musunuri on Aug 26, 2010 12:36 PM