Skip to Content
author's profile photo Former Member
Former Member

sending a script in mail (outside SAP)

Hi,

Currently i am sending my mail to ids in SAP. so that i am able to do straightaway by giving device as 'mail'. please check code below.

CALL function 'OPEN_FORM'

EXPORTING

  • APPLICATION = 'TX'

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMS =

DEVICE = 'MAIL'

DIALOG = SPACE

FORM = 'ZRRS_VENDOR_REM' "HEADER-TDFORM

LANGUAGE = 'E'

OPTIONS = OPTIONS

MAIL_RECIPIENT = RECIPIENT_ID

MAIL_APPL_OBJECT = APPL_OBJECT_ID

But now i have to send the same script outside SAP. What changes do i have to make. I think i have to use SO_NEW_DOCUMENT_SEND_API1 but how. And i dont want to send any internal table. I just want to send whatever is there in SAP script..

Can some one advice.

Thanks in Advance.

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 04, 2006 at 05:57 AM

    check RSTXPDF4/5.

    process will like this.

    1.capture the OTF code of the Script.

    like this

    <b>options-tdgetotf = 'X'.</b>.

    2.

    * Data for ESS scenario
      call function 'CLOSE_FORM'
        IMPORTING
          RESULT                   = result
          RDI_RESULT               = rdi
        TABLES
          OTFDATA                  = OTF_TABLE
        EXCEPTIONS
          unopened                 = 1
          bad_pageformat_for_print = 2
          others                   = 3.
      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 'CONVERT_OTF'
     EXPORTING
       FORMAT                      = 'PDF'
    *   MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
    *   COPYNUMBER                  = 0
    *   ASCII_BIDI_VIS2LOG          = ' '
      IMPORTING
        BIN_FILESIZE                = LEN_OUT
    *   BIN_FILE                    =
      TABLES
        OTF                         = otf_table
        LINES                       = pdf
    * EXCEPTIONS
    *   ERR_MAX_LINEWIDTH           = 1
    *   ERR_FORMAT                  = 2
    *   ERR_CONV_NOT_POSSIBLE       = 3
    *   ERR_BAD_OTF                 = 4
    *   OTHERS                      = 5
              .

    .

    here u will get data in PDF foramt.

    after that u can send the data .

    Regards

    prabhu

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 04, 2006 at 06:00 AM

    Hi,

    use this FM

    'SO_NEW_DOCUMENT_ATT_SEND_API1'

    after using 'CONVERT_OTF' to send mails.

    Regards,

    Sumit.

    Add comment
    10|10000 characters needed characters exceeded