cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro ABAP - Using Formatted TextView

Former Member
0 Kudos

Hi,

I created a Web Dynpro ABAP application. I need to display user information (i.e. address, phone # etc) on the home page after user logs in to the portal. I created some Formatted TextView elements in the view and trying to change their text during the runtime. Can someone please let me know how to change the text of the field in runtime. If some one can provide pseudo code with sysntax, it would be great help. Sorry, if it is a very basic question.

Thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

soldner
Participant
0 Kudos

Just what I was looking for! Didn't want to add another attribute to the context, so this will work for me. Great answer and great pointer to where to look.

Thanks!

prathamesh_gandhi
Participant
0 Kudos

Hi all,

I am using the Formatted TextView, i can format my text accordingly but i want to save that text in formatted view in text object and when i retrive the text that should be in same format how that was saved before.

Thanks In Advance.

uday_gubbala2
Active Contributor
0 Kudos

Hi Shan,

There is nothing special about how you can work with the text of FormattedTextView UI element. You just need to bind the "Text" property of this element to a context attribute of type STRING. So whatever value you maintain within this attribute would get displayed in your FormattedTextView. So in order to dynamically change the text you would just have to do a SET_ATTRIBUTE on this context attribute. If you want to know as to how you can do it via the methods of FormattedTextView class then you have a method by name SET_TEXT in the class CL_WD_FORMATTED_TEXT_VIEW. You can call this method using the reference of the FormattedTextView on your view & pass the desired text as input to the parameter "VALUE". However keep it in mind that you are better off binding the "Text" property to a context attribute & changing the attributes data rather than directly using the SET_TEXT method to change the data.

For any example over FormattedTextView you can check the standard component: WDR_TEST_MISC.

Regards,

Uday

Former Member
0 Kudos

Hi, Check this link [Formatted Text View|http://help.sap.com/saphelp_nw70/helpdata/EN/3b/219141c1d0ae5fe10000000a1550b0/content.htm] Also check standard component WDR_TEST_UI_ELEMENTS. Regards, Radhika.