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: 

Screen Properties (Close screen).

ronaldo_aparecido
Contributor
0 Kudos
1,354

Good Afternoon.

I have a program , and this program calls a screen .

When this screen appears I can not close.

I click the 'X' button to close but not close. Which attribute of the screen, should I change to fix this?

Thanks Gurus.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
278

Hi Ronaldo,

Did you put a status bar and set status using "set pf-status 'GUI_STAT_NAME' " at PBO?

If yes ; determine at least one function code's type as 'Exit' and handle AT EXIT-COMMAND at PAI,

or write 'LEAVE TO SCREEN 0' or 'LEAVE PROGRAM' in response to one of your button's user command at PAI.

Take a look at :

Using GUI Statuses (SAP Library - ABAP Programming (BC-ABA))

Hope it helps..

5 REPLIES 5

Former Member
0 Kudos
279

Hi Ronaldo,

Did you put a status bar and set status using "set pf-status 'GUI_STAT_NAME' " at PBO?

If yes ; determine at least one function code's type as 'Exit' and handle AT EXIT-COMMAND at PAI,

or write 'LEAVE TO SCREEN 0' or 'LEAVE PROGRAM' in response to one of your button's user command at PAI.

Take a look at :

Using GUI Statuses (SAP Library - ABAP Programming (BC-ABA))

Hope it helps..

karun_prabhu
Active Contributor
0 Kudos
278

Hello Ronaldo.

     If the screen type is Modal dialog,

     you have to activate the GUI status for close icon and then code its business logic in PAI.

Regards.

arivazhagan_sivasamy
Active Contributor
0 Kudos
278

Hi Ronaldo Aparecido,

When we use screen type as model dialog box, we need to use syntax like LEAVE TO SCREEN 0.

Instead of can you use below function module

POPUP_TO_CONFIRM.

Arivazhagan S

Former Member
0 Kudos
278

Hii Rronaldo,

You have to set and activate the PF-STATUS of the screen in PBO of the screen like BACK, EXIT and CANCEL button.

And when the button will be clicked , you have to code in PAI of the screen to come out of the screen.

Suppose you call screen 9000.

MODULE status_9000 OUTPUT.

   SET PF-STATUS 'ZSTATUS'.


ENDMODULE.


double click the ZSTATUS and under Function Keys--->Standard Toolbar , Set the BACK EXIT and CANCEL button. As shown in pics


Now to come out of the screen, code in the PAI of that screen like below,.



MODULE user_command_9000 INPUT.

    DATA ok_code TYPE sy-ucomm.


     CASE ok_code.

          WHEN 'BACK' OR 'CANCEL'.

               LEAVE TO SCREEN 0.

          WHEN 'EXIT'.

               LEAVE PROGRAM.

     ENDCASE.

ENDMODULE.  


Regards

Syed


Former Member
0 Kudos
278

Hi Ronaldo,

As I have understood, The close button is enabled but its function code is not defined for the screen which you want to close. Just define in the PAI:

MODULE USER_COMMAND_1000 INPUT.

CASE SY-UCOMM .

   WHEN 'BACK' OR 'EXIT'.

     LEAVE PROGRAM.

Regards

Purnand