cancel
Showing results for 
Search instead for 
Did you mean: 

filling a textedit ui through an internal table

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

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!

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

In addition I get the following message:

Conversion of type 'h' to type 'g' not supported.

Any idea?

regards

yuval

Former Member
0 Kudos

Hi Yuval ,

No idea as to why you are facing a type conflict . Lets wait for others and hope to find a solution.

Actually , not worked on hebrew..:)

Cheers,

Aditya.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Glad that you solved the problem...Cheers...:)

You can then close the thread.

Aditya.

Answers (3)

Answers (3)

Former Member
0 Kudos

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

ChrisPaine
Active Contributor
0 Kudos

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

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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

Former Member
0 Kudos

Hallo Thomas,

I have read this but i"m not sure how this can be done.

I tried binding my internal table to a node of type TP0001

but all it showed was the first line of the table.

A code extract will be more helpful.

regards

yuval

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

As they help says it can access type STRING or STRING_TABLE. I don't know what TP0001 is but I'm guessing its not a STRING_TABLE. If you have table of a different type, people generally loop through the table and concatenate each line together into a single string.