on 06-11-2009 7:59 PM
Hi expert ,
i need to display the records in text view one by one from a table
this is my code ,
LOOP AT lt_question INTO wa_question.
attribute_data->set_attribute( name = 'RECORDS' value = wa_question-qtext ).
ENDLOOP.
but it assigns the last value only in the textview , what should i do?
Regards
Sankar.M
Of course that would be the case with the code that you provided. When you use set_attribute, it overwrites the current value with the new value. You need concatenate the text together. I would suggest something like this.
data l_string type string.
LOOP AT lt_question INTO wa_question.
concatenate l_string wa_question cl_abap_char_utilities=>cr_lf into l_string.
ENDLOOP.
attribute_data->set_attribute( name = 'RECORDS' value = l_string ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
newline should work according to the online help:
Note that each occurrence of cl_abap_char_utilities=>newline in this property is replaced by a line break in the browser display.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/7d/c8f641091b5f24e10000000a1550b0/frameset.htm
For help with Dynamic coding check out these sources:
Have a look at the documentation for the WDDOMODIFYVIEW section of the phase model:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d2/8acd409cc4dd50e10000000a1550b0/frameset.htm
There is also the class CL_WD_DYNAMIC_TOOL:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/67/6935425394033be10000000a1550b0/frameset.htm
Also have a look at the example application DEMODYNAMIC.
I've got an eLearning on the topic here as well:
You just need to adapt these sample to the textView UI element. The textView UI element class is CL_WD_TEXT_VIEW.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.