10-27-2008 7:57 AM
hi, all
when i called "POPUP_TO_CONFIRM", how can i close the pop up window by clicking the X icon the the right top of the pop up window.
thanks a lot.
10-27-2008 8:15 AM
Just pass the parameter DISPLAY_CANCEL_BUTTON = 'X' (default value) the upper left "x" icon will perform as you required.
Regards
10-27-2008 8:15 AM
Just pass the parameter DISPLAY_CANCEL_BUTTON = 'X' (default value) the upper left "x" icon will perform as you required.
Regards
10-27-2008 8:23 AM
HI,
thanks for your reply.
i have tryed with your approach,and it dose work.
but what if i just want to display 2 buttons in the pop up window,and i still want the X icon works.
how should i implement this?
10-27-2008 8:49 AM
You will have to write your own FMn that displays a popup dynpro, put 2 options in the popup menu, e.g. OKAY and CANC and the upper right cross will link by default to CANC.
Regards
10-27-2008 8:54 AM
hi, Raymond Giuseppi
i got your point.
i am very appreciate if you can give a sample code here.
10-27-2008 8:55 AM
10-27-2008 8:59 AM
Hi david,
Try this
DATA : ANS TYPE CHAR1.
CALL FUNCTION 'POPUP_WITH_2_BUTTONS_TO_CHOOSE'
EXPORTING
* DEFAULTOPTION = '1'
DIAGNOSETEXT1 = 'Choose'
* DIAGNOSETEXT2 = ' '
* DIAGNOSETEXT3 = ' '
TEXTLINE1 = 'Yes or no'
* TEXTLINE2 = ' '
* TEXTLINE3 = ' '
TEXT_OPTION1 = 'Yes button'
TEXT_OPTION2 = 'No button'
TITEL = 'Choose'
IMPORTING
ANSWER = ANS
.
CASE ANS.
WHEN '1'.
WRITE 'Yes'.
WHEN '2'.
WRITE 'No'.
WHEN 'A'.
WRITE 'Cancel'.
ENDCASE.
Regards
05-28-2010 10:16 AM
10-27-2008 8:56 AM
hi,
try to this code
DATA: lt_text type string_table.
DATA: mr_popup_window TYPE REF TO if_wd_window.
pop a confirmation window for display purpose
DATA: l_window_manager TYPE REF TO if_wd_window_manager,
l_cmp_api TYPE REF TO if_wd_component,
l_window TYPE REF TO if_wd_window.
l_cmp_api = wd_comp_controller->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
append 'DO YOU WANNA SAVE DATA' to lt_text.
CALL METHOD l_window_manager->create_popup_to_confirm
EXPORTING
text = lt_text
button_kind = if_wd_window=>CO_BUTTONS_YESNO
CLOSE_BUTTON = ' '
WINDOW_TITLE = 'WINDOW TITLE'
WINDOW_WIDTH = '25'
WINDOW_HEIGHT = '50'
WINDOW_LEFT_POSITION = 10
WINDOW_TOP_POSITION = 10
WINDOW_POSITION = '25'
RECEIVING
result = mr_popup_window .
associated the action handling methods with the window
DATA: view_controller TYPE REF TO if_wd_view_controller.
view_controller = wd_this->wd_get_api( ).
CALL METHOD mr_popup_window->SET_WINDOW_SIZE
EXPORTING
WIDTH = '150'
HEIGHT = '150'.
CALL METHOD mr_popup_window->subscribe_to_button_event
EXPORTING
button = if_wd_window=>co_button_yes
action_name = 'ON_DELETE_POPUP_YES'
action_view = view_controller .
CALL METHOD mr_popup_window->subscribe_to_button_event
EXPORTING
button = if_wd_window=>co_button_no
action_name = 'ON_DELETE_POPUP_NO'
action_view = view_controller
is_default_button = abap_true .
mr_popup_window->open( ).
10-27-2008 9:00 AM
hello , do you know the code what exacly it does. this code is related to webdynpro. it is not related to Normal ABAP. did you test that code..
please try to crosscheck it once. i know from where you got this.
10-27-2008 9:06 AM
Hi,
Sorry Previously iwas send a wrong code to you.
correct code.......
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = ''
text_question = ''
text_button_1 = 'Yes'(002)
icon_button_1 = 'ICON_TRANSFER'
text_button_2 = 'No'(003)
icon_button_2 = 'ICON_STORNO'
default_button = '1'
display_cancel_button = 'X'
popup_type = 'ICON_WS_TRANSFER'
IMPORTING
answer = answer.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
regards
kk
Edited by: kk on Oct 27, 2008 2:36 PM