Skip to Content
0

How to avoid hard coding in webdynpro enhancement?

Mar 08 at 06:48 AM

29

avatar image
Former Member

Hi All,

My requirement is to send a mail by enhancing an existing webdynpro. Inorder to fill the mail body, lot of hard coded texts are needed (eg : "Note – This is a system generated mail. Please do not reply."). I do not want to hard code this as that is not the best practice in coding. I cannot use text symbols in Assistance class as well, because the assistance class is a standard class.

Please suggest a method to do this. I need to get the hard codes within the OnAction Method so that i can concatenate it with program data and fill up the mail body.

Thanks in advance. :)

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Maria Erdey-Gruz
Mar 14 at 11:36 AM
1

Hi,

Why not put in a table and than refer to it in the context of you WD Component and than call the required attributes when needed: Context in Detail?

Share
10 |10000 characters needed characters left characters exceeded
Amy King Apr 02 at 05:19 PM
0

Hi Kavya,

One option is to subclass the standard assistance class and create text symbols within your subclass. Another option is to create your texts as OTR (Online Text Repository) texts (transaction SOTR_EDIT) then read them in your code via class CL_WD_UTILITIES.

my_text = cl_wd_utilities=>get_otr_text_by_alias( 'MY_ALIAS' ).

A third option-- if they're longer texts-- is to use standard text objects which you can read via call to function READ_TEXT.

The best option of these three is the OTR texts. That's the sort of thing OTR texts are intended for and they can be internationalized for different languages if needed.

Cheers,

Amy

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 02 at 07:45 PM
0

Create standard text using SO10 and read the same using READ_TEXT function module.

Share
10 |10000 characters needed characters left characters exceeded