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

Custom screen window not getting closed !

Former Member
0 Likes
1,906

I have designed a screen and calling that using call screen XXXX starting at 15 5. Sreen does load up. Upon clicking close button(X mark) on the top right side, window is not getting closed.

I have two more buttons OK and CANCEL in screen, which I designed, on clicking them screen does behave properly,

I searched in SDN but couldnt get much help.

Any idea what am missing ??

Thanks & Regards

Himayat.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,633

Hi,

You have to maintain the exit/cancel or back toolbar button in Standard Function key for your screen PF status. Then this will work. If you want your manually created button will work then you have to maintain those buttons in application tool bar in PF status.

So in your screen XXX, create the module_status_XXX and create an PF status.

And in User command, you have to write code to exit for the buttons u have maintianed for standard function key.

10 REPLIES 10
Read only

Former Member
0 Likes
1,633

Hi,

type your code a bit where you are getting problem. i.e. your user command code.

thanks.

Aswath

Read only

Former Member
0 Likes
1,634

Hi,

You have to maintain the exit/cancel or back toolbar button in Standard Function key for your screen PF status. Then this will work. If you want your manually created button will work then you have to maintain those buttons in application tool bar in PF status.

So in your screen XXX, create the module_status_XXX and create an PF status.

And in User command, you have to write code to exit for the buttons u have maintianed for standard function key.

Read only

0 Likes
1,633

Hi Kaushik,

This is a normal screen which am displaying as

call screen starting 15 5

. In this screen I have some fields and below them ok and cancel buttons for which PAI is triggered properly and necessary coding done. The screen window's close button which exists on the top extreme right (X mark button) when clicked PAI is not getting triggered.

I dont have PF status for this screen as there is no necessity of it.

Thanks & Regards

Himayat

Read only

0 Likes
1,633

Hi,

Please check the ok-code in debugging mode and see if your code is getting triggered. Please make sure you written your code in PAI event with module MODULE cancel_0212 AT EXIT-COMMAND. for an exmaple

PROCESS AFTER INPUT.

MODULE cancel_0212 AT EXIT-COMMAND.

in module MODULE cancel_0212 you write your code.

Regards,

Mohit

Read only

0 Likes
1,633

Hi All,

Thanks for your reply. I could resolve this issue. I created PF status for which window and included cancel option for one of the buttons. After this I could raise PAI in which I could handle the same.

Thanks & regards

Himayat

Read only

0 Likes
1,633

Himayat,

Can you close this thread if you issue is resolved.

Thanks.

Read only

GauthamV
Active Contributor
0 Likes
1,633

You should put your logic in User command of that screen.

For example.


module user_command_0300 input.

  case ok_code.
    
  when 'OK'.

  * give your logic

    when 'CANC'.

  leave to screen 0.

  endcase.

  clear: ok_code.

endmodule.                    

Read only

Former Member
0 Likes
1,633

Hi Gautham,

I already have this code in place,

CLEAR v_ok_code.
  v_ok_code = sy-ucomm.
  CASE v_ok_code.
    WHEN 'CNCL'.
      REFRESH it_input.
      LEAVE TO SCREEN 0.
      WHEN 'TSAVE'.
      PERFORM update_table.
    WHEN OTHERS.
  ENDCASE.

.

The thing is that generally for closing(X mark button on top), we dont do any explicit coding. I see some strange behaviour.

Read only

Former Member
0 Likes
1,633

hi,

ensure that you code in PAI event have the following code

CASE SY-UCOMM.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

WHEN 'EXIT'.

LEAVE TO SCREEN 0.

WHEN 'CANCEL'.

LEAVE TO SCREEN 0.

WHEN 'ACTION'.

        • CODE TO TAKE ACTION STEPS

ENDCASE.

Read only

Former Member
0 Likes
1,633

resolved and mentioned above.