A pop-up dialog box is often required in SAP to remind customers whether they want to perform an operation. We can call function 'popup _ to_confirm'
The following describes common parameters.
DATA: G_RETURN type c.
Call function 'popup _ to_confirm'
EXPORTING
* TITLEBAR = 'pop-up title'
* DIAGNOSE_OBJECT = ''" diagnostic text (maintained by SE61)
Text_question =
* TEXT_BUTTON_1 = 'text on the first button'
* ICON_BUTTON_1 = 'icon on the first button'
* TEXT_BUTTON_2 = 'text on the second button'
* ICON_BUTTON_2 = 'icon on the first button'
* DEFAULT_BUTTON = '1'
* DISPLAY_CANCEL_BUTTON = 'X'
* USERDEFINED_F1_HELP =''
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
* IV_QUICKINFO_BUTTON_1 =''
* IV_QUICKINFO_BUTTON_2 =''
IMPORTING
ANSWER = G_RETURN "return parameters: click the first button to return '1'," click the second button to return '2 ',
"Click the third button to return to 'A ',
* TABLES
* PARAMETER =
* EXCEPTIONS
* TEXT_NOT_FOUND = 1
* OTHERS = 2
.
My simple usage is as follows:
* ** In the pop-up window, check whether the delete operation is performed.
CONCATENATE 'Are you sure you want to delete the data' INTO g_string1. "prompt message
Call function 'popup _ to_confirm'
EXPORTING
Text_question = g_string1
IMPORTING
Answer = g_return.
IF g_return = '1 '.
MODIFY TABLE_NAME from table TABLE_WA. "confirm operation
MESSAGE 'deletion operation confirmed! 'Type '.
ELSEIF g_return = '2' OR g_return = 'a '.
MESSAGE 'deletion operation canceled! 'Type '.
ENDIF.
ENDIF.
Result chart:
Attached function parameter diagram:
Function-'popup _ to_confirm'