REPORT ztest_cofirm_box.
DATA: gv_answer TYPE char1.
PARAMETERS: p_ttl TYPE char20,
p_quest TYPE char50.
START-OF-SELECTION.
PERFORM confirm_box USING p_ttl
p_quest
CHANGING gv_answer.
CASE gv_answer.
WHEN '1'.
WRITE: / 'YES'.
WHEN '2'.
WRITE: / 'NO'.
WHEN 'A'.
WRITE: / 'CANC'.
WHEN OTHERS.
WRITE: / 'ERROR'.
ENDCASE.
*&---------------------------------------------------------------------*
*& Form confirm_box
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_P_TITLE text
* -->P_P_QUESTION text
* -->P_GV_ANSWER text
*----------------------------------------------------------------------*
FORM confirm_box USING p_p_title TYPE char20
p_p_question TYPE char50
CHANGING p_gv_answer TYPE char1.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = p_p_title
* DIAGNOSE_OBJECT =
text_question = p_p_question
text_button_1 = 'YES'
icon_button_1 = 'ICON_OKAY'
text_button_2 = 'NO'
* ICON_BUTTON_2 =
* DEFAULT_BUTTON =
display_cancel_button = 'X'
* SERDEFINED_F1_HELP =
start_column = 25
start_row = 6
* POPUP_TYPE =
* IV_QUICKINFO_BUTTON_1 =
* IV_QUICKINFO_BUTTON_2 =
IMPORTING
answer = p_gv_answer
* TABLES =
* PARAMETER =
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.
ABAP confirm box 例子
最新推荐文章于 2020-07-13 09:35:26 发布