on 07-29-2008 1:05 PM
Hello!
With the method bind_structure you can add a whole structure at once to your node.
Is there also a way to get the whole structure at once? Without doing element->get_attribute for every attribute?
thanks
Hi Thomas,
GET_STATIC_ATTRIBUTES Method can used for to get the whole structure at once.
For Example :
DATA LO_ND_CONTEXTUAL TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_CONTEXTUAL TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_CONTEXTUAL TYPE WD_THIS->ELEMENT_CONTEXTUAL.
navigate from <CONTEXT> to <CONTEXTUAL> via lead selection
LO_ND_CONTEXTUAL = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_CONTEXTUAL ).
@TODO handle not set lead selection
IF LO_ND_CONTEXTUAL IS INITIAL.
ENDIF.
get element via lead selection
LO_EL_CONTEXTUAL = LO_ND_CONTEXTUAL->GET_ELEMENT( ).
@TODO handle not set lead selection
IF LO_EL_CONTEXTUAL IS INITIAL.
ENDIF.
alternative access via index
lo_el_contextual = lo_nd_contextual->get_element( index = 1 ).
@TODO handle non existant child
IF lo_el_contextual IS INITIAL.
ENDIF.
get all declared attributes
LO_EL_CONTEXTUAL->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = LS_CONTEXTUAL ).
Here LS_CONTEXTUAL is a Structure.
Regards,
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just a little side note related to this topic. In the upcomming 7.0 Enhancement Package 1, the Web Dynpro Code Wizard has been improved. It now supports read, set and append operations as well as Table Operations for each of these actions. So it can generate the bind_structure coding as well as the set_static_attributes* methods for you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try the method GET_STATIC_ATTRIBUTES (for single row) or GET_STATIC_ATTRIBUTES_TABLE (in case you have a table of data to be returned)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.