cancel
Showing results for 
Search instead for 
Did you mean: 

WD(ABAP) - how to populate items in itemlistbox

Former Member
0 Kudos

Is there any reference about how to populate items in Itemlistbox? I have tried to bind a context node with cardinality 1..n and Selection 0..n to the datasource of a itemlistbox element. The node contains two attributes jy and jy_text representing value and text repectively. I assign some sets of data to the attributes and finally bind the table to the node. But it doesn't display anything in the itemlistbox at runtime. Does anyone have idea?

My code is like this:

=====================


  DATA:
    NODE_HEAD                           TYPE REF TO IF_WD_CONTEXT_NODE,
    NODE_JY_LIST                        TYPE REF TO IF_WD_CONTEXT_NODE,
    ELEM_JY_LIST                        TYPE REF TO IF_WD_CONTEXT_ELEMENT,
    STRU_JY_LIST                        TYPE IF_MAIN=>ELEMENT_JY_LIST,
    tb_jy_list                          like table of STRU_JY_LIST,
    tb_is                               type table of v_tb038a_std,
    st_is                               type v_tb038a_std.
* navigate from <CONTEXT> to <HEAD> via lead selection
  NODE_HEAD = WD_CONTEXT->GET_CHILD_NODE( NAME = `HEAD` ).

* navigate from <HEAD> to <JY_LIST> via lead selection
  NODE_JY_LIST = NODE_HEAD->GET_CHILD_NODE( NAME = `JY_LIST` ).


select ind_sector text into CORRESPONDING FIELDS OF TABLE tb_is from V_TB038A_STD where SPRAS = '1'.
LOOP AT tb_is into st_is.
  STRU_JY_LIST-jy = st_is-ind_sector.
  STRU_JY_LIST-jy_text = st_is-text.
insert STRU_JY_LIST into TABLE tb_jy_list.
ENDLOOP.

NODE_JY_LIST->bind_table( tb_jy_list ).

Message was edited by: Fred Zhou

Accepted Solutions (1)

Accepted Solutions (1)

former_member215843
Active Participant
0 Kudos

Hi Fred,

You should check the following:

The text property of the listbox should bind to the text attribute of your context node.

Regina

Former Member
0 Kudos

Dear Regina,

Thank you for the suggestion. Your answer solved my problem.

Answers (0)