cancel
Showing results for 
Search instead for 
Did you mean: 

bind_structure - how to get the whole structure?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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.

http://www.flickr.com/photos/tjung/2713065059/

Former Member
0 Kudos

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)