Skip to Content
author's profile photo Former Member
Former Member

Reference of a view in wddoinit method.

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jan 09, 2014 at 01:38 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2014 at 05:47 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.