on 02-28-2014 8:44 PM
Hi Gurus,
We have two windows(each window have separate view),Now iam calling one window(view1) to
another window(view2) by using CREATE_AND_OPEN_POPUP,whenever the 2nd window(along with 2nd viw\ew) opens
one OK button is coming on that popup,Now how to handle this popup .Any one could u please suggest me the solution
below is the code am using....
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_CANC_ACTION TYPE WDR_POPUP_BUTTON_ACTION.
Data ls_buttons like LINE OF LT_BUTTONS.
Data ls_CANCEL_ACTION type WDR_POPUP_BUTTON_ACTION.
ls_buttons-BUTTON = '7'.
ls_buttons-BUTTON = '8'.
append ls_buttons to lt_buttons.
ls_CANCEL_ACTION-ACTION_NAME = 'OK'.
LO_API_COMPONENT = WD_THIS->WD_GET_API( ).
LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
* create the cancel icon, but without any action handler
LS_CANC_ACTION-ACTION_NAME = 'OK'.
* Simple example, see docu of method create_and_open_popup for details
LT_BUTTONS = LO_WINDOW_MANAGER->GET_BUTTONS_OK(
default_button = if_wd_window=>co_button_ok
).
LO_WINDOW = LO_WINDOW_MANAGER->CREATE_AND_OPEN_POPUP(
WINDOW_NAME = 'INVOICES_WIN'
title = 'Bill Initiation Process'
MESSAGE_TYPE = IF_WD_WINDOW=>CO_MSG_TYPE_NONE
MESSAGE_DISPLAY_MODE = IF_WD_WINDOW=>CO_MSG_DISPLAY_MODE_SELECTED
* is_resizable = ABAP_TRUE
BUTTONS = LT_BUTTONS
CANCEL_ACTION = LS_CANC_ACTION
).
Hi Kranthi,
Use the method: SUBSCRIBE_TO_BUTTON_EVENT( ).
Logic to be implemented below your code:
Data: lr_view_controller TYPE REF TO if_wd_view_controller.
lr_view_controller = wd_this->wd_get_api( ).
CALL METHOD lo_window->subscribe_to_button_event " register event before opening window
EXPORTING
button = if_wd_window=>co_button_ok
action_name = 'OK' " You have to create action OK in Actions tab & write req handling
action_view = lr_view_controller.
Thanks & Regards,
Sankar Gelivi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank you kirankumar,ramakrishnappa,sankar ....
Iam writing the above code in compoent level.So it is throwing syntax error for the below statement.
lr_view_controller = wd_this->wd_get_api( ).
It might be throwing becoz we are not maintaing view controller reference.So how we can maintain view conctroller reference in component controller...
Thanks in advance....
Regards,
kranthi
Hi,
Go to attributes tab of Component controller and create an attribute, say, gv_view_controller of type ref to if_wd_view_controller.
Then in WDDOINIT method of your view, set the reference, using
wd_comp_controller->gv_view_controller = wd_this->wd_get_api( ).
Then pass wd_this->gv_comp_controller to the subscribe to button event method in Component controller,
Or, If you are calling the component controller method from View, create an importing parameter in the component controller method and pass the view controller reference.
Regards,
Kiran
Hi Ram,
Thanks for replying early.. my req is i have created button( CORPORATE ) on cnr_view when i click on that i want to display my custom WD Application..in my CNR_VIEW methods i have a method as BUTTON_PRESSED which is standard method, when user click on any button like CORPORATE it trigger to BUTTON_PRESSED method..here am writing my own logic in post_exit of BUTTON_PRESSED method there i have to read event id of which button is pressed by the user.
Regards
Syed
Hi Syed,
The method BUTTON_PRESSED( ) is called from on action BUTTON_PRESSED and event reference is passed to parameter io_event
Now, you can get the event id as below
data lv_action_id type string.
lv_action_id = io_event->get_string( 'ACTION_ID' ).
Hope this helps you.
If you still need further assistance on the same please create a new question, as this discussion is of different topic.
Regards,
Rama
HI Ram,
I already used this code
data lv_action_id type string.
lv_action_id = io_event->get_string( 'ACTION_ID' ).
but am getting error that io_event is unknown and i have to pass ACTION_ID is my button id name or button name.
I don't want to pass event id directly ...i have to read when user perform some action on particular button then only i have to trigger my logic.
Hi kiran n ramakrishna,
Apart from "OK"(am using this as SUBMIT) button i need to add one more button like cancel(for reject purpose).How we can add this extra button and we need to do some rejection functionality in this button ...
Can anyone could lz suggest me the solution..thanks in advance...
Regards,
kranthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
kranthi kumar wrote:
Apart from "OK"(am using this as SUBMIT) button i need to add one more button like cancel(for reject purpose).How we can add this extra button and we need to do some rejection functionality in this button ...
Can anyone could lz suggest me the solution..thanks in advance...
You can make use of buttons IF_WD_WINDOW=>CO_BUTTONS_OKCANCEL,
Please find the answer in the below link.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use SUBSCRIBE_TO_BUTTON_EVENT method of window before opening window.
Use Create_window method.
Code Snippet:
DATA lr_window_manager TYPE REF TO if_wd_window_manager.
DATA lr_api_component TYPE REF TO if_wd_component.
DATA lr_window TYPE REF TO if_wd_window.
data lr_view_controller TYPE REF TO if_wd_view_controller.
lr_api_component = wd_comp_controller->wd_get_api( ).
lr_window_manager = lr_api_component->get_window_manager( ).
lr_window = lr_window_manager->create_window(
window_name = 'INVOICES_WIN'
message_display_mode = if_wd_window=>co_msg_display_mode_selected
button_kind = if_wd_window=>co_buttons_ok
message_type = if_wd_window=>co_msg_type_none
default_button = if_wd_window=>co_button_ok
).
lr_view_controller = wd_this->wd_get_api( ).
CALL METHOD lo_window->subscribe_to_button_event " register event before opening window
EXPORTING
button = if_wd_window=>co_button_ok
action_name = 'OK' " You have to create action OK in Actions tab & write req handling
action_view = lr_view_controller.
lo_window->open( ).
Hope this helps u,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
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.