Display Popup Window in WebDynpro Abap

handle PopUp in ABAP

This is a step by step tutorial how to create and display Popup Window in WebDynpro Abap.

Build Popup Window in Webdynpro abap

Step by Step to Create PopUp in WebDynPro

Create a new view with text

and UI elements to display in the popup.

Create a new WINDOW

(type WND_POPUP) to embed into the view

Add ABAP code to create to manage the popup window

  
lr_popup = lr_window_manager->create_window(
  MODAL               = ABAP_TRUE
  window_name         = 'WND_POPUP'  "Name of the window created in the previous step
  TITLE               = 'Title of your PopUp'
  CLOSE_BUTTON        = ABAP_TRUE
  BUTTON_KIND         = if_wd_window=>CO_BUTTONS_YESNO
  MESSAGE_TYPE        = if_wd_window=>co_msg_type_error
  CLOSE_IN_ANY_CASE   = ABAP_TRUE
*MESSAGE_DISPLAY_MODE = MESSAGE_DISPLAY_MODE
  ).

Button Kind : Action

here the different Button Kind you can add:

CO_BUTTONS_OK : OK
CO_BUTTONS_CLOSE : Close
CO_BUTTONS_OKCANCEL : OK, Cancel
CO_BUTTONS_YESNO : Yes, No
CO_BUTTONS_YESNOCANCEL : Yes, No, Close
CO_BUTTON_ABORT : Cancel
CO_BUTTON_RETRY : Repeat
CO_BUTTON_IGNORE : Ignore
CO_BUTTON_OK : Ok
CO_BUTTON_CLOSE : Close
CO_BUTTON_CANCEL : Cancel
CO_BUTTON_YES : Yes
CO_BUTTON_NO : No
CO_BUTTONS_ABORTRETRYIGNORE : Cancel, Repeat, Ignore
CO_BUTTONS_NONE : No Buttons displayed

Set MESSAGE_TYPE

parameter:Message Type : Action

CO_MSG_TYPE_NONE : No message type
CO_MSG_TYPE_WARNING : Warning
CO_MSG_TYPE_INFORMATION : Information
CO_MSG_TYPE_QUESTION : Question
CO_MSG_TYPE_ERROR : Error
CO_MSG_TYPE_STOPP : Cancel

Modal WindowPopUp ABAP WebDynPro

The Result will be something like that?

More Ressource on ABAP WebdynPro PopUp

The Official documentation on Calling a Confirmation Dialog Box on help sap com.

The quickest way to create confirmation Dialog box in ABAP Webdynpro calling the CREATE_POPUP_TO_CONFIRM method of the IF_WD_WINDOW_MANAGER. Without a need to create a separated window, the runtime will do it for you automatically.
( I recommend this method )

– This is an other method to display popup with messages in ABAP WebDynPro using the standard Message_Manager

CALL METHOD lo_message_manager->report_success

– A great post explains, step by step, how to integrate a popup in ABAP Webdynpro.

I recommand reading ( btw, it inspires me writing this post ).
Display popup screen within ABAP Web dynpro

– Here an other excellent scn documents handling PopUp within ABAP WebdynPro : The Four Types of Popup Window

Web Dynpro application to display a Pop-up window on the browser

https://www.youtube.com/watch?v=2P5_1GzOvTw