Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

TEXT_SYMBOL_REPLACE not working within a class method

$
0
0

I am developing a class.  I have a method that reads in a text object which has an HTML page.  I am then trying to replace the dynamic variables by calling the function TEXT_SYMBOL_REPLACE.  The function does not recognize the variables declared in the class.  If I write a program and call the function, it works.  I have tried passing in different values for the REPID.

 

   * Read the HTML Template
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
*     CLIENT                        = SY-MANDT
      id                            = 'ST'
      language                      = sy-langu
      name                          = 'MYHTMLTEXT'
      object                        = 'TEXT'
*     ARCHIVE_HANDLE                = 0
*     LOCAL_CAT                     = ' '
   IMPORTING
      header                        = ls_head
    TABLES
      lines                         = lt_lines
   EXCEPTIONS
      id                            = 1
      language                      = 2
      name                          = 3
      not_found                     = 4
      object                        = 5
      reference_check               = 6
      wrong_access_to_archive       = 7
      OTHERS                        = 8.


  IF sy-subrc <> 0.
...
  ENDIF.

 

 

   CALL FUNCTION 'TEXT_SYMBOL_REPLACE'
  EXPORTING
*   ENDLINE                = 99999
    header                 =
*   INIT                   = ' '
*   OPTION_DIALOG          = ' '
   PROGRAM                = 'SY-REPID  "also tried SY-CPROG
   REPLACE_PROGRAM        = 'X'
   REPLACE_STANDARD       = 'X'
   REPLACE_SYSTEM         = 'X'
   REPLACE_TEXT           = 'X'
*   STARTLINE              = 1
* IMPORTING
*   CHANGED                =
*   NEWHEADER              =
  tables
    lines                  =  lt_lines
          .

Is there anyway to get this function to work within a class method?  Or is there another function?

 

My text object looks like:

<TD> &v_START_DATE& </TD>

I have a variable declared as V_START_DATE within the method.  I also tried putting in the program name at runtime:

<TD> &(ZCL_MYTESTCLASS=======CP)v_START_DATE& </TD>

Any help would be appreciated.

Thanks,

Jay

 

 


Viewing all articles
Browse latest Browse all 8332

Trending Articles