Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

use standard text (SO10) in report(SE38) to compose the body of email

hello experts,

here i wanna create the body of email with a format, hence i decide to use Standard Text. in this Standard Text, i also maintain some variable such &p_name&( i remember it works in forms,such script and ssf), while i define p_name as 'demo' in the program and try to transfer p_name to standard text, it fails. while i check the output of standard text, it show &p_name& instead of demo.

could anyone tell me how to realize this function?

Thanks in advance.

Desmond

Former Member
Former Member replied

Hi,

try this,

data:w_field(10) type c VALUE '1234'.

DATA:wa_head TYPE THEAD.

data:it_final TYPE TABLE OF tline.

wa_head-tdname = 'Z_SAMPLE'. u201CStandard text,refer screen shot

wa_head-tdid = 'ST'.

wa_head-tdobject = 'TEXT'.

wa_head-tdspras = 'EN'.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = wa_head-tdid

language = wa_head-tdspras

name = wa_head-tdname

object = wa_head-tdobject

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER = HEADER

TABLES

lines = it_final

  • 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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'REPLACE_TEXTSYMBOL'

EXPORTING

endline = 10

  • FORMATWIDTH = 72

  • LANGUAGE = SY-LANGU

  • LINEWIDTH = 132

  • OPTION_DIALOG = ' '

  • REPLACE_PROGRAM = 'X'

  • REPLACE_STANDARD = 'X'

  • REPLACE_SYSTEM = 'X'

  • REPLACE_TEXT = 'X'

startline = 1

  • IMPORTING

  • CHANGED = CHANGED

TABLES

lines = it_final

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question