cancel
Showing results for 
Search instead for 
Did you mean: 

Delivery Number - Invoice Email Output

Former Member

For billing output types configured for External Send (email pdf) we're using "&XVBRK-VBELN&" in the Text for cover page for the condition records communication parameters via VV32 to display the Invoice/Bill Document number in the Email subject line. We'd like to add the Delivery Number (LIKP-VBELN) as well to the subject (if there are multiple delivery numbers, just the first one). Any ideas? The delivery number isn't apart of NAST or XVBRK.

Accepted Solutions (0)

Answers (2)

Answers (2)

madhu_vadlamani
Active Contributor
0 Kudos

Hi Joseph,

You can try like this.

*&---------------------------------------------------------------------*

*& Subroutine Pool   Z_MAIL_TITLE_TEXT

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT ZSD_MAIL_TITLE_TEXT.

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.

   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.           

and in nace try like this.I think it will work.

EN " Sales Order No. &WA_VBELN& "

Regards,

Madhu.

Shiva_Ram
Active Contributor
0 Kudos

You can check the following;

In t.code VTFL, at header level, check what value is assigned in the field  Reference number. If value C -delivery number is assigned, then I think you can find the value VBRK-XBLNR.

Regards,