on 01-08-2014 10:15 PM
Hi experts!
I have a simple question, I think.
In WDDOMODIFYVIEW method I can work with parameter VIEW, like here:
DATA: root_container TYPE REF TO cl_wd_transparent_container.
root_container ?= view->get_element( 'TR_BORRAR2' ).
I need do the same but in WDDOINIT method, but I don't have VIEW parameter in this method.
How I can work with my view in method WDDOINIT?
Thanks.
Hi Alberto,
You can get the reference to view as below
DATA LO_VIEW type ref to if_wd_view.
lo_view ?= wd_this->wd_get_api( ).
Hope this resolves your issue.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
I tried this code... copy & paste... Same result:
Dynamic type conflict when assigning references.
I don't know why not work...
I tired this in WDDOINIT method.
This code don't return error:
DATA l_controller TYPE REF TO if_wd_controller.
l_controller ?= wd_this->wd_get_api( ).
But I need the view, not the controller.
Thanks.
ERROR: Dynamic type conflict when assigning references.
Because TR_BORRAR2 may not be Transparent Container. Please check which UI element is TR_BORRAR2 and then use the corresponding type..
DATA lr_container TYPE REF TO cl_wd_uielement_container. "For Container
DATA lr_container TYPE REF TO cl_wd_table. " For Table
Rest of code will be same.
Hi Alberto,
Thanks for sharing the system details.
As per my understanding, lo_view ?= wd_get_api( ) works fine in system NW 7 with EHP 1 and higher.
Please ask basis team to update the system for higher Enhancement package.
For now, you can achieve your requirement by writing code in WDDOMODIFYVIEW
Regards,
Rama
Hi,
Sorry for my late response, I was out of SCN!
Are you getting this error in your particular WDA application or in all other applications as well?
Please check in another test application( write the same code in WDDOINT method). The attribute F_ALTER_EGO in the WD_THIS reference should point to the instance of class CL_WDR_DELEGATING_VIEW.
If you are on Netweaver 2004s version, you cannot get the if_wd_view reference in DOINIT method.
The API IF_WD_VIEW can exclusively be accessed using the attribute VIEW of the method WDDOMODIFYVIEW of the local view controller interface.
Ref: Web Dynpro Runtime APIs (SAP Library - Web Dynpro for ABAP)
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alberto,
If you have commented out all the code in the view's WDDOINIT method and are still seeing the type conflict error, then it is likely that the real error is elsewhere and Web Dynpro may have become out-of-sync and is pointing you to the wrong line of code.
Try commenting out code you have added recently in other places-- essentially back out your custom code bit by bit until you are able to execute without errors.
The error is of type RABAX_STATE, so also take a look in the ST22 error log to see if it has additional information on the source of the error.
is correct that the following should work so my guess is Web Dynpro has become out-of-sync.
data lo_view type ref to if_wd_view.
lo_view ?= wd_this->wd_get_api( ).
I also agree with Rama that it may be time to upgrade to NW7.
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've comented recently added code and not works.
The sistem is in NW7 but EPH is not in 1. Perhaps it is the problem, because the error its very peculiar.
I've resolved my problem using WDDOMODIFYVIEW method. But I had a problem with FIRST_TIME parameter and it's the reason because I worked with WDDOINIT.
This parameter is 'X' only the first time you run your view. If you go to other view and return to the previous, FIRST_TIME not reset your value to 'X'.
I solved it, changing the parameter Lifetime in VIEW to 'when visible'.
Thanks for the help.
Regards.
Alberto
Hi Alberto,
You can also do it this way.
1. Create a View attribute lr_view of type ref to IF_WD_VIEW.
2. In WDDOMODIFYVIEW method
IF first_time = abap_true.
wd_this->lr_view = view.
ENDIF.
Now you can access the view reference in any of the view method using wd_this->lr_view.
Regards,
Shibin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
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.