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: 

Back button on standar tool bar

Mohamed_Mukhtar
Active Contributor
0 Kudos

Hi,

I have created three custom transactions Create, Change and Display.

In Transaction Change

If something is changed....and when i click back button (standard tool bar) , then i have to raise

a message (Eg: Do u want to save the data).

If there are no changes in that transaction, ...and when i click on back button , then i have to leave that

program without any message.

Here , the problem is , how can i found whether changes are made or not.

Is there any funciton module for this purpose...or i have to write the custom code.

So,. will you guys give some inputs to resolve this issue.

Hope i explained cleary....

Thanks & Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

Its better you carry out the custom code for your requirement.

Know the function code for the back button.

Check for the function code to be triggered

When it is triggered check the currect values on the screen with respect to the past values.

If they are same don't raise the message and if the differ trigger the corresponding message you want to display on the screen.

thanks

Sharath

6 REPLIES 6

Former Member
0 Kudos

hi,

Its better you carry out the custom code for your requirement.

Know the function code for the back button.

Check for the function code to be triggered

When it is triggered check the currect values on the screen with respect to the past values.

If they are same don't raise the message and if the differ trigger the corresponding message you want to display on the screen.

thanks

Sharath

0 Kudos

Thanks for your reply,

if have to compare each and every field of that particular transaciton.

It will be very tiresome work...Is'nt it?

Is there any other alternative left..?

0 Kudos

Hi,

You can compare the work areas instead of comparing each and eery field.

What you should do is store the data in a work area just when the database selection is done. The user will then interact with the screen , change the working copy of the work area.

Then you compare the old vs new ( data from screen ) to see if there were any changes made.

If yes, give the message otherwise ignore.

Also note that this you will only have to do for Change mode.

regards,

Advait

Former Member
0 Kudos

hi,

For that, I would suggest is run a BDC RECORD for the transaction.

You get the screen numbers and corresponding field names and values.

So check for which screen number and program , the user is working on this can be a case statement, so with respect to that screen perform the check for that screen fields.

Hope it helps you

Thanks

Sharath

I355602
Advisor
Advisor
0 Kudos

Hi,

If you are using textbox fields on screen, then you must be using structures to display data on screen.

So when user click BACK button, just populate the current screen entries into another structure of same type.

If you are using table control, then when user click 'BACK' capture the data in table control into another internal table with same structure.

Compare the two (for both case), if same, then LEAVE SCREEN

If data is changed then use popup to ask user 'do you want to save the chaged data'.

Use FM


  CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'
    EXPORTING
      DEFAULTOPTION = 'Y'
      DIAGNOSETEXT1 = 'This is Testing'
      DIAGNOSETEXT2 = ' '
      DIAGNOSETEXT3 = ' '
      TEXTLINE1 = 'Do You want to Exit'
      TEXTLINE2 = ' '
      TITEL = 'POPUP_TO_CONFIRM_WITH_MESSAGE'
      START_COLUMN         = 25
      START_ROW            = 6
*----for the display of cancel button  do like this.
      CANCEL_DISPLAY       = ' '
    IMPORTING
      ANSWER               = ANS
          .
  if ans = 'J' .
*---put code on selecting yes
  else.
*---put code on selecting no
  endif.

Hope this helps you.

Thanks & Regards,

Tarun Gambhir

Mohamed_Mukhtar
Active Contributor
0 Kudos

Thanks solved....

After fetching the data into internal table, moved this data to dummy internal table.

when 'BACK'.

if it_dummy[] eq it_table.

leave program.

else.

PERFORM f_popup_message.

endif.