Function module: Popup_to_confirm

Use the Popup_to_confirm function module to confirm a user selection with a response. The pop-up dialog box has three elements, a title bar, the "text question" and the response. There are 3 and always three responses, normally "yes", "no" and "cancel." You will always pass a text question, and can control the 'Yes' and 'No' answers, although 'Yes' and 'No' are the defaults. You can control the titlebar, but if the parameter is blank, the titlebar assumes the text description of the program.

Available imports/exports/tables

*" VALUE(TITLEBAR) DEFAULT SPACE
*" VALUE(DIAGNOSE_OBJECT) LIKE DOKHL-OBJECT DEFAULT SPACE
*" VALUE(TEXT_QUESTION)
*" VALUE(TEXT_BUTTON_1) DEFAULT 'Ja'(001)
*" VALUE(ICON_BUTTON_1) LIKE ICON-NAME DEFAULT SPACE
*" VALUE(TEXT_BUTTON_2) DEFAULT 'Nein'(002)
*" VALUE(ICON_BUTTON_2) LIKE ICON-NAME DEFAULT SPACE
*" VALUE(DEFAULT_BUTTON) DEFAULT '1'
*" VALUE(DISPLAY_CANCEL_BUTTON) DEFAULT 'X'
*" VALUE(USERDEFINED_F1_HELP) LIKE DOKHL-OBJECT DEFAULT SPACE
*" VALUE(START_COLUMN) LIKE SY-CUCOL DEFAULT 25
*" VALUE(START_ROW) LIKE SY-CUROW DEFAULT 6
*" VALUE(POPUP_TYPE) LIKE ICON-NAME OPTIONAL

tables:
sscrfields. " Fields on selection screens

at selection-screen.
* display a popup window to confirm that they want to update.
if sscrfields-ucomm = 'ONLI' or "User pressed "Execute"
sscrfields-ucomm = 'PRIN'. "User pressed "Execute and Print"
if p_update = 'X'. "If update requested

call function 'POPUP_TO_CONFIRM'
exporting
text_question = text-005 " Are you certain...?
importing
answer = w_answer
exceptions
text_not_found = 1
others = 2.
if sy-subrc <> 0. " Function call failed.
message i000 with text-006. " Func call failed contact IS
stop.
endif.
if w_answer ne '1'.
message i000 with text-007. " Proc cancelled - no update
stop.
endif.
endif. " Update requested
endif. " User pressed 'execute' or 'execute and print

Popups can be annoying, especially for experienced users, so our recommendation is that they be used sparingly.

'


[Our portfolio] [A history of Computers and Networks]
[Perl help] [ABAP help] [MySQL help]
[TCP/IP troubleshooting] [HTML help] [Feedback] [Humor]
Advertise on Golden Ink's Georgia Network


In Association with Amazon.com