on 06-10-2011 5:12 PM
Dear All,
I want to show the pop up message with the user action, if the user presses 'Yes' then corresponding coding to be executed in the same event itself. i.e. When the ALV event is triggered, on selection of the particular row, a pop up need to be triggered. Based on the user input the same event need to be continued. will it be possible.Please throw some light on this.
I tried with the window manager its bringing the popup but before the popup comes to the screen all the event method is getting executed.
Thanks
Yogesh
Hi Yogeswaran,
You can display popup to confirm window with two buttons YES and NO.
Please check this code to create popup to confirm window.
data lo_window_manager type ref to if_wd_window_manager.
data lo_api_component type ref to if_wd_component.
data lo_window type ref to if_wd_window.
data lo_view_controller type ref to if_wd_view_controller.
data : lt_text TYPE string_table,
ls_text TYPE string.
ls_text = 'You want to cancel changes...Are you sure?'.
INSERT ls_text INTO TABLE lt_text.
* Get Window manager
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->create_popup_to_confirm( text = lt_text
button_kind = if_wd_window=>co_buttons_yesno
message_type = if_wd_window=>CO_MSG_TYPE_WARNING
window_title = 'Information to Confirm...'
window_position = if_wd_window=>co_center ).
lo_view_controller = wd_this->wd_get_api( ).
* creating ok button
lo_window->subscribe_to_button_event(
button = if_wd_window=>co_button_yes
action_name = 'YES'
action_view = lo_view_controller
is_default_button = abap_false ).
lo_window->subscribe_to_button_event(
button = if_wd_window=>co_button_no
action_name = 'NO'
action_view = lo_view_controller
is_default_button = abap_true ).
* Set the height and width here
lo_window->set_window_size( width = '40%' height = '5%' ).
lo_window->open( ).
create two actions with names YES and NO.
On YES onaction write your desired code.
you want to display this popup on selection of row, means write this code ONLEADSELECTION of ALV.
Hope it solves.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kris,
Thanks for your reply. I have written this code already, my problem is I am trying to call the Pop up in the ALV event (ON_CELL_ACTION), when the user presses 'Yes' i need to proceed further in the ALV event itself.. there are some fields need to be hide based on the user input which cannot be written in the ALV...
When i use this Code, its completing all the event method and then a pop up comes.
Hope you understood my problem.
Thanks
Yogesh
Hi Krishna,
Am able to show custom buttons in popup window but am not getting where i have to add my window name to display my custom window ...this is my code which i used to add custom buttons....Please reply me ...
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
DATA lo_window TYPE REF TO if_wd_window.
*DATA lt_buttons TYPE wdr_popup_button_list.
*DATA ls_buttons LIKE LINE OF lt_buttons.
*DATA ls_canc_action TYPE wdr_popup_button_action.
DATA w TYPE REF TO if_wd_window.
DATA:L_TEXT TYPE STRING_TABLE,
ls_text LIKE LINE OF l_text.
DATA:l_api TYPE REF TO if_wd_view_controller.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
move 'Do you want to generate certificate ?' TO ls_text.
APPEND ls_text to l_text.
lo_window = lo_window_manager->create_popup_to_confirm(
text = l_text
button_kind = if_wd_window=>co_buttons_yesno
message_type = if_wd_window=>co_msg_type_question
close_button = ABAP_TRUE
window_title = 'Create Installation Certificate'
* window_name = 'SALES_DETAILS'
window_position = if_wd_window=>co_center
).
l_api = wd_this->wd_get_api( ).
lo_window->subscribe_to_button_event(
EXPORTING
button = if_wd_window=>co_button_yes
* button_text =
* tooltip =
action_name = 'YES'
action_view = l_api " Web Dynpro: View Controller
is_default_button = ABAP_FALSE
).
lo_window->subscribe_to_button_event(
EXPORTING
button = if_wd_window=>co_button_no
* button_text =
* tooltip =
action_name = 'NO'
action_view = l_api " Web Dynpro: View Controller
is_default_button = ABAP_FALSE
).
lo_window->open( ).
Regards
Syed
Hi,
for your requirementd you have to create a view where you have to put your text message, then create the window (e.g. W_POPUP) and embed the view in it. On the view, also create the actions for buttons Yes and No .
After that, on the action you want to call the popup, put this code:
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
DATA lo_window TYPE REF TO if_wd_window.
*DATA lt_buttons TYPE wdr_popup_button_list.
*DATA ls_buttons LIKE LINE OF lt_buttons.
*DATA ls_canc_action TYPE wdr_popup_button_action.
DATA w TYPE REF TO if_wd_window.
DATA:L_TEXT TYPE STRING_TABLE,
ls_text LIKE LINE OF l_text.
DATA:l_api TYPE REF TO if_wd_view_controller.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->CREATE_WINDOW(
window_name = 'W_POPUP'
title = 'Error'
message_display_mode = if_wd_window=>co_msg_display_mode_selected
close_button = abap_true
button_kind = if_wd_window=>CO_BUTTONS_YESNO
message_type = if_wd_window=>co_msg_type_none
default_button = if_wd_window=>co_button_ok
).
lo_window->open( ).
l_api = wd_this->wd_get_api( ).
lo_window->subscribe_to_button_event(
EXPORTING
button = if_wd_window=>co_button_yes
* button_text =
* tooltip =
action_name = 'YES'
action_view = l_api " Web Dynpro: View Controller
is_default_button = ABAP_FALSE
).
lo_window->subscribe_to_button_event(
EXPORTING
button = if_wd_window=>co_button_no
* button_text =
* tooltip =
action_name = 'NO'
action_view = l_api " Web Dynpro: View Controller
is_default_button = ABAP_FALSE
).
lo_window->open( ).
Hope it helps,
Dora
Hi Teodora,
Thanks for replying . I tried this code but am getting error that default button coluld not set . Please check this error.
Error while processing your queryWhat has happened?The URL call http://erpdev.tatahousing.com:8000/sap/bc/webdynpro/sap/zsample01 was terminated because of an error. |
Note
|
Hello team.
I need create a popup to confirm into the ALV Webdynpro once press a toll bar button.
To solve this I create an Enhancenment into the
WebDynpro: SALV_WD_TABLE.
View: VIEW_TABLE
Method: ONACTIONTOOLBAR_FUNCTION_APP
Y create the Actions for ok and cancell button.
For the OK I need the process continue and go to change the trip.
With NO or Cancell button no actions.
Into the ONACTIONTOOLBAR_FUNCTION_APP, the code to call the action is this
WD_COMP_CONTROLLER->R_COMPONENT->IF_SALV_WD_COMPONENT~VIEW_GET( WD_THIS->NAME )->ON_ACTION(
NAME = IF_SALV_WD_COMP_TABLE_UI=>CS_ACTION-TOOLBAR_FUNCTION_APP
T_PARAMETERS = WDEVENT->PARAMETERS ).
But I try used the same code in the Ok Action and not work, because de WDEVENT->PARAMETERS has the popup event.
do you ahve any idea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
did you resolve your problem?
I have the same problem with popup window as you do.
If yes, please tell how did you do it.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Yogesh,
place the code in WDBEFOREACTION method.
Here in this method you can cancel the event navigation as well.. I guess thats what you want.
Regards,
Kunjal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think it is not possible for what you are asking. THE moment popup statement come across doesnot mean THE runtime executes it immediately. Phase model is not completed on THE first event itself. So THE best what you can do is keep THE popup Call as last in THE event handler and rest of THE Logic code it in the popup ok button handler.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>Wow, I've been spoiled by other languages.
It doesn't have anything to do with the language, but the fact that you are doing server side eventing in a web page. You can't stop in the middle of the server side phase model and wait for user input becuase you haven't completed the client response yet.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.