on 06-05-2009 10:02 AM
hi
i have to display the id as text.
i have created a textview.
ive selected the id into an internal table, created a node for the id, when im binding the id to the node, im getting a dump
am i missing smthing?
Hi Anjali,
I guess that it might be a problem with the nodes cardinality. Have you changed the cardinality from the default 1..1? Try using a cardinality of 0..1 or 1..n
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create a context node attributed of type STRING and bind thid to the text view in view layout. Donot map context NODE to text view.
Then set the value of the CONTEXT ATTRIBUTE and then this value you will appear in UI text view.
Regards,
Manne.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here are the detailed steps for dispalying text in text view.
1. Create a text view in layout of the view.
2. Create a context node CNODE and keep the defalut cardinality as 1:1
3. Now, create a context attribute in the above node called LV_TEXT type STRING
4. Map this context attribute LV_TEXT to the text view create in view
5. Finally, using SET_ATTRIBUTE method, set the text value to context attribute LV_TEXT that you want to see in UI
Hi Anjali,
Try concatenating all your internal tables data into just 1 STRING variable. Then finally use this STRING variable & do a SET_ATTRIBUTE on your context attribute.
Suppose I have a node by name DATA_NODE & a string attribute by name TEXT under it. The DATA_NODE has a cardinality of 1..1, selection of 0..1 & the Initialization Lead Selection is checked.
I place a TextView in my layout and bind its "text" property to the attribute TEXT. (i.e., MAIN.DATA_NODE.TEXT )
Now within my WDDOINIT I am filling the attribute with a table of MATNR values. Just check the code snippet below.
METHOD wddoinit .
DATA: lv_string TYPE string,
wd_node TYPE REF TO if_wd_context_node,
lt_matnr TYPE TABLE OF matnr,
wa_matnr TYPE matnr.
wd_node = wd_context->get_child_node( name = 'DATA_NODE' ).
SELECT matnr FROM mara UP TO 20 ROWS INTO TABLE lt_matnr.
SORT lt_matnr.
LOOP AT lt_matnr INTO wa_matnr.
IF sy-tabix = 1.
lv_string = wa_matnr.
ELSE.
CONCATENATE lv_string
wa_matnr INTO lv_string SEPARATED BY SPACE.
ENDIF.
ENDLOOP.
wd_node->set_attribute( EXPORTING name = 'TEXT'
value = lv_string ).
ENDMETHOD.
So when you finally test your component you would end up with 20 MATNR values being displayed in your TextView.
Regards,
Uday
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.