on 11-20-2007 1:18 PM
Hi All,
I am a newbie to ABAP Webdynpro.I would liketo know how should I get the value from an input field at runtime?
Thanks,Mukta
By reading the context attribute which bound to inputfield, you can get the value.
Say you have a node called 'MAIN_NODE' and has the attribute 'INPUT_VALUE', which is bound to the Inputfield.
DATA LO_ND_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_MAIN_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_MAIN_NODE TYPE WD_THIS->ELEMENT_MAIN_NODE.
DATA LV_INP_VALUE LIKE LS_MAIN_NODE-INP_VALUE.
* navigate from <CONTEXT> to <MAIN_NODE> via lead selection
LO_ND_MAIN_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = 'MAIN_NODE' ).
* get element via lead selection
LO_EL_MAIN_NODE = LO_ND_MAIN_NODE->GET_ELEMENT( ).
* get single attribute
LO_EL_MAIN_NODE->GET_ATTRIBUTE(
EXPORTING
NAME = `INPUT_VALUE`
IMPORTING
VALUE = LV_INP_VALUE ). "LV_INP_VALUE will have the value of inputfield
Raja T
Message was edited by:
Raja Thangamani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can also refer the below link:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdabap/context&;
Raja T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.