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: 

Dialog Programming Problem :

Former Member
0 Kudos

Hi,

I want to develop one screen having functionality similar to ME51 i.e. my screen will have some input fields. If user types anything in any of input fields and press back it should give me a pop up to confirm saving of data.

And if user simply invkes a transaction and do not put any values no pop up message should be given.

This happens in case of ME51. If u invoke ME51 and press back without inptting nething it wont give u a pop up. But if u provide a value to input field and press back WITHOUT PRESSING ENTER i.e. without PAI to be triggered - a pop is displayed.

How should I go about this problem ?

Regards,

Nitin

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi nitin,

I think you need not show popup when you didnot enter any values in screen fields.

If it is a problem you can check the field sy-datar.

This field is set to 'X' if you change any of screen fields. So you can call popup after checking this field.

regards,

suresh

10 REPLIES 10

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Nitin,

also 'Back' starts PAI, so you have a chance to react.

Make only 'end' and 'cancel' as exit-commands, here you leave without consistency checks.

Otherwise place first modules to handle the inputs, flag a help variable, if anything was typed.

Last module should handle OK-code, here 'back' can trigger a popup, if your flag is checked.

Regards,

Christian

Former Member
0 Kudos

Hi Nitin,

Execute txn se37 type POPUP_TO_* and press F4, you will a

list of function modules, choose the one which solves your problem.

Also visit <a href="http://www.sapgenie.com/abap/functions.htm">this</a> link and <a href="http://www.sapdevelopment.co.uk/fmodules/fmsapp.htm">this</a>.

Hope it helps.

Regards,

Narinder Hartala

Message was edited by: Narinder Singh Hartala

Former Member
0 Kudos

To get the dialog message you can try with FM

"POPUP_TO_CONFIRM_STEP". Is you input fields are mandatory then it would be impossible to do this. If not you can check for the field is initial and do your process.

Prabhu Rajesh.

Former Member
0 Kudos

Hi Nitin,

You have to use the information in both the above posts together to solve your problem. you could choose to write something like -

FLOW LOGIC - 

PROCESS AFTER INPUT.
  MODULE CANCEL AT EXIT-COMMAND.

PROGRAM CODE - 

MODULE CANCEL INPUT.
  IF SY-UCOMM EQ 'BACK'. (please note that BACK should be defined as a function of type EXIT COMMAND)
    CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
       EXPORTING
        TITEL      = 'TEST'
        TEXTLINE1  = 'Do you want to exit without saving ?'
       IMPORTING  
        ANSWER     = LV_ANSWER.
  ENDIF.
ENDMODULE.

Let me know if it helped.

Regards,

Anand Mandalika.

0 Kudos

Hi Anand and Christian,

I think I was not able to put my problem correctly.

I know the FM 'POP_UP_TO_CONFIRM_STEP', module exit at exit command etc.

What I want to do is develop a scenario like this

Scenario 1

-


1. I execute a z trasaction.

2. I do not input a single character on screen

3. Press back.

4. No pop up is displayed to confirm a step

Scenario 2

-


1. I execute a z trasaction.

2. I input a single character on screen

(PLESE NOTE THAT I DO NOT PRESS ENTER AND TRIGGER PAI)

3. Press back.

4. Pop up should be displayed to confirm a step

To get the scenario plz execute me53 transaction. Input a single character anywhere on screen. DONT PRESS ENTER. Simply press back.

I hope I am clear with my scenario this time

Regards,

Nitin

0 Kudos

Hi,

One small correction. Plz refer to Transaction ME51N instead of ME53N to get my scenario

Regards,

Nitin

0 Kudos

i assume that this is a module pool program.

did you assign you custom GUI_STATUS.

if yes your PAI will get triggered whe you hit the back button.

you can confirm this by putting a break point in either your custom program or in ME51N

Regards

Raja

0 Kudos

Hi,

In PAI module,write as below.

Check whether the fields are initial.

if EBAN-BANFN is initial and ......

don't call popup.

else.

call popup.

endif.

If some default values are appearing,check the screen-field eq default_vaLUE.

Former Member
0 Kudos

Hi nitin,

I think you need not show popup when you didnot enter any values in screen fields.

If it is a problem you can check the field sy-datar.

This field is set to 'X' if you change any of screen fields. So you can call popup after checking this field.

regards,

suresh

0 Kudos

Thanks a lot. That's exactly what I was looking for.