cancel
Showing results for 
Search instead for 
Did you mean: 

get input fields of view

achim_pellen
Explorer
0 Kudos

Hi all,

how can I get 'easy' and performant all relevant input fields of a view at runtime ?

Thanks.

Achim

Accepted Solutions (0)

Answers (3)

Answers (3)

achim_pellen
Explorer
0 Kudos

Sorry but what I want to know is what are my input fields.

Normally you have several types of UI-Elements in the view (label, container,... and input fields).

I don't need to get the value of the input fields but the name and position of the input fields of my view.

Best regards.

Achim

Former Member
0 Kudos

Hi Achim,

I dont understand your requirement.Why do you want to know what are the input fields in your view.

Though you got all the elements present in view how do you recognize which are the input fields or not with out knowing the element ID.

The only way to get the reference of element from view is go to WDDOMODIFYVIEW there you have instance VIEW(instance of current view) in signature.Use that instance and call the method GET_ELEMENT( ) method of IF_WD_VIEW to get reference of element.

data:

lr_input type ref to cl_wd_input_field

lr_input ?= view->get_element( id = 'INP_TEST1' ).

achim_pellen
Explorer
0 Kudos

Hi Suman,

I want to establish a kind of cusor controlling means that the cursor should jump from on input field to another after the validation of the previous input field was ok.

The user should not use the tab key.

Therefore I want to know all input fields and their position on the view to hop from one to another (after the user did the input und pressed ENTER).

Thanks.

Achim

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If all of your fields are defined at design time, you can read them from the underlying metadata table: wdy_ui_element. Please keep in mind though that SAP doesn't support directly accessing the WD metadata and can change the data model without notice.

In order to get them in order you will have to "walk the tree" using the PARENT_NAME field and working backwards from ROOTUIELEMENTCONTAINER.

Former Member
0 Kudos

Hi,

Bind the Node with the Input fields. (Node_1)

And Write the following code where you need your Input fields.

DATA : node1 TYPE REF TO if_wd_context_node.

*navigate from <CONTEXT> to <Node_1`> via lead selection

node1 = wd_context->get_child_node( name = wd_this->wdctx_node_1 ).

Now use GET_ATTRIBUTE or GET_STATIC_ATTRIBUTES methods using NODE1.

And Pass the attribute name to this method which you require the value of Input field

Reagards

Sandip

former_member40425
Contributor
0 Kudos

Hi,

You must have binded an attribute with the input field.

just read the attribute in any variable.

I hope it helps,

Regards,

Rohit