on 10-27-2014 6:33 AM
Hi
I have a popup windows with default button. In WDDOBEFOREACTION I need get button ID. When I use
LR_ACTION = LR_API->GET_CURRENT_ACTION( ) - i got a NULL reference.
That I create reference LR_API = WD_THIS->WD_GET_API( ).
In LR_API I have this information, but in:
{O:605*\CLASS=CL_WDR_DELEGATING_VIEW}-ACTION_ACCESSOR
{O:721*\CLASS-POOL=CL_WDR_WINDOW_PHASE_MODEL\CLASS=LCL_BEFORE_ACTION}-IF_WDR_BEFORE_ACTION~CURRENT_ACTION
{O:593*\CLASS=CL_WDR_ACTION}-PARAMETERS
How get "WD_OK" information directly?
Thank you
Hi,
Use subscribe_to_button_event( ) method of window and pass the action name for your button.
If you still want to read the button ID in dobeforeaction, use the below code:
DATA lo_api_controller TYPE REF TO if_wd_view_controller.
DATA lo_action TYPE REF TO if_wd_action.
DATA ls_action TYPE wdr_name_value.
lo_api_controller = wd_this->wd_get_api( ).
lo_action = lo_api_controller->get_current_action( ).
READ TABLE lo_action->parameters INTO ls_action WITH KEY name = 'ID'.
ls_action-value will contain the button ID.
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.
Hi
In my question I attach a pictures. This pictures is from debug mode. I only create
LR_API = WD_THIS->WD_GET_API( ).
and from LR_API in debug view clicking to variable (picture show how) get desired value.
When I debug in c# and I reach desired value (clicking like SAP debug), I only click RMB and use options "Add watch". And whole path to desired value automatically create.
Best regards
Hi,
From the path it's the below code. lo_action contains the instance of cl_wd_action and in that am accessing parameters which is public attribute.
DATA lo_api_controller TYPE REF TO if_wd_view_controller.
DATA lo_action TYPE REF TO if_wd_action.
DATA ls_action TYPE wdr_name_value.
lo_api_controller = wd_this->wd_get_api( ).
lo_action = lo_api_controller->get_current_action( ).
READ TABLE lo_action->parameters INTO ls_action WITH KEY name = 'ID'.
ls_action-value will contain the button ID (WD_OK or other).
hope this helps,
Regards,
Kiran
Hi
Problem is when I have subscribe_to_button_event in MAIN view and NOT in POPUP view.
When I have subscribe_to_button_event in MAIN view - I give get_current_action only in MAIN view.
When I have subscribe_to_button_event in POPUP view - I give get_current_action only in POPUP view.
In my case I have subscribe_to_button_event in MAIN view, but get_current_action in POPUP view give a NULL reference.
This case is desribed in http://scn.sap.com/docs/DOC-48455
But I can't edit cl_wdr_delegating_view class.
Best regards
Hi Smoula,
For your case, you need to save the main view reference of main view in component controller and then get current action of MAIN view
Proceed as below
wd_comp_controller->go_main_view ?= wd_this->wd_get_api( ).
lr_action = wd_comp_controller->go_main_view->get_current_action( ).
Hope this helps you.
Regards,
Rama
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.