on 04-28-2007 11:30 AM
Hi,
suppose I have one inuput element MATNR and one lable associated to element MATNR.
so by default it will show label text as "Material", so if I want to change it at design time i simply change it's property to whatever text I want.
But my requirement is to change it's value at runtime.
Please suggest code snippet to achieve this.
Thanks
Hi ,
Make element in Context of type String .Make Default value of it as 'MATNR' . Now run time write code that will change value of element to whatever you want.
You bind this to lable's text .
Cheers
Parry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Haresh,
You can check out following weblogs,
/people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements
/people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements
Also there is some code snippet given.
Hope this will help you.
Cheers,
Darshna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
DATA : lr_ui_root TYPE REF TO if_wd_view_element.
lr_container TYPE REF TO cl_wd_ui_element_container.
lr_ui_root = view->get_element( EXPORTING id = 'ROOTUIELEMENTCONTAINER' ).
lr_container ?= lr_ui_root.
lr_container->get_child ( ...your label )
then modify the attributes of the label.
PS: Do this in WDDOMODIFYVIEW method ONLY.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Shailesh,
Thanks for your reply.
I have done this much code in WDMODIFYVIEW.
DATA :
lr_ui_root TYPE REF TO if_wd_view_element,
lr_container TYPE REF TO cl_wd_uielement_container.
lr_ui_root = view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_container ?= lr_ui_root.
lr_container->get_child( exporting id = 'MATNR_LABEL' ).
but couldn't figure out how to change the label value.
Will you please suggest further code?
Thanks.
Hi Haresh,
I'm facing similar kind of problem.
Can you please let me know how do I get the id of an View Element at runtime?
Here in your code you are passing id directly.
lr_container->get_child( exporting id = 'MATNR_LABEL' ).
but i want to get the id of an element dynamically. I found an interface IF_WD_VIEW_ELEMEN which has the method GET_ID which returns the ID of an element, but I couldn't succeed how to use that
Regards
Raghav
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.