on 03-17-2009 5:54 AM
Hi,
How do i get the reference to the view in which i am working????
In Modifyview method i can just use the parameter "view". But i need this reference in another method.
Can anybody help me out in this?
Best Regards,
Kanakaraj V A
Hi,
Use IF_WD_VIEW to instantiate the view
Use wd_this to point the present view.
DATA: i_view type ref to IF_WD_VIEW.
DATA: i2_view type ref to IF_WD_VIEW.
i2_view = wd_this->i_view.
Best Regards
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Yes, you can use VIEW parameter in WDMODIFYVIEW in the following way
data ui_label type ref to cl_wd_label. " suppose you have UI as LABEL
ui_label ?= view->get_element( 'LABEL' )." here give the ID of UI element
ui_label->set_enabled( abap_true ).
I hope it helps.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kanakaraj,
You can as a work around obtain the reference of the view within your WDDOMODIFYVIEW & save it into an view attribute of the same type (i.e, TYPE REF TO IF_WD_VIEW). This attribute would then be available across your view.
ex:
Suppose you had defined an attribute by name gv_view of TYPE REF TO IF_WD_VIEW in your views "Attributes" tab. You can access this attribute from any of your View's method by saying as: wd_this->gv_view
You can obtain & save your views reference into it from within your WDDOMODIFYVIEW method by saying as:
check first_time = abap_true.
wd_this->gv_view = view.
SAP doesn't recommend this approach at all and you wouldn't be able to ask for any support from SAP for any problems that you may incur while following such an approach. As per SAP any dynamic programming that you intend to perform must be done lone from within your WDDOMODIFYVIEW.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> SAP doesn't recommend this approach at all and you wouldn't be able to ask for any support from SAP for any problems that you may incur while following such an approach. As per SAP any dynamic programming that you intend to perform must be done lone from within your WDDOMODIFYVIEW.
>
> Regards,
> Uday
I want to add to this warning and strongly recommend against doing this. This absolutely violates the phase model of Web Dynpro and if you change UI elements outside WDDOMODIFYVIEW you will almost certainly have inconsistencies and/or short dumps. This is a very bad idea.
Hi Kanakaraj,
You can use WD_THIS as reference of the local controller. Go to the attribute tab of the view, there you'll see an attribute of WD_THIS name, you can use it to get reference of the current view you are working it.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.