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: 

POP up cancel button coding

Former Member
0 Kudos

Hi,

I have coded for a pop up for the transaction va02 in the user exit MV45AFZZ.

This will trigger while saving.

It has two buttons "Cancel" and "Exit".

Exit - if you press Exit, it will go to easy access screen.

Cancel - It should remain in the same screen.

Exit works fine...But for cancel, i written the below code,

Leave to screen 4001.

It also works, but when you move to other screen in VA02 and try to save, while this pop up comes, and press Cancel, it gives dump.

What code should be written so it will work for all screen? What ever the screen, it should remain in the same screen while cancel button is pressed.

Thanks,

Ezhil.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ezhil,

The issue which you are facing generally comes in pop windows. What you can do is instead of 'Leave to screen 4001', it's better to use 'Call screen 4001'.

Hope it will solve your problem.

If you are still facing some issue, please let us know.

Cheers

VJ

15 REPLIES 15

Former Member
0 Kudos

Hi,

Use "Leave to screen 0."

Regards,

Ernesto

0 Kudos

Leave to screen 0 will lead to SAP easy access..this is used for EXIT button.

But when cancel button pressed, it should remain in the same screen. (VA02 screens)

0 Kudos

Hi,

Then do not put any code in it.

Regards,

Ernesto

Former Member
0 Kudos

Hi Ezhil,

The issue which you are facing generally comes in pop windows. What you can do is instead of 'Leave to screen 4001', it's better to use 'Call screen 4001'.

Hope it will solve your problem.

If you are still facing some issue, please let us know.

Cheers

VJ

0 Kudos

I tried using CALL SCREEN 4001, but still i get the dump.

In the dump says

The system attempted to use dynpro 6201 in program "SAPMV45A".

This dynpro does not exist.

I dont know where the screen 6201 comes into picture.

0 Kudos

Hi,

What pop up are you using? Which Function Module?

Regards,

Ernesto

0 Kudos

POPUP_TO_CONFIRM

0 Kudos

Have you created '6201' screen because when I see the program SAPMV45A in se80 there is no screen number 6201.

Can you please let us know the code which you are coding in exit??

0 Kudos

No..I didnt create it..Thats why i am wondering

0 Kudos

Please paste your code which are coding in the exit for the pop window.

0 Kudos

Hi,

The dump comes only in line item "condition" tab. Its subscreen value is 6201. For all other screen, the pop up works well.

0 Kudos

My code is

IF l_answer = '1'. "Cancel button

CALL SCREEN 4001.

ELSEIF l_answer = '2'. "Exit

LEAVE TO SCREEN 0.

ENDIF.

0 Kudos

Hi,

Use Cancel Button that is provided by the Function Module instead of Button 1.

Regards,

Ernesto.

0 Kudos

Yes, i tried FM cancel button. But how to stop the program flow. The coding which comes after the pop up should be executed. but it is being executed if I use the FM cancel button

Hi,

Thanks All..

This issue is solved by putting the below coding for cancel button

if l_answer = '1'. "Cancel Button

set screen sy-dynnr.

leave screen.

elseif l_answer = '2'. "Exit Button

leave to screen 0.

endif.