弹窗提示函数
其大致功能为:
显示确认对话框
在确认对话框中显示指定的文本消息
指定"是"和"否"按钮的标签
根据 用户的选择 执行不同的后续操作
POPUP_TO_CONFIRM_STEP
DATA lv_confirm TYPE I.
CONSTANTS: lc_message TYPE c LENGTH 128 VALUE 'Are you sure you want to proceed?'.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
text_question = lc_message " 对话框消息文本
titlebar = 'Confirmation Dialog' " 对话框标题文本
display_cancel_button = abap_true " 显示“否”按钮
RECEIVING
answer = lv_confirm " 用户选择的结果
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
* error handling, if required
ENDIF.
IF lv_confirm = 1.
* 用户单击了“是”按钮,可以添加执行逻辑
ELSE.
* 用户单击了“否”按钮,取消后续操作等
ENDIF.
answer返回值属性:
The end user’s decision is returned in ANSWER. ANSWER can take the following values:
•“A” = user has chosen Cancel
•“J” = user has confirmed the step
•“N” = user has canceled the step
此外,还有一些其他的类似的系统函数可用于显示对话框,如POPUP_TO_DECIDE、POPUP_TO_CONFIRM、POPUP_TO_TERMINATE等。