CL_WD_CUSTOM_EVENT
Hi,
When sorting a table in WD, I found a post here in SDN with:
l_col_name = wdevent->get_string( 'COLUMN' ).
l_sort_direction = wdevent->get_string( 'DIRECTION' ).
It works perfect for me, but I need to know where the 'COLUMN' and the 'DIRECTION' came from? I need to know if there is anymore parameters I can choose from, and if using another event, instead onSort, how can I find those parameters?
Thanks,
Erick
Hi Erick,
Great to hear that you like the one-step param mapping feature.
Regarding the COL param: Up to an earlier SP there had only been the COLUMN parameter. That was actually a bug as the spec says it had to be called COL. We fixed it later on by introducing that missing COL parameter without deleting the existing COLUMN one in order continue supporting existing applications.
Best regards,
Thomas
Similar Messages
-
How to populate value in parmetters
Hi
data: wdevent TYPE REF TO CL_WD_CUSTOM_EVENT.
call method onactionsearch( exporting wdevent = wdevent ).
there are two fields in interface of cl_Wd_custom_Event .. . name and parameterdata: wdevent TYPE REF TO CL_WD_CUSTOM_EVENT.
call method onactionsearch( exporting wdevent = wdevent ).
Well, I am not sure what you are trying to do here, but definitely this is not correct approach. WDEVENT object is passed implicitly to event handler of your custom event. Such events are used to communicate various controllers (including cross-component comunication if event is an component interface one).
This simply means that if you have your event and you raise it in some method by fire_my_event method you pass only the parameters expected to this event. The handler expects then to receive this event wdevent object + all parameters you have passed along with it. If you miss these parameters in handler signature (statically unknown) you can detemine them during runtime (using wdevent object). So no explicit transfer of wdevent object should be ever done. You get this object implicitly added to handler method as an importing parameter. Whether you use it or not, depends on how you want to handle the event itself. Then you do the eveluation of its attributes parameters and name values but using corresponding method.
I think this [link|http://help.sap.com/saphelp_nw70/helpdata/en/eb/ed6f4169e25858e10000000a1550b0/frameset.htm] is what you need to go through to understand the concept entirely.
Regards
Marcin -
Any other ways to get parameters of a URL in a window method ?
Hi,
In SDN, i find the below two ways to extract the URL parameters, when i pass them while opening a new window. But, unfortunately they dont work for me. so, would like to know, if any other ways are existing to extract the URL parameters.
1)
HANDLEDEFAULT method of the window:
DATA: lt_url_parameters TYPE tihttpnvp.
wdevent->get_data(
EXPORTING
name = if_wd_application=>all_url_parameters
IMPORTING
value = lt_url_parameters ).
2) In HANDLEDEFAULT method, have the URL parameter names as importing parameters and use them normally.
If there is no other ways, can some one help me in pointing the issue that i face ?
Note: I have wdevent (CL_WD_CUSTOM_EVENT) importing parameter in place.
Thanks in advance,
Gaurav.Hi,
How you are trying to pass your parameters ? I believe you are using some SAP provided template (like for XSS) and relying on passing of some standard parameters. These parameters may be absorbed by the standard component and may not be passed to your WebDynpro Component. You can try passing them as application parameters.
Thanks
Prashant -
How to activate a custom datasource of a view
Hello folks,
I'm working on BI 7.0 and ECC 6.0.
I've created a z datasource on a view. It appears in RSA6. It is not visible in RSA5 which means I cannot activate it. When I replicate the datasource in BW, it appears as a modified version and not as an active one. How do I activate this z datasource? Please note that I'm working on BI 7.0 and ECC 6.0. I would appreciate it if someone could throw light on this one.
Thanks
BGdata: wdevent TYPE REF TO CL_WD_CUSTOM_EVENT.
wd_this->CREATE_A ( exporting wdevent = wdevent ).
wd_this->CREATE_B ( exporting wdevent = wdevent ). -
How to call a custom method of same view?
Hello
I am developing a WDA on ABAP. I kept 3 LTA (Link To Action, kind of hyper link) on the initial_view, they perform the below functions (pls. note all the below 3 are on the initial_view ONLY),
1) LTA_1 -> Creates 'A' -> The linked EVENT for this LTA is CREATE_A
2) LTA_2 -> Creates 'B' -> The linked EVENT for this LTA is CREATE_B
3) LTA_3 -> Creates 'A' and 'B' -> The linked EVENT(onAction) for this LTA is CREATE_A_and_B, fine.
I wrote the ABAP code for creating the 'A' for LTA_1 in the associated Event Handler(method), same way i did for B
Now, for LTA_3 (Event is CREATE_A_and_B), i do not want to replicate the code from LTA_1 and LTA_2.
1) So, i guess, i just call the above )Event Handler) methods sequentially in CREATE_A_and_B's ABAP editor, am i right?
2) If so, pls. let me know how to call these methods, say, just for A, so that i will call for B on my own. Normally, we call as below
my_Class->my_method_name
3) If so, there is not-optional parameter as WDEVENT, just i need to pass blank for it?
Thank youdata: wdevent TYPE REF TO CL_WD_CUSTOM_EVENT.
wd_this->CREATE_A ( exporting wdevent = wdevent ).
wd_this->CREATE_B ( exporting wdevent = wdevent ). -
How to handle the dynamic rows in pdf table
Dear All,
earlier i posted one thread reagarding getting pdf table data
[facing problem while getting interactive form table data;
this is working fine, i sued bind_table in wddoinit, but here i am fixing the rows count and bind_table.
for example i have initially taken row count as 3 then i want to increase the rows in pdf table.
i know we can use the formcalc to increase the rows by taking a button in pdf layout.
this also working, but the data is not picking for newly added rows, i hope the problem is because the table node in the context is not binded for this new rows.
even i tried using with webdynpro native button controlls still not working.
any one help me what exactly this bind_table is doing and how to handle this code in form calc.
since my table is pdf table.
Thanks,
Mahesh.GattuHi Thomas,
Thanks for your confirmation,
i have checked the paramets of submit button we have only wdevent parameters they are
CL_WD_CUSTOM_EVENT
PARAMETERS - Hashed table having 2 columns
ID ->IF_TDS (Interactive Form element Name)
CONTEXT_ELEMENT ->->
these are same in case of submit button1 and submit button 2.
NAME - Name of the Button Event i.e ON_SUBMIT ( this is also same in both the buttons).
so i think it is not possible to work with multiple buttons by assinging to multiple tables on form.
The other option is to place the buttons outside of the forum in the surrounding WDA area.
This way you have no problem handling the events.
in wddoinit if i use bind_table with 5 rows form table is populating with 5 rows, but when i take a button
out side the form and use bind_table by incremeting the rows the pdf table rows are not adding, if i enter
some thing on pdf table then click on add row button then the table rows are getting add. if i don't do any
action on pdf table and click on add row button pdf is not getting update.
is there any issue.. if i don't keep cursor on table and type some thing.. the add button is not updating
the rows.
if i take a button on wd view i.e outside the form and use bind table i shall add the rows.. but in case of remove rows how to do.
in case of normal table we can use Remove_Element( ) but how can i know the selected row from the pdf table, please help me in this concern also.
Regards,
Mahesh.Gattu
Edited by: Maheshkumar gattu on Jan 7, 2009 3:57 PM
Edited by: Maheshkumar gattu on Jan 7, 2009 4:03 PM
Edited by: Maheshkumar gattu on Jan 7, 2009 5:21 PM -
ABAP: Get super container of DROP_DOWN_BY_KEY
Hello,
I have some dynamic behavior on the screen that I am working on:
Transparent containers generated dynamically. Each of newly generated containers has a DROP_DOWN_BY_KEY.
When a user selects an item from that DROP_DOWN_BY_KEY I need to get reference to a container where this DROP_DOWN_BY_KEY is in.
Parameter WDEVENT of type CL_WD_CUSTOM_EVENT can access the following methods:
CONSTRUCTOR
GET_NAME
GET_BYTE
GET_CHAR
GET_FLOAT
GET_INT
GET_OBJECT
GET_STRING
GET_CONTEXT_ELEMENT
GET_DATA
Which one should be used to get reference to the container?
Is there a different way?
Thank you.Hello Armin,
It is a looooong way to wite it all up.
Shortly, there is a DROP_DOWN_BY_KEY that generates elements (input fields, DROP_DOWN_BY_KEYs, etc.). Each drop down should be able to change some elements that correspond to this drop down.
In order to know which elements shold be modified/touched I need to have a reference from each drop down to elements that correspond to each of the drop downs.
For example:
DROP_DOWN_ONE: element one, element two, element three
DROP_DOWN_TWO: element five, element six, element seven
DROP_DOWN_THREE: element eight, element nine element ten
DROP_DOWN_FOUR: element eleven, element twelve, ...
Each drop down with corresponding elements resides in individual transparent container.
so when a user selects some option from DROP_DOWN_THREE it should access only the following elements:
element eight, element nine element ten
I was thinking to get those elements from action since they reside in individual containers. Something like:
actionNAME->getParentUIElement ...
Thank you. -
Key Board command Enter not working
Hello all,
I have a requierement
After a user has entered in the required search data, the user must click the search button to activate the search.
the search function should be enter enabled (user can use "enter" button on keyboard).
How can we achieve this in webdynpro view.Hi Shilpi Agarwal,
You can give the ONENTER action for your input fields where you enter the data and call the button event
from that action as below.
method ONACTIONENTER .
data lr_event type ref to cl_wd_custom_event.
wd_this->onactionbuttonclick( " This method is the one created for your button click
wdevent = lr_event
endmethod. -
How to display Popup message in ABAP Web Dynpro
Hi All,
Is it possible to display popup messages like SAP to collect information from the user? is it possible to display information messages like SAP? If possible, Please let me know how to handle in Web Dynpro.
Thanks & Regards,
IA Kumar.Agree with the two firend on my head :).
you can find a demo from: SWDP_TEST(package)--> WDR_TEST_POPUPS also.
I have a lazy idea, two step:
1. create a popup function module;
2.call the function module;
function module:--Begin--
FUNCTION ZFUNM_CONFIRM .
""Local interface:
*" IMPORTING
*" REFERENCE(P_API) TYPE REF TO IF_WD_VIEW_CONTROLLER
*" REFERENCE(P_CMP_API) TYPE REF TO IF_WD_COMPONENT
DATA:
L_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER,
L_CMP_API TYPE REF TO IF_WD_COMPONENT,
L_API_MAIN TYPE REF TO IF_WD_VIEW_CONTROLLER,
L_POPUP TYPE REF TO IF_WD_WINDOW,
L_TEXT TYPE STRING_TABLE.
wd_this type ref to IF_MAIN,
wd_comp_controller TYPE REF TO IG_COMPONENTCONTROLLER.
l_api_main = wd_this->wd_get_api( ).
l_cmp_api = wd_comp_controller->wd_get_api( ).
L_WINDOW_MANAGER = P_CMP_API->GET_WINDOW_MANAGER( ).
APPEND 'POPUP text' TO L_TEXT.
L_POPUP = L_WINDOW_MANAGER->CREATE_POPUP_TO_CONFIRM(
TEXT = L_TEXT
BUTTON_KIND = 4
MESSAGE_TYPE = 1
CLOSE_BUTTON = ''
WINDOW_TITLE = 'messagebox Title'
WINDOW_LEFT_POSITION = L_CONF_CONTEXT-WINDOW_LEFT_POSITION
WINDOW_TOP_POSITION = L_CONF_CONTEXT-WINDOW_TOP_POSITION
WINDOW_POSITION = L_CONF_CONTEXT-WINDOW_POSITION
WINDOW_WIDTH = L_CONF_CONTEXT-WINDOW_WIDTH
WINDOW_HEIGHT = L_CONF_CONTEXT-WINDOW_HEIGHT
L_POPUP->SUBSCRIBE_TO_BUTTON_EVENT(
BUTTON = IF_WD_WINDOW=>CO_BUTTON_YES
ACTION_NAME = 'YES'
ACTION_VIEW = P_API
IS_DEFAULT_BUTTON = ABAP_TRUE ).
L_POPUP->SUBSCRIBE_TO_BUTTON_EVENT(
BUTTON = IF_WD_WINDOW=>CO_BUTTON_NO
ACTION_NAME = 'NO'
ACTION_VIEW = P_API
IS_DEFAULT_BUTTON = ABAP_FALSE ).
L_POPUP->OPEN( ).
ENDFUNCTION.
function module:--End--
call the function module Begin----
METHOD ONACTIONDELETE .
DATA:
L_API TYPE REF TO IF_WD_VIEW_CONTROLLER,
L_CMP_API TYPE REF TO IF_WD_COMPONENT,
NODE_ZTAB_PROJ TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_ZTAB_PROJ TYPE REF TO IF_WD_CONTEXT_ELEMENT,
STRU_ZTAB_PROJ TYPE IF_ZV_PROJ_DISPLAY=>ELEMENT_ZTAB_PROJ,
SELECTED_ELEM TYPE WDR_CONTEXT_ELEMENT_SET .
navigate from <CONTEXT> to <ZTAB_PROJ> via lead selection
L_API = WD_THIS->WD_GET_API( ).
L_CMP_API = WD_COMP_CONTROLLER->WD_GET_API( ).
CALL FUNCTION 'ZFUNM_CONFIRM'
EXPORTING
P_API = L_API
P_CMP_API = L_CMP_API.
IF WD_THIS->A_DEL = ''.
EXIT.
ENDIF.
NODE_ZTAB_PROJ = WD_CONTEXT->GET_CHILD_NODE( NAME = IF_ZV_PROJ_DISPLAY=>WDCTX_ZTAB_PROJ ).
IF ( NODE_ZTAB_PROJ IS INITIAL ).
EXIT.
ENDIF.
ELEM_ZTAB_PROJ = NODE_ZTAB_PROJ->GET_LEAD_SELECTION( ).
ELEM_ZTAB_PROJ->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = STRU_ZTAB_PROJ ).
DELETE FROM ZTAB_PROJ
WHERE COMCODE = STRU_ZTAB_PROJ-COMCODE
AND PROJID = STRU_ZTAB_PROJ-PROJID.
WD_THIS->ONACTIONSELECT(
WDEVENT = WDEVENT " Ref to cl_Wd_Custom_Event
LOOP AT selected_elem .
ENDLOOP.
ELEM_ZTAB_PROJ
@TODO handle not set lead selection
alternative access via index
Elem_Ztab_Proj = Node_Ztab_Proj->get_Element( Index = 1 ).
@TODO handle non existant child
if ( Elem_Ztab_Proj is initial ).
endif.
get all declared attributes
ELEM_ZTAB_PROJ->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = STRU_ZTAB_PROJ ).
ENDMETHOD.
call the function module End---- -
How to throw and handle event defined in component interface
Hi folks,
I have defined a component interface with an event 'open_info'
I have some sub components which are implementing that component interface. I also get the two events generated (the interface check box is not marked)
I use those sub components and try to handle the event. but unfortunately the event is not handled.
I'm not sure if I do everything right. I checked the interface checkbox at the events tab of the controller of the sub component. I then may handle the event in the embedding main component. but it appears to be a different event.
probably I eed to access the interface controller and throw the event there, but I don't know how.
I couldn't fnd documentation or wdr* components which deal with that issue. do you have any suggestions?
regards
stefanHi Stefan,
Do the following in the component being used:
say component name is ZCMP_01
go to COMPONENTCONTROLLER
Create an Event with necessary parameters if needed, say Event name is EVNT_01 and has an importing parameter, say PARAM_01 type char10,
Make sure you have set the interface check box. Now this event is available in the INTERFACECONTROLLER.
Say ZCMP_01 has a view with a button, on click of the button, call a method in the COMPONENTCONTROLLER.
Perform all the required operations, At the required point, fire EVNT_01
wd_this->fire_EVNT_01_evt(
PARAM_01 = 'sample' ).
Now the other component that has to use ZCMP_01, say ZCMP_02
In the component properties od ZCMP_02, add usage for ZCMP_01, say USG_CMP_01
Go to the view in ZCMP_02 where you wish to handle the event EVNT_01 of ZCMP_01,
Go to Methods tab, create an event hadler, say EVNT_01_HNDLR ... method type = Event Handler,
Event = EVNT_01, Controller = INTERFACECONTROLLER, Component Use, USG_CMP_01.
Now your event handler will have foll parametrs: WDEVENT .. type ref to CL_WD_CUSTOM_EVENT,
PARAM_01 type CHAR10
Handle the event as required.
Regards,
Reema. -
Hi,
I need to get the index of a specific line in a table. Selection mode is set to none. The first column contains a menu with two menuActionItems. When I choose an actionitem my event handler is called with parameter WDEVENT TYPE CL_WD_CUSTOM_EVENT. As I understand you have to use this parameter to get the index from the table line.
I have tryed with the following code in my event handler method:
DATA:
node_lines TYPE REF TO if_wd_context_node,
elem_lines TYPE REF TO if_wd_context_element,
l_index TYPE i.
elem_lines = wdevent->get_context_element( name = 'LINES' ).
l_index = elem_lines->get_index( ).
This does not work. The elem_lines is initial after I try to get it.
Hope that someone can guide me in the right direction.
Thanks,
Mortenhi ;
this will work
DATA: mod_cell TYPE salv_wd_t_table_mod_cell,
wa_mod_cell TYPE LINE OF salv_wd_t_table_mod_cell,
msg TYPE string.
mod_cell = r_param->t_modified_cells.
wd_comp_controller->set_material_dtl( ).
LOOP AT mod_cell INTO wa_mod_cell.
msg = wa_mod_cell-index .
msg = mod_cell-index .
l_message_manager->report_success( msg ).
Or else try this.
wd_event is return parameter
data: index type i.
index = wd_event->get_context_elementget_index->get_index( ). -
How to handle events in webdynpro abap
Hi,
can any body explain how to handle the events in webdynpro abap.
i want to know some concepts in general.
Thanks,Hi Mahesh,
you can create event handlers under the actions tab in you view. evry event handler has an importing parameter wdevent of type ref to cl_wd_custom_event.
you can also create events in your component controller and they can be handled within your views
check cl_wd_custom_event class for details about what all information you get when an event occurs.
for further details you can check out the following links
http://help.sap.com/saphelp_nw04s/helpdata/en/eb/ed6f4169e25858e10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/a9/c751415e3b6532e10000000a1550b0/frameset.htm
also you can try the tutorial at the following link for further clarity
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2eb11b59-0a01-0010-dfa3-8292abdf9c4f
Regards,
Shweta
Message was edited by:
Shweta R Shanbhag -
Select options default value and execute
Hello,
I managed to fill my select options default value. But what I also want is that the user does not have to press the execute button when the screen is shown at the first time. I would like to show the result screen for these default values at the same time the screen is shown first.
I tried in WDDOINIT:
data: l_ref_interfacecontroller type ref to iwci_wdr_select_options .
l_ref_interfacecontroller = wd_this->wd_cpifc_select_options( ).
l_ref_interfacecontroller->execute(
but this coding only works when the select-option screen was shown the first time.
Any ideas?
regards
stefanHello Sascha,
I checked that WD_THIS->MR_SELOPT is filled.
My coding in WDDOINIT is:
*--- Instantiate select options component
lr_usage = wd_this->wd_cpuse_usage_so( ).
if lr_usage->has_active_component( ) is initial.
lr_usage->create_component( ).
endif.
*--- Initialize selection screen
lr_if_controller = wd_this->wd_cpifc_usage_so( ).
wd_this->mr_selopt = lr_if_controller->init_selection_screen( ).
*--- Configure layout options
wd_this->mr_selopt->set_global_options(
i_display_btn_cancel = abap_false
i_display_btn_check = abap_false
i_display_btn_reset = abap_true
i_display_btn_execute = abap_true ).
*--- Create range tables
lt_range = wd_this->mr_selopt->create_range_table(
i_typename = 'DATUM' ).
*Range vorbelegen
wa_dats = sy-datum - 30.
wa_range_datum-sign = 'I'.
wa_range_datum-option = 'BT'.
wa_range_datum-low = wa_dats.
wa_range_datum-high = sy-datum.
assign lt_range->* to <fs_rangetable>.
create data r_headerline like line of <fs_rangetable>.
assign r_headerline->* to <fs_range>.
move-corresponding wa_range_datum to <fs_range>.
append <fs_range> to <fs_rangetable>.
wd_this->mr_selopt->add_selection_field( i_id = 'DATUM'
it_result = lt_range ).
lt_range = wd_this->mr_selopt->create_range_table( i_typename = 'UZEIT' ).
wd_this->mr_selopt->add_selection_field( i_id = 'UZEIT'
it_result = lt_range ).
lt_range = wd_this->mr_selopt->create_range_table( i_typename = 'UNAME' ).
wd_this->mr_selopt->add_selection_field( i_id = 'UNAME'
it_result = lt_range
i_no_intervals = 'X'
i_no_extension = 'X' ).
data: event type ref to cl_wd_custom_event.
create object event
exporting
name = 'EXECUTE'
parameters =
wd_this->search_sel_opt(
wdevent = event " Ref to cl_Wd_Custom_Event
Maybe you can see my mistake?
regards
stefan -
Trigger an action from my view
I have a button on my view called BTN_CHECK. The button has associated the action "CHECK".
At this moment i need to trigger the same action of the button (and reuse the code) from wddomodifyview method.
I have find how to make it in SDN but i haven't found yet
ThanksYes. i approve what Anurag Chopra said..
Better choice to separate the coding in one independent method. Then in the event handler or other methods call the independent method easily..
However, if you indeed want to call the action handler, you must create the WDEVENT firstly and correctly..
Just like this:
data:LO_EVENT TYPE REF TO CL_WD_CUSTOM_EVENT.
CREATE OBJECT LO_EVENT EXPORTING NAME = ''. "PARAMETERS should be right
"ok, call the action
wd_this->ONACTIONBTN_SAVE( LO_EVENT ).
BTW, i don't think this is a good solution.
Best wishes. -
Explicitly call the Event Handler method
Hello Friends,
Is it possible to explicitly call the eventhandler method `? or dynamically fire/invoke the event so that particular eventhandler method should be called ?
Regards,You should call eventhandler as follows
DATA lr_event TYPE REF TO cl_wd_custom_event.
**Create event object
CREATE OBJECT lr_event
EXPORTING
name = 'ON_SELECT'. " give your event name which appears in wdevent in your handler method
* Call eventhandler
wd_this->onactionsel_rdb(
wdevent = lr_event " ref to cl_wd_custom_event
Maybe you are looking for
-
How do I reset the furthest page read in iBooks from an HTML Widget?
Our training department just got a bunch of iPads and I'm writing some custom HTML widgets for iBooks for them for testing, in-class activities, etc. On the last page I have a link to clear all the forms and return to the first page. Like this: <a h
-
I have a brand new macbook with microsoft office loaded. I set outlook as the default mail. i would rather go back to mac mail but can't figure out how to do it. any ideas? Thanks for any help Lou
-
CS3 JS create textFrame with label then change content at a later stage.
Is it possible to select a textframe by label? Here is a simple script which creates 2 text boxes labeled JSLabel and JSLabel2. var myDocument = app.documents.add(); var myTextFrame = myDocument.pages.item(0).textFrames.add(); myTextFrame.geometricBo
-
i had an apple iphone 4s which broke under warranty i took it to apple who replaced how do i get proof of this from apple for my insurance claim
-
Cheque information add in FBL3N
Hi Experts, Please suggest me.I go through spro:financial accounting ( new)->general ledger accounting (new)->master data->g/l accounts->line items->define special fields for line item display. I was added Table: PAYR and Fied:CHECF and i saved. Aft