In this blog we will learn how to read the application parameter from the portal. Let us see how to read a parameter from the URL in an already created component.
Let’s see how to read the user who is logging into the portal and triggering the link for our application.
Pre-requisites: The portal must be configured in a way to pass the parameter.
Step 1:
Go to the window of the component and select the method handle default. This is the first method which is triggered when a component load, even before the DOINIT method.
Step 2:
In Handle default method create a importing parameter to get the value from the portal the importing parameter must be created in a same name that the portal passes the parameter.
Step 3:
Go to the application. In parameters tab add the variable declared in Handle default method using F4 help.
Step 4:
Whatever the value that comes in the portal will be captured by the parameter we declared. It can be used only within the windows, to use that variable in our view we have to move it to the controller.
To move it to the controller, create a variable in the component controller as shown below.
Step 5:
Now move the application parameter to the variable declared in the component controller.
Wd_component_controller is the object referring to the component controller.
Using that object access the attribute of the component controller and assign the importing parameter of the handle default method to it. Now value is passed from window to the controller.
Step 6:
Now we have to set the value in some variable so that the value can be used across any no’s of views.
Create a node in the component controller with an attribute to hold the value.
Step 7:
Handle default method is executed after the method wddoinit. Hence we can make use of method wddomodifyview to set the value to the context node.
Code:
method wddomodifyview .
data : lv_user type uname.
data lo_nd_uname type ref to if_wd_context_node.
data lo_el_uname type ref to if_wd_context_element.
data ls_uname type wd_this->element_uname.
* Move the value from component controller attribute to the variable.
lv_user = wd_comp_controller->lv_user.
* set the value to the context node.
* navigate from to via lead selection
lo_nd_uname = wd_context->get_child_node( name = wd_this->wdctx_uname ).
* get element via lead selection
lo_el_uname = lo_nd_uname->get_element( ).
* set single attribute
lo_el_uname->set_attribute(
name = `LV_USER`
value = lv_user ).
endmethod. "WDDOMODIFYVIEW
Now Parameter has been set in the context node and can be accessed in any number of views.
We can also read the application parameter using the class
ReplyDeletewdr_task=>client_window->get_parameter( 'i_parameter' ).
Please, explain how to read application parameters from WDDOINIT method of component controller.
Deletein 1st step, you told that handledefault method triggers first but in 7th step you told differently.
please clarify brother!.
i learnt webdynpro from your website........thank you very much brother!
DeleteThey ought to be simple in correspondence and you can contact by messages, live visits, moment errand people and by global calling framework. Outsourcing organizations give every one of these offices to their designers.
ReplyDeleteconvert website to app
Thanks for sharing us. applicant tracking system
ReplyDeleteNice to read your article! I am looking forward to sharing your adventures and experiences. desawar satta
ReplyDeleteThank you very much for this great post. desawar satta
ReplyDeleteHi, I find reading this article a joy. It is extremely helpful and interesting and very much looking forward to reading more of your work.. buy weed online usa
ReplyDeleteThis article is an appealing wealth of informative data that is interesting and well-written. I commend your hard work on this and thank you for this information. You’ve got what it takes to get attention. nationwide thc vape shipping
ReplyDeleteWhen you use a genuine service, you will be able to provide instructions, share materials and choose the formatting style. thc oil cartridges shipped anywhere
ReplyDeleteI think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. birrificio artigianale
ReplyDeleteI think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. https://www.sergiofabbri.com/scarpe-converse-originali
ReplyDeleteTook me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! situs slot online
ReplyDeleteI wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. Ø´ØÙ† من كندا الى مصر
ReplyDeleteReally a great addition. I have read this marvelous post. Thanks for sharing information about it. I really like that. Thanks so lot for your convene. bahis siteleri listesi
ReplyDeleteIf you set out to make me think today; mission accomplished! I really like your writing style and how you express your ideas. Thank you. bahis siteleri listesi
ReplyDelete