cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP WDA application parameter - component controller context

Former Member
0 Likes
567

Hi, in ECC6.0 I have an application parameter, received via the URL, which I am receiving into my window context via the handledefault method.

I would like this value though to be input into the the component context so that I can reuse it for many other views.

I have read the latest WDA book by James Wood & Shaun Parvaze but I can't see any easy way to do this.

I'm sure there must be an easy way to load the component context with values passed as application parameters during init.

Please advise.

Thanks,

Kevin

View Entire Topic
amy_king
Active Contributor
0 Likes

Hi Kevin,

Create a context node with appropriate attributes in your component controller then map the node to your window's context.

In the window's HANDLEDEFAULT method, you can fetch the URL parameters into a table then save the parameter values to the context node attributes.

wdevent->get_data(
     exporting
         name if_wd_application=>all_url_parameters
     importing
         value = lt_parameters  ).

read table lt_parameters assigning <parameter>
                                        with key name = url_parameter_name.
if sy-subrc is initial.

     lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
     lo_el_node = lo_nd_node->get_element( ).

     lo_el_node->set_attribute(
         name `ATTRIBUTE`
         value = url_parameter_value ).

endif.

Cheers,

Amy