cancel
Showing results for 
Search instead for 
Did you mean: 

WD for ABAP: Access to a View directly in an Action

Former Member
0 Kudos

Hi,

I create an application with Web Dynpro for ABAP. Is it possible to get access to the view and its elements directly in an action, in the same way, like I can do this in the Method WDDOMODIFYVIEW.

Dietmar

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

thanks for your Information.

When I try it in this way, I get the Message:

Field u201Ci_view u201D is unknown. It is neither in one of the specified tables nor defined bay a u201CDATAu201D statementu2026

Former Member
0 Kudos

Hi,

Yes you can access view elements in actions/wddoint/methods as well. For that you need to do

instantiating the 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.

now use i2_view to read the elements of your view in actions/wddoinit/methods.

Best Regards

Ravi

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi,

>

> Yes you can access view elements in actions/wddoint/methods as well. For that you need to do

>

> instantiating the 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.

>

> now use i2_view to read the elements of your view in actions/wddoinit/methods.

>

> Best Regards

>

> Ravi

Be warned that such an approach is not supported by SAP. This violates the phase model of Web Dynpro and can lead to inconsistencies and even short dumps in your application.

Former Member
0 Kudos

Thanks for Help...

Former Member
0 Kudos

Dietmar,

I dont think you can access view and its elements like you do in WDDOMODIFYVIEW but you can try with this(i didn't try so not sure whether it will work or not) .in WDDOMODIFYVIEW store the parameters of that method in context and try to access it in action

Thanks

Bala Duvvuri

arjun_thakur
Active Contributor
0 Kudos

Hi Dietmar,

Yes, you can change certain properties of any UI element in an OnAction (event handler) method. For that you need to bind the property (which you want to change) of the UI element with attribute of particular type and can set the value of that attribute (with the help of code wizard) according to your need.

I suggest that you go through this online help to know about the properties of UI element : http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cd/422b035f01914e80251a660e39ab14/frameset.htm

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

hi,

You can access UI Elements of View in an OnAction too.

->Just read the Context Attribute or Context Node for whichever UI Element you want to refer to.

->Use code wizard ( control +F7) to set / read a node/attribute.

check this out.

https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdabap/simple%252bapplication%252bto%252bchange%2...

In case you want anything particular , revert back.

Thanx.