Skip to Content

Load Recursion Node ( Navigation List )

Hi Gurus,

I´m trying to load recursion node (on Supply Function) just to show the result on a Navigation List element ... but I´m having some problems ...

Please, anyone have an example code ? I would be depply grateful

Thanks in advance !!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Apr 05, 2013 at 12:37 PM

    In this Example:

    Context Node :DATASOURCE

    Recursion Node :DATASOURCE_RECURSION

    Attributes :TEXT

    ENABLED

    Bind TEXT to itemText property of Navigation List UI Element.

    Bind ENABLED to enabled Property.

    Bind the DATASOURCE node to itemSource property

    Write this code in Supply Funtion of the context node DATASOURCE and debug, so that u can understand and apply for your requirement.

    DATA lo_el_datasource TYPE REF TO if_wd_context_element.

    DATA ls_datasource TYPE wd_this->element_datasource.

    DATA lt_datasource TYPE wd_this->elements_datasource.

    DATA parent_node TYPE REF TO if_wd_context_node.

    DATA name TYPE string.

    parent_node = parent_element->get_node( ).

    IF parent_node->get_node_info( ) = node->get_node_info( ).

    parent_element->get_attribute( EXPORTING name = 'TEXT'

    IMPORTING value = name ).

    ELSE.

    * Adding main elements to the navigation list

    ls_datasource-text = 'Nav List 1'.

    APPEND ls_datasource TO lt_datasource.

    CLEAR ls_datasource.

    ls_datasource-text = 'Nav List 2'.

    APPEND ls_datasource TO lt_datasource.

    CLEAR ls_datasource.

    ls_datasource-text = 'Nav List 3'.

    APPEND ls_datasource TO lt_datasource.

    CLEAR ls_datasource.

    ls_datasource-text = 'Nav List 4'.

    ls_datasource-enabled = abap_true.

    APPEND ls_datasource TO lt_datasource.

    CLEAR ls_datasource.

    ENDIF.

    * Adding sub elements to the navigation list

    IF name = 'Nav List 1'.

    ls_datasource-text = 'Hi'.

    APPEND ls_datasource TO lt_datasource.

    CLEAR ls_datasource.

    ls_datasource-text = 'Bye'.

    APPEND ls_datasource TO lt_datasource.

    CLEAR ls_datasource.

    ENDIF.

    IF name = 'Hi'.

    ls_datasource-text = 'Hello'.

    APPEND ls_datasource TO lt_datasource.

    CLEAR ls_datasource.

    ls_datasource-text = 'Bolo'.

    APPEND ls_datasource TO lt_datasource.

    CLEAR ls_datasource.

    ENDIF.

    * Bind the data to the node

    node->bind_table( lt_datasource ).

    REFRESH lt_datasource.

    Thanks,

    Mahendra K.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 07, 2013 at 06:41 AM
    Add comment
    10|10000 characters needed characters exceeded

    • Hi Krishna,

      I´m looking for an example like the one in the first link you sent, but a bit more complex. I would like to have more than 1 level on the navigation list, in that example just 1 level is being used.

      Thank you !!

  • Jan 13, 2015 at 10:41 PM

    Hi Alfonso:

    Can you solve Navigation List with n-level?

    Actualy I have the same requiriment, and only can have n-levels with Table like DEMO_TABLE_WITH_TREE, thanks in advance.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 14, 2015 at 01:49 PM

    Hi Rub, you can put spanish tutorial for Navigation Listo into

    http://scn.sap.com/community/spanish

    Forum WD ABAP rules don't allow it.

    Thanks in advance.

    Add comment
    10|10000 characters needed characters exceeded