Application Development and Automation 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: 
Read only

Issue in Cancel button in Module Pool .

Ravialter
Participant
0 Likes
1,995


Hi All,

I have a two module pool program , i moved one to other using call dialog .Now issue is when i press exit command button CANCEL from second module pool screen  , it don't comes out .

Usually we know  for out from module pool we use leave screen but its not working in my case because it revert to me in first module pool program .

any idea ?

Regards,

Alter

9 REPLIES 9
Read only

Former Member
0 Likes
1,462

HI,

reading the ABAP documentation for CALL DIALOG it says, that you have to leave it via

LEAVE PROGRAM.

Regards,

Klaus

Read only

former_member756887
Participant
0 Likes
1,462

Hi Ravi,

You need to do code in your second module pool', PAI module.

for ex: If sy-ucomm = 'CANCEL'.

LEAVE PROGRAM OR YOU CAN USE SET SCREEN 0.

           ENDIF.

HOPE IT WILL HELP YOU

Read only

Former Member
0 Likes
1,462

Hi Ravi,

  Try below code in the PAI of your 2nd dialog:

  SET SCREEN 0.

  Leave Screen.

or

  SET SCREEN 0.

  LEAVE PROGRAM.

Hope this helps.

Read only

former_member184158
Active Contributor
0 Likes
1,462

Hi,

if you want to exit from program,

you can try leave program.

LEAVE PROGRAM.



Regards

Ibr

Read only

Former Member
0 Likes
1,462

Call Dialog is now classed as obsolete.

Sap Help says:

"Calling dialog modules is replaced by calling methods of global classes or by

function modules (function modules that can call the classic dynpros of their

function group). It is usually not necessary to open an internal session without

changing the SAP-LUW."

The issue you describe is the natural reaction to using 'Leave Screen'.  As the other posters state - if you wish to actually exit the program use 'Leave Program'.

Read only

0 Likes
1,462

Hi All,

Thanks your reply but when i a using leave program on cencel it has to be moved in my first module pool program .Same as screen 0 as i knw it goes to previous screen but not exit from all .

As per my understand its need logically setting with code using leave ....... .But there is not direct way .

Please suggest if any direct way .

Regards,

Ravi

Read only

0 Likes
1,462

Hi,

Use your code in

MODULE exit AT EXIT-COMMAND


When '&CANCEL'

leave to screen 0.


Hope it helps....


Thanks,

Vijay SR

Read only

0 Likes
1,462

Hi,

Use your code in

MODULE exit AT EXIT-COMMAND


When '&CANCEL'

Exit.


Hope it helps....



Regards,

Hitesh


Read only

Former Member
0 Likes
1,462

use submit command in first program(without return ).