Skip to Content
author's profile photo
Former Member

E-mail title and replacement of text symbols

Hello,

I'm trying to modify sales order confirmation e-mail title using transaction NACE (V1,Output types). I'm using standard output type for order confirmations (=BA00). E-mail sending is working nicely and I can change the title of the e-mail and use system variables in the title too, but...

On General data -sheet there is a possibility to give a program name and ABAP form routine to replace text symbols . I need to put customer's order number to the e-mail title and I suppose I have to fill in "Replacement of text symbols" -program and form to do the trick.

My problem is that I don't know what the program should look like. =) How do I make a simple program to replace the text symbols in the e-mail title? SAP help says... "Parameters have to be evaluated by a special program with form routine". I couldn't find any information about this "special program" nor the structure of this program.

Any Ideas (any help would be appreciated)?

Kind Regards,

-ilkka

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Sep 30, 2005 at 09:02 AM

    Hi

    First create a program ( subroutine pool ) in SE38 with following code .

    <u><b>

    REPORT ZTEST.

    DATA WA_VBELN LIKE VBAK-VBELN.

    DATA: CHANGED,

    CURRENTPROGRAM LIKE SY-REPID.

    DATA: X_NEW_CURSOR_COLUMN LIKE SY-TABIX,

    X_NEW_CURSOR_LINE LIKE SY-TABIX.

    FORM TEXT_SYMBOL_REPLACE TABLES XTLINES STRUCTURE TLINE

    USING XTHEAD STRUCTURE THEAD

    SNAST STRUCTURE NAST.

    • This routine is set in customizing in output type.

    • It dynamically replaces the text symbols mainatianed in output type

    • mail title

    DESCRIBE TABLE XTLINES LINES SY-TABIX.

    IF SY-TABIX EQ 0 AND NOT XTHEAD IS INITIAL.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    ID = XTHEAD-TDID

    LANGUAGE = XTHEAD-TDSPRAS

    NAME = XTHEAD-TDNAME

    OBJECT = XTHEAD-TDOBJECT

    • IMPORTING

    • HEADER =

    TABLES

    LINES = XTLINES

    EXCEPTIONS

    ID = 01

    NOT_FOUND = 04

    OBJECT = 05

    • SAVEMODE = 06

    LANGUAGE = 02

    NAME = 03.

    ENDIF.

    DESCRIBE TABLE XTLINES LINES SY-TABIX.

    CHECK SY-TABIX GT 0.

    CURRENTPROGRAM = SY-REPID.

    WA_VBELN = SNAST-OBJKY .

    CALL FUNCTION 'TEXT_SYMBOL_REPLACE'

    EXPORTING

    ENDLINE = SY-TABIX

    HEADER = XTHEAD

    • INIT = 'X'

    • OPTION_DIALOG = E04

    PROGRAM = CURRENTPROGRAM

    • REPLACE_PROGRAM = E06

    • REPLACE_STANDARD = 'X'

    • REPLACE_SYSTEM = 'X'

    • REPLACE_TEXT = 'X'

    • STARTLINE = E10

    IMPORTING

    CHANGED = CHANGED

    • NEWHEADER =

    TABLES

    LINES = XTLINES.

    CALL FUNCTION 'FORMAT_TEXTLINES'

    • EXPORTING

    • CURSOR_COLUMN = E01

    • CURSOR_LINE = E02

    • ENDLINE = E03

    • FORMATWIDTH = E04

    • LINEWIDTH = E05

    • STARTLINE = E06

    IMPORTING

    NEW_CURSOR_COLUMN = X_NEW_CURSOR_COLUMN

    NEW_CURSOR_LINE = X_NEW_CURSOR_LINE

    TABLES

    LINES = XTLINES.

    ENDFORM. " TEXT_SYMBOL_REPLACE</b></u>

    Then in NACE select the output type and click on Details ( Cntrl + Shift + F2 ) on application tool bar. In this screen ( In the block "replacement of text symbols) add the program & subroutine created above . Save it . Next goto Mail Title & Texts . In the title Put something like "<b>Sales Order No. &WA_VBELN&</b> " and save. This will be replaced at runtime by the actual sales order number.

    Cheers

    Add comment
    10|10000 characters needed characters exceeded