on 07-08-2008 10:38 PM
Hi all,
I am trying to get the selected row values from my table.
I know in webdynpro java, you can get it in the leadselection using
String <myattribute> = wdcontext.current<TestTableElement>.get<attributeName>;
How can I get it in webdynpro ABAP.I am pretty new to Webdynpro ABAP.
It would be really great if you can help me with any documentation comparing webdynpro java and web dynpro ABAP syntaxes.
Thanks
Kukku
Hi
It must be easy for you to understand how it happens in Web Dynpro ABAP
In Web Dynpro ABAP, you have to use API
Every Node is of type IF_WD_CONTEXT_NODE
Every Element is of type IF_WD_CONTEXT_ELEMENT
you have to get the reference of the Node first
to get a child node you have to call GET_CHILD_NODE method of IF_WD_CONTEXT_NODE
you have an Attribute called WD_CONTEXT just like wdContext in Web Dynpro Java
WD_CONTEXT->GET_CHILD_NODE( '<name of the child node>' ) will return you the child node reference directly under your root context node.
GET_LEAD_SELECTION of IF_WD_CONTEXT_NODE will return the lead selected element which is of type IF_WD_CONTEXT_ELEMENT
use GET_ATTRIBUTE method of IF_WD_CONTEXT_ELEMENT to read a particular context attribute
Hope it is clear
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
data:lt_elements TYPE wdr_context_element_set,
lo_elements TYPE REF TO if_wd_context_element,
lo_node type ref to if_wd_context_node.
lt_elements = lo_node->get_selected_elements( ).
CHECK NOT lt_elements[] IS INITIAL.
LOOP AT lt_elements INTO lo_elements.
Get Contents of selected Lines............
CALL METHOD lo_elements->get_static_attributes
IMPORTING
static_attributes = ls_user_entities.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sridevi,
I appreciate your valuable inputs!
Could you please tell me why a LOOP is required to get the input values.
(I am refering to line --- LOOP AT lt_elements INTO lo_elements.)
Is lt_elements an internal table? What is this type wdr_context_element_set.
I dont have much idea of type wdr_context_element_set.
If possible can you provide a brief description of the steps here.
Thanks
Kukku
Hi
you can use the following code
NODE_CO = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_COM).
ELEM_CO = NODE_COM->GET_ELEMENT( ).
ELEM_CO->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = STRU_CO ).
Get_element will give you lead selection .
Regards
Naresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
here context node is CO
see the following
data:
NODE_CO TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_CO TYPE REF TO IF_WD_CONTEXT_ELEMENT,
STRU_CO TYPE WD_THIS->ELEMENT_CO ,
NODE_CO = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_CO).
ELEM_CO = NODE_CO->GET_ELEMENT( ).
ELEM_CO->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = STRU_CO ).
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.