cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing impl class attribute

Former Member
0 Kudos

Hi Experts,

if i declare one variable in controller class of a view and how can access the variable in contex naode .

Accepted Solutions (0)

Answers (1)

Answers (1)

kavindra_joshi
Active Contributor
0 Kudos

You can declare a static variable in the controller and then you can do *_impl=>gv_var in the context node.

Regards

Kavindra

Former Member
0 Kudos

Hai Kavindra,

in the case of instance attribute.

kavindra_joshi
Active Contributor
0 Kudos

Don't see a way how this can happen.

Regards

Kavindra

Former Member
0 Kudos

Hi srinivas.yangal,

You can access the View implementation Class Attributes in Context.

1] Go to Context Node Implementation Class

2] Create a attribute GV_VIEW_CONTROLLER in Impl class of Context Node.


DATA : GV_VIEW_CONTROLLER TYPE REF TO CL_BSP_WD_VIEW_CONTROLLER .

3] Go to INIT method of Context Node.

4] Assign instance LV_VIEW_CONTROLLER to GV_VIEW_CONTROLLER of Context Node Impl. Class.


GV_VIEW_CONTROLLER = LV_VIEW_CONTROLLER.

Then you can access your Instance attributes defined in View Impl. class inside the context node through GV_VIEW_CONTROLLER attribute as follows.


ABC = GV_VIEW_CONTROLLER->XYZ.

Reward points if useful.

Kind Regards,

Dhananjay.

Edited by: Dhananjay SAP CRM on Nov 24, 2011 12:56 PM