cancel
Showing results for 
Search instead for 
Did you mean: 

View Elements

Former Member
0 Kudos

Hi all,

I would like know if tere is a way to read all elements of a View, in particular I need all Input Fields of my view. Is it possible?

Thanks

GN

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Have a look at the methods in the class if_wd_view. You have options to retrieve each element by specifying its ID, or a group of elements also. The reference to the view will be available in the Modify View method and you can call these methods from there. However, I do not think you can retrieve all input fields or something specific like that.

Regards,

Nithya

Answers (2)

Answers (2)

Former Member
0 Kudos

yes, you can do that.

1. you can get the root container. view->get_root_element( ).

2. get all UI elements based on the root container. lr_container->get_children( ).

3. loop UI elements. if there has container elements. then do the same thing as below.

lrs_child->_DEFINITION_NAME. this can help you check the type of UI element.

eg: BUTTON, GROUP..

so that you can get all elments in the view.

Edited by: xu chen on Jul 15, 2009 5:50 AM

Former Member
0 Kudos

hi ,

declare an attribute x type ref to if_wd_context_node.

Then call x->get_elements().

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Have a look at how SAP does it in the CL_WD_DYNAMIC_TOOL class. There is a local class method (LCL_MANDATORY_CHECK=>GET_MANDATORY_ELEMENTS). In here SAP goes back to the database where the WD Metadata is stored - tables WDY_UI_PROP_DEF and WDY_UI_ELEM_DEF to get the internal ids of the particular UI element types. They then use the IF_WD_VIEW class and method GET_ELEMENTS_BY_CID to read the UI elements in question.