SAP DIALOG PROGRAMMING: How to trigger the small "X" button in the upper right of a popup screen?

While developing a program, I need to show a pop screen. Normally, I do this way.


However, I have a problem on how to trigger this small "x" button at the upper right of the screen like this one below.

Since I was puzzled how it was done, I did some research and testing, I found the solution which I will detailed below. This are simple steps to implement such functionality in sap dialog programming.

1. Set your pop up screen as a modal dialog box. Never select it as a normal. For you to set it, go to SE80 then select screen from the nodes at the left part. Once done, click on the attribute tab and there you will see the screen type of the screen.

2. Create a PF-STATUS which is Dialog Box type.

3. Then inside this status, there are two default command. One for the ok/continue and one for the exit/cancel command. So I used here the cancel command for the "x" button.

4. In the PAI of your pop up screen, catch the sy-ucomm. In this example I used CANCEL.After that, activate and run your program. Be sure to put a debug point in the PAI so that when you hit the small "x" button, it will stop into your PAI.

I hope I share again a simple tip to everyone on how to trigger the small exit button in a pop up screen using sap dialog programming. For any comments and suggestions, you may leave it below and I am happy to hear from you.

Enjoy... :)

No comments:

Post a Comment

How to download the data structure of tables in SE11?

Good morning people around the world. Its me again doing some blogs. Sharing to you some tips and tricks in the SAP world. Well, before I s...