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 exit cancel buttons not working

Former Member
0 Kudos

Hello Experts,

I made one screen and maintained gui status for that screen.

In the Status of the screen I had assigned back,exit and cancel buttons to the respective functions:

back exit and canc

But while executing the report these buttons are not working. I am able to click these buttons but nothing is happening.

What should I do to make gui-status work?

1 ACCEPTED SOLUTION

Former Member

Hi,

you need to define a module to process these.

" MODULE EXIT at exit command " in the PAI.

there check the function code and do desired function.

EG:

CASE SY_UCOMM

WHEN 'BACK'

LEAVE TO SCREEN 0.

WHEN 'EXIT'.

.................

endcase.

6 REPLIES 6

Former Member

Hi,

you need to define a module to process these.

" MODULE EXIT at exit command " in the PAI.

there check the function code and do desired function.

EG:

CASE SY_UCOMM

WHEN 'BACK'

LEAVE TO SCREEN 0.

WHEN 'EXIT'.

.................

endcase.

Venkat_Sesha
Advisor
Advisor
0 Kudos

Hey In the Module USER_COMMAND

wrtie the below mentioned code.

CASE sy-ucomm.

When 'BACK' or 'EXIT' or 'CANCEL'.

Leave to screen 0.

Endcase.

If you assigned the Exit code 'E' for these Function Codes then write the below mentioned code.

Module USER_COMMAND At Exit-Command.

CASE sy-ucomm.

When 'BACK' or 'EXIT' or 'CANCEL'.

Leave to screen 0.

Endcase.

Hope you understand...

Regards,

Bhargav

Former Member
0 Kudos

Hi,

At exit-command will work only if the screen has got mandatory fields. If your screen does not contain any mandatory fields, then normal code will work.

Try this code in PAI of that screen within a module.

case sy-ucomm.
    when 'Back'.
       leave to screen 0.
    when 'EXIT'.
       leave program.

.......

If your screen contains any mandatory fields write the same code as:

module screen AT EXIT-COMMAND.

and inside this module write the same code as given above

Before the code, just in the function keys which you have set in the PF Status. In the exit function key, give the function type as 'E'.

Former Member
0 Kudos

Hi,

you need to write code in PAI , inorder to handle these buttons .

Case sy-ucomm.

when ' BACK' or 'CANC' or 'EXIT'.

leave to screen zero.

endcase.

You need to define Module exit_test at exit command incase you have any mandatory field on that screen

0 Kudos

Have you set your defined status in PBO like:


  SET PF-STATUS 'STATUS_100' EXCLUDING exctab.

Regards,

Christian

Edited by: christian goerke on Jun 27, 2011 2:52 PM

Former Member
0 Kudos

THANK YOU.

SOLVED