on 09-16-2010 1:02 PM
Hi
In our app we have created a textview ui element to show the contents of an itenral table of type TP1002.
Our problem lies with the new line . The question is how to copy the internal table to the textview to reflect
the structure of each new line.
We tried to use seprate by cl_abap_char_utilities=>newline did also fail to do the trick
Thank you for your help
yuval
It should be noted that PT1002 also contains formatting information ( (dependent on the subtype of the 1002 infotype being queried) So that just looping at the contents and concatenating each TLINE component with a linefeed does not reflect the way that the information would be displayed using standard GUI rendering.
I am assuming that you are looking at HR object descriptions? and it was just a typeo to say TP1002 - I can't imagine why anyone would call a table tp1002 otherwise!
Using the linefeed construct should work!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris
The structure is made of TDLINE and TDFORMAT as you mention. It also contains HR info.
What I did was to loop through this table, concatenating each elements into a local string separated by newline.
The local string is then bound to a context attribute of type String.
I also tried putting '/' in between., calling CL_ABAP_CHAR_UTILITIES=>NEWLINE. Nothingh helped.
I thank you in advance for any suggestion.
regards
yuval
Hi ,
I am not sure if this will work , try this ,
Declare a itab of type string_table.(say lt_string)
Loop at itab(the actual data) into wrkarea.
concatenate all fileds of wrkarea into a string variable.(say lv_string)
APPEND lv_string TO lt_string.
ENDLOOP.
Bind lt_string to a context attribute of type string_table.Bind the attribute to the "value" of textedit.I remember doing somthing like this and it seemed to work.
Hope it helps,
Aditya.
Hi
Thank you very much for your detailed reply.
It helped me a lot and solved my problem.
Strangely enought though, when the sap-language equals EN, everything is rendererd correctly.
But when I change EN to HE (Hebrew), I get a Dynamic type conflict when assiging references and more specifically
Object_move_not_supported
Any idea ?
regards
yuval
Hi Aditya
Your code solved my problem only to invoke an additional little problem.
Because we use Hebrew, we have to add sap-language=he in the url.
After having done this, the sytem threw an exception 'Conversion of type 'h' to type 'g' not supported'.
I have then found out the you must use cl_wdr_conversion_utils=>to_string() to do the correct rendering.
Then everything just set into place and solved my problem.
regards
yuval
Hello Perry,
Can you try using CL_ABAP_CHAR_UTILITIES=>CR_LF instead of cl_abap_char_utilities=>newline.
Best regards,
Chinnu
Sorry, did not read the full chain before replying...
Edited by: Chinnu on Sep 20, 2010 1:39 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps this is the issue:
>the question is how to copy the internal table to the textview ...
To show multiline text you'll need to be using a text edit UI element (with read only flag checked) not a text view UI element.
Possibly your first post was just a typo - because the post subject mentions textedit...
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
From the online help:
The attribute to be bound can be of type STRING or STRING_TABLE. With STRING_TABLE rows from TextEdit are stored as table rows. A line break is always stored as a line feed in a STRING (CL_ABAP_CHAR_UTILITIES=>NEWLINE, ASCII decimal 10). The Web Dynpro framework carries out the conversion for the client platform.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/06/45ee412e5e6324e10000000a1550b0/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.