Skip to Content
avatar image
Former Member

Problem: Internal table and Drop-Down-List

Hi Gurus,

I am using a internal table, for calling a FM, which require Internal table as its parameter.

e.g. pt_material, its structur is (key, value)

how can i show this Table into a Drop-Down-List, which one is better?

Best Regards

Shuo

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 04, 2007 at 09:28 AM

    Hi,

    You can use DropDownBy key... Please refer to the sample code in WDDOINT method...

    method WDDOINIT .
      data:
        Node_Node1 type ref to If_Wd_Context_Node,
        Info_Node1 type ref to IF_WD_CONTEXT_NODE_INFO,
        value_set type TIHTTPNVP,
        wa_value_set TYPE LINE OF TIHTTPNVP.
    
      Node_Node1 = wd_Context->get_Child_Node( Name = IF_MAIN=>wdctx_Node1 ).
    
      Info_Node1 = Node_Node1->get_node_info( ).
    
      wa_value_set-name = `01`.
      wa_value_set-value = `Consultant`.
      APPEND wa_value_set to value_set.
      clear wa_value_set.
      wa_value_set-name = `02`.
      wa_value_set-value = `Senior Consultant`.
      APPEND wa_value_set to value_set.
      clear wa_value_set.
      wa_value_set-name = `03`.
      wa_value_set-value = `Manager Projects`.
      APPEND wa_value_set to value_set.
      clear wa_value_set.
    
      Info_Node1->set_attribute_value_set( name = 'DESIGNATION'
            value_set = value_set ).
    
    
    endmethod.

    Hope this helps,

    Best regards,

    Ravikiran.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 04, 2007 at 09:25 AM

    Hi

    Create a node of your internal structure type and bind the values from the internal table to the node using bind_table method of if_wd_context_node.Then bind this node to your dropdown node the UI

    Thanks

    Anzy

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Shuo,

      Go through the following code.

      data:uitab type ref to if_wd_context_node,

      roles_map type MYTABLE,

      flag type abap_bool.

      uitab = wd_Context->get_Child_Node( `DROPDOWN` ).

      CALL METHOD UITAB->BIND_TABLE

      EXPORTING

      NEW_ITEMS = roles_map

      SET_INITIAL_ELEMENTS = ABAP_TRUE

      .

      I am just giving you the an example.here DROPDOWN is a node with the attributes of the table type MYTABLE.And you can get the node instance from the context.

      Post if you need some more clarification

      Thanks

      Anzy

      Award points for useful answers