Skip to Content
avatar image
Former Member

How to avoid hard coding in webdynpro enhancement?

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. :)

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Mar 14 at 11:36 AM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 02 at 05:19 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 02 at 07:45 PM

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

    Add comment
    10|10000 characters needed characters exceeded