External Mail sending

Dear ABAPers,
i am executing a program, For sending the mail, it returns sy-subrc = 2.
i am not able to see the sent mails in SOST (T-code) what may be the problem in Quality server.
but it is working correctly in Devolopment server.
Please give me the suitable solution
Thankyou....

check this
https://forums.sdn.sap.com/click.jspa?searchID=22529329&messageID=6970257
and this
https://forums.sdn.sap.com/click.jspa?searchID=22529464&messageID=6978740
hope it helps.

Similar Messages

  • External Mail Send after forwarding an item in SBWP

    Hi ,
    My requirement is that there is a Requistion workflow which send a notification in SBWP
    to the first approver and tthen to second approver when first one approves the requistion.At
    each step a workflow sends a mail to each approveralso.
    Sometimes the requisition is forwarded from one user to another from SBWP, and no mail
    is send if it is done from SBWP.
    Since i am new to workflow , please provide some way by which we can send an external
    mail whenever an item is forwarded from SBWP.
    Thanks

    Hello,
    "It seems you want to send work item to both SBWP and external mail box.
    To accomplish the same, go to SO16 transaction code.Under the tab Mail sy.grp, choose the radio button "Send to home addresses of users".
    That's all.You are done."
    The question is about sending mails, not work items.
    Setting SO16 by itself does nothing.
    Setting SO16 is just one part of getting mails sent to a SAP user to be sent on to an external address.
    regards
    Rick Bakker
    hanabi technology

  • External Mail Send (SMTP)...

    Dear All,
    Currently, All mails are internally sent to SAP Inbox for attached partners in Output type mail.
    (Goto>Header>Output-->Edit)
    What if i want to send mails to partners on to their gmail or yahoo Ids (external Send mail)?
    Also, where can i check settings for SMTP Server?
    Please, Assist me on the same.
    Thanks in Advance...
    Best Regards,
    Amit.

    Dear All
    In our organisation all the customer gets  Accounts the statement through the SMTP server .While executing the ABAP the following error has been reported .Can anyone tell em where is the issue in details step by step .
    Cannot process message, no route from SAROJP to umesh.manjarekar on his personal id 
        Message no. XS826
    Diagnosis
        To continue processing, the system requires a valid route from sender
        SAROJP to recipient umesh.manjarekar
    System Response
        The action was terminated.
        Error occurred in SAP in SAPconnect
    Procedure
        If this error was generated within the SAP system by SAPconnect, you
        have the following options:
        Create a route (i.e. assign a suitable address area, which covers the
    above address, to a node).
    1.  Check whether the route exists, but the node to which it is assigne
         is not in operation. If this is the case, change the route or put
         the node into operation.
    2.  Change the recipient address if it has been entered incorrectly.
    If the error was detected outside of the SAP system, please read the
    operator's manual for your communication software or contact the
    manufacturer.

  • Issue regarding external mail send

    Hi,
    I have created a workflow wherein i am sending a mail to my gmail address. The problem is that when i execute a workflow, it gives me status for task as completed but when i check my gmail mail doesnot appear in it.
    The thing i done regarding this issue is that i went to tcode SOST and from that tcode i executed but it was showing me error message as "Message cannot be transferred to node SMTP due to connection error (final)" How to solve this error ?
    I have also gone through SCOT tcode and there i done with SMTP node
    then why is this error and how to resolve it?
    Thanks
    Parag

    This problem is related to configuration in SCOT. I think you can check the Basis forums for more help.
    Check this link also
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10dfad5a-5398-2b10-568b-d3d999d49b5c
    Thanks
    Arghadip

  • Configure Ext. mail sending based on distribution channel automatically !

    Hi,
    Is it possible to configure external mail sending based on distribution channel automatically whenever a sales order is created without adding output type in Extras-output u2013 header-Edit.
    I have created output type to send mail whenever a sales order is created and is working fine but for this the concerned team has to add output type, sometimes they are ignoring this process, I want this process to be automated and also based on distribution channel, for ex- mail should be send only when distribution channel is 10 and not for all.
    Regards,
    Nishant Bhargava

    HI
    Try to Create a Access Sequence with Distributional Channel and maintain the Condition record (or)
    Give the logic to the ABAP like at the time of creating the sale order if distribution Channel is 10 then system will automatically send E- mail to customer
    Regards,
    Prasanna

  • Can't send smartform to external mail address

    Hi, everyone.
    Now, after creating some self-defined smartforms, we want to send its
    PDF copy to
    our external mail address. From this point, I had some try.
    Reference to SAP Library, I make a testing program named 'YPDF_TEST'.
    However, one exception always exists when running and error message id
    is 'XS806' - means
    "No delivery to &, invalid recipient address"
    I filled the address with following fields.
    [ dev_mail_recipient-logsys = 'CLNT600'.
    dev_mail_recipient-objtype = 'RECIPIENT'.
    dev_mail_recipient-objkey = '[email protected]'. ]
    I just can't understand the real reason why it doesn't work.
    Through debugging, I found the error occurs when handling the following
    codes
    in function "SX_ADDRESS_TO_DEVTYPE".
    [ swc_create_object o_recipient 'RECIPIENT' recipient_id-objkey.
    swc_get_property o_recipient 'CommunicationType' m_recipient-type.
    get_property_longvalue o_recipient m_recipient-address. ]
    On the current situation, if can't come over this problem,
    we may not build the connection and don't provide information in time.
    Failed to send, I yet try another function - added the tail but on earthdidn't get it ~~~
    Would you give me some hints or advice ?
    Any help is appreciated.
    ====================
    <i>REPORT ypdf_test .
    DATA: fm_name TYPE rs38l_fnam.
    DATA: my_control_pars TYPE ssfctrlop. "for CONTROL_PARAMETERS
    DATA: my_output_info TYPE ssfcrescl. "for JOB_OUTPUT_INFO
    DATA: output_options TYPE ssfcompop.
    DATA: e_devtype TYPE rspoptype.
    DATA: gw_lcprint TYPE ziebsflc001.
    DATA: bin_file TYPE xstring,
    bin_filesize TYPE i,
    ndiv TYPE i, offset TYPE i,
    nmod TYPE i.
    DATA: BEGIN OF bin_table OCCURS 0,
    x TYPE xstring,
    END OF bin_table.
    DATA: lines LIKE tline OCCURS 0.
    DATA: dev_mail_sender LIKE swotobjid, "B20K061818
    dev_mail_recipient LIKE swotobjid.
    DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
    DATA: param LIKE itcpp.
    my_control_pars-no_dialog = 'X'.
    my_control_pars-getotf = 'X'.
    Get genereated function name of Smartform
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'ZDEMO_SMART_FORM_PPF'
    IMPORTING
    fm_name = fm_name
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    ENDIF.
    Get Device type
    CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
    EXPORTING
    i_language = sy-langu
    I_APPLICATION = 'SAPDEFAULT'
    IMPORTING
    e_devtype = e_devtype
    EXCEPTIONS
    no_language = 1
    language_not_installed = 2
    no_devtype_found = 3
    system_error = 4
    OTHERS = 5 .
    IF sy-subrc <> 0.
    ENDIF.
    output_options-tdprinter = e_devtype.
    set needed mail option
    my_control_pars-device = 'MAIL'.
    dev_mail_sender-logsys = 'CLNT600'.
    dev_mail_sender-objtype = 'RECIPIENT'.
    dev_mail_sender-objkey = 'CHI_DEV03'.
    dev_mail_recipient-logsys = 'CLNT600'.
    dev_mail_recipient-objtype = 'RECIPIENT'.
    dev_mail_recipient-objkey = '[email protected]'.
    CALL FUNCTION fm_name
    EXPORTING
    control_parameters = my_control_pars
    mail_recipient = dev_mail_recipient
    mail_sender = dev_mail_sender
    output_options = output_options
    ip_carrid = 'ID'
    ip_connid = '8290'
    ip_fldate = sy-datum
    ip_bookid = '12345678'
    ip_customid = '09876521'
    ip_luggweight = 90
    ip_wunit = 'KG'
    ip_smoker = 'X'
    IMPORTING
    job_output_info = my_output_info
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Another try ***
    *DATA: param LIKE itcpp.
    *DATA: BEGIN OF off_obj.
    INCLUDE STRUCTURE soodk.
    *DATA: END OF off_obj,
    ok TYPE c,
    msgid TYPE symsgid,
    msgno TYPE symsgno,
    msgv1 TYPE symsgv,
    msgv2 TYPE symsgv,
    msgv3 TYPE symsgv,
    msgv4 TYPE symsgv.
    *DATA: dev_mail_applobj_tab LIKE swotobjid OCCURS 10 WITH HEADER LINE.
    *CALL FUNCTION 'CONVERT_OTF_AND_MAIL'
    EXPORTING
    mailoptions = param
    mail_sender = dev_mail_sender
    mail_recipient = dev_mail_recipient
    IMPORTING
    office_objid = off_obj
    mail_ok = ok
    msgno = msgno
    msgid = msgid
    msgv1 = msgv1
    msgv2 = msgv2
    msgv3 = msgv3
    msgv4 = msgv4
    TABLES
    mail_application_object_ids = dev_mail_applobj_tab
    otf = my_output_info-otfdata.</i>

    Hi,
    You can follow a different approach. Send the output of the Smartform to the spool.
    You have a Function Module to read the spool and convert it to PDF . Then there is one more function module to attach the PDF and send it as a mail.
    You need to configure SMTP in Tcode : SCOT.
    Search the forum with emailpdfattachment
    You have umpteen postings available.
    Pls reward if useful.
    Regards,
    Laxman Nayak

  • Sending from Business workplace to External mail ID

    Hi,
    Please Some help me on this issue am getting below error  when am trying to send mail from Business Workplace to External Mail
    Cannot process message , no route from SAPUSER TO abc123 at gmail dot com
    I done configuration by refereeing below.
    Please follow these steps:
    1.) tcode = SCOT
    2.) double click SMTP
    3.) under "SMTP Connection" section, fill in your mail host IP(ex: webmail.sap.com) and the port number(25) and code page = No conversion.
    4.) under "Supported address types", make sure Internet is checked, and click on "Set". The Address area has to be *
    5.) To test route,
    SCOT -->Utilities --> Routing test
    RecipientAddr.type = INT
    Recipient addr. = abc.xyz at sap dot com
    6.) You also need to set the Default Domain.
    SCOT --> Settings --> Default Domains (webmail.sap.com)
    7.)Now go to tcode SBWP,compose a mail and in the recipient address,enter abc.xyz at sap dot com and send.
    8.) Come back to SCOT and click on Utilities-->Start send process(CtrlF7) and execute.+
    Thanks,
    GAL

    Hi
    Same problem with me.
    Mails are not sending to external mail id.
    Pls help me out!
    Regards.

  • Sending external mail using SO_NEW_DOCUMENT_ATT_SEND_API1

    When i use this RFC by appending the internal table receiver with receiver: sapuser name and rec_type  B it triggers mail to the sap user login .But when i give external email address for receiver with rec_type 'U' it is not triggering any mail.Can anyone please tell me how to use this RFC in sending external mails??

    I went back and you are right "INT" was not the REC_TYPE it was the COM_TYPE.
    Sorry for any confusion caused.
    However,
    I suggest 2 more tests and then I give up and can not think about anything else.
    Try:
    #1
    REC_TYPE = 'X'.
    if it does not work.
    #2
    REC_TYPE = 'R'.
    Hope that will do the trick. I was trying a lot when I had to get that working some time ago.
    And surely the other colleagues point to something which must be setup as well. Transaction SCOT the SMTP settings.
    Furthermore there could be another issue. I remember that I worked at a client who had turned off the send settings on their email server. So SAP finished everything and handed the emails on to a mail server. The mail server had a setting to block any emails from the development environment.
    So that might be another cause of your issue.

  • How to send "SPOOL" on SAP MAil or external mail in background???

    I tried using 'SO_DOCUMENT_REPOSITORY_MANAGER' function but it failed when I run it in background. I learned that it calls a screen at the middle of the process which needs user input to go on with the process.
    Is there other way that I could send spool on SAPMail or external Mail in background??? Any suggesstions will be greatly appreciated.. thanx...

    see below sample function module, you can use in backgroud also
    FUNCTION Z_SEND_MAIL_FOR_SPOOLLIST.
    ""Local interface:
    *"       IMPORTING
    *"             VALUE(SPOOLNUMBER) LIKE  SY-SPONO DEFAULT SY-SPONO
    *"             VALUE(MAILNAME) LIKE  SOOD1-OBJNAM DEFAULT 'NOTE'
    *"             VALUE(SUBJECT) LIKE  SOOD1-OBJDES
    *"             VALUE(RECEPIENT) LIKE  SY-UNAME OPTIONAL
    *"             VALUE(DLI) LIKE  SOOS1-DLINAM OPTIONAL
    *"       TABLES
    *"              TEXT STRUCTURE  SOLI OPTIONAL
    *"       EXCEPTIONS
    *"              ERROR
    DATA: OBJECT_HD_CHANGE LIKE SOOD1 OCCURS 0 WITH HEADER LINE,
          OBJPARA          LIKE SELC  OCCURS 0 WITH HEADER LINE,
          RECEIVERS        LIKE SOOS1 OCCURS 0 WITH HEADER LINE.
    OBJECT_HD_CHANGE-OBJLA  = SY-LANGU.
    OBJECT_HD_CHANGE-OBJNAM = MAILNAME.
    OBJECT_HD_CHANGE-OBJDES = SUBJECT.
    OBJECT_HD_CHANGE-OBJSNS = 'F'.
    OBJECT_HD_CHANGE-VMTYP  = 'T'.
    OBJECT_HD_CHANGE-SKIPS  = 'X'.
    OBJECT_HD_CHANGE-ACNAM  = 'SP01'.
    OBJECT_HD_CHANGE-OBJCP  = 'X'.
    RECEIVERS-RCDAT  = SY-DATUM.
    RECEIVERS-RCTIM  = SY-UZEIT.
    IF DLI IS INITIAL.
        RECEIVERS-RECNAM = RECEPIENT.
        RECEIVERS-RTUNAM = RECEPIENT.
    ELSE.
        RECEIVERS-RECNAM = DLI.
        RECEIVERS-ADR_NAME = DLI.
        RECEIVERS-RECESC = 'C'.
    ENDIF.
    RECEIVERS-SNDEX  = 'X'.     " Express-Mail
    APPEND RECEIVERS.
    OBJPARA-NAME = 'SPI'.
    OBJPARA-LOW  = SPOOLNUMBER.
    APPEND OBJPARA.
    CALL FUNCTION 'SO_OBJECT_SEND'
          EXPORTING
               OBJECT_HD_CHANGE           = OBJECT_HD_CHANGE
               OBJECT_TYPE                = 'RAW'
               OWNER                      = SY-UNAME
          TABLES
               OBJCONT                    = TEXT
               OBJPARA                    = OBJPARA
               RECEIVERS                  = RECEIVERS
          EXCEPTIONS
               OTHERS                     = 01.
    IF SY-SUBRC NE 0.
       RAISE ERROR.
    ENDIF.
    ENDFUNCTION.

  • Send Mail to External Mail ID's for Multiple Users

    Hi All,
    I want to send mail from SAP to External mail ID's for multiple Users.The program is ok.
    But I want to send this to Multiple external Mail id's. Where should I assign this receivers list. Pls advise.
    What is the transaction to assign multiple receivers.?
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            DOCUMENT_DATA              = GD_DOC_DATA
            PUT_IN_OUTBOX              = 'X'
            COMMIT_WORK                = ''
          TABLES
            PACKING_LIST               = IT_PACKING_LIST
            CONTENTS_TXT               = IT_MESSAGE
            RECEIVERS                  = IT_RECEIVERS
          EXCEPTIONS
            TOO_MANY_RECEIVERS         = 1
            DOCUMENT_NOT_SENT          = 2
            DOCUMENT_TYPE_NOT_EXIST    = 3
            OPERATION_NO_AUTHORIZATION = 4
            PARAMETER_ERROR            = 5
            X_ERROR                    = 6
            ENQUEUE_ERROR              = 7
            OTHERS                     = 8.
    Thank You.
    Pranitha.

    IT_RECEIVERS parameters needs to be passed as shown below.
        wa_receivers-receiver = "..........External mail id".
        wa_receivers-rec_type = 'U'.
        wa_receivers-express = 'X'.
        APPEND wa_receivers TO lt_receivers.
        CLEAR  wa_receivers.
    Once mail is triggered to the external mail id's, check the mail is transferred from SAP or not using the tcode SCOT.
    In SCOT,follow the path UTILITIES-> Overview of send orders.
    Regards,
    Satish Kanteti

  • Send notification to external mail id when work item reach users inbox

    hi all ,
              i would like to know wat are all the settings required for sending an external mail when a user recieves a work item. i think it can be done by running the program rswuwfml .but wat are all the settings required to be done before running the program .....
    Useful answers will be rewarded.......

    What the??!!!! I totally missed this before and actually found it quite acidentally....
    >Yep true! Totally agree with Kjtetil, it adds to an already noisy forum and I am >afraid if others start aping it will be brought down on level with the XYZ forum. >And we don't want that!
    >Anyone volunteering to have the 'M' flag?
    Though I cannot comprehend what you are trying to get at or say I will, attempt to set the record straight.
    Yes I have said that on another thread. I am not asking for points anywhere, I am happy to receive and happier to solve someone's problem.
    The issue with this thread is the author obviously has not bothered to do any investigation. I am not for spoon feeding just for the sake of some points, I am willing to help those who do some bit from their end as well who encounter a genuine stumbling block.
    My reference to "reward" was with a bit of sarcasm, if you know what that means.

  • Problem in Sending External Mail

    Hi all,
    I am facing a problem in sending message to the external mail server. My problem is i have created a workflow template and in that i have created a send mail step and in that i am giving a message and the recipient type is email address and the email address is [email protected]
    But i am not receiving any mail to my outlook. The configuration in scot are perfect.
    When i tried to send a message from my inbox new message i can able to see the mail in my outlook.
    Please help me in this issue, it is very urgent.
    Regards
    Balaji E.

    Hi Prasath,
    Thanks for your kind help. I checked that too, but giving me an error
    Short Text
    "Cannot process message in SAP System"
    Long Text:
    Cannot process message in SAP System
        Message no. XS817
    Diagnosis
        Processing could not be continued due to a technical or configuration
        error in the SAP system.
    System Response
        Processing was terminated.
    Procedure
        Processing was terminated in the SAP system. The reason is given in the
        details below:
        The received e-Mail address WIPRO6 does not corres
    Can any one help me in this issue.
    Note : For the user WF-Batch there is no email id specified then i specified that and saved it.
    Regards,
    Balaji E.

  • Error in sending external mail

    hi ..
    while sending mail using BCS objects .... i am geting error
    Internal error: SO_OBJECT_MIME_GET Exception: 2
    ....i too configured SCOT transaction wit port number 25 , mail host and also given the internet email id for mailing user....
    plz do help me ...

    This error occurs when you send a mail via the SMTP node and can have several causes:
    1. Default domain not set
    2. Default code page not set (only with multi-codepage systems)
    3. Code page not suitable for sending mail
    4. COMMIT WORK is missing (programming error)
    5. Workplace plug-in is missing
    Solution
    Activate the SAPconnect trace and resend the document if necessary. The next time the SAPconnect send job is running, search for the entries marked in red in the SAPconnect trace of the document. The applicable solutions, depending on these entries, are listed below:
    1. Default domain not set
    Trace entries:
    BCS->MIME_MESSAGE_GENERATE
    Sender Address Not Found 80
    SO_OBEJECT_MIME_GET
    No MIME Document Received. Error Code: SENDER_BCS
    SX_GENERATE_NDR
    Internal Error: SO_OBJECT_MIME_GET Exception: 0
    or
    SX_GENERATE_NDR
    Internal error: SO_OBJECT_MIME_GET Exception: 2
    or:
    BCS->MIME_MESSAGE_GENERATE
    Error during MIME Flow Generation
    BCS->MIME_MESSAGE_GENERATE
    Error During Automatic Determinaton of Default Internet Domain
    SO_OBEJECT_MIME_GET
    No MIME Document Received. Error Code: MIME_BCS
    SX_GENERATE_NDR
    Internal Error: SO_OBJECT_MIME_GET Exception: 0
    or
    SX_GENERATE_NDR
    Internal error: SO_OBJECT_MIME_GET Exception: 2
    Solution: In the SAPconnect Administration (transaction SCOT), you must set the domain of the SAP System (Settings --> Default Domain).
    2. Default code page not set (only with multi-codepage systems)
    Trace entries:
    CL_BCOM_MIME->GET_CODEPAGE
    Termination: Multi-Codepage Systems Not Supported
    SO_OBEJECT_MIME_GET
    No MIME Document Received. Error Code: MNA_DOC
    SX_GENERATE_NDR
    Internal Error: SO_OBJECT_MIME_GET Exception: 0
    or
    SX_GENERATE_NDR
    Internal error: SO_OBJECT_MIME_GET Exception: 2
    Solution: In the SAPconnect Administration (transaction SCOT), you must specify a code page on the SMTP node.
    3. Code page not suitable for sending mail
    Trace entries:
    CL_BCOM_MIME->GET_CHARSET
    Termination: Charset Cannot Be Determined for SAP Code Page
    SO_OBEJECT_MIME_GET
    No MIME Document Received. Error Code: MNA_DOC
    SX_GENERATE_NDR
    Internal Error: SO_OBJECT_MIME_GET Exception: 0
    or
    SX_GENERATE_NDR
    Internal error: SO_OBJECT_MIME_GET Exception: 2
    Solution: In the SAPconnect Administration (transaction SCOT), you must specify a code page (an entry is available in table TCP00A) that is suitable for sending mail on the SMTP node.
    4. COMMIT WORK is missing (programming error)
    Trace entries:
    SO_OBEJECT_MIME_GET
    No Send Order Exists -> Termination
    SX_GENERATE_NDR
    Internal Error: SO_OBJECT_MIME_GET Exception: 0
    Solution: See note 429427 for the correction.
    5. Configuration for the sending of Business Objects
    An attempt is made to send a document of type OBJ to an external recipient. This requires a conversion to TXT/HTML format, but the necessary modules are not configured correctly.
    Trace entries:
    SX_OBJECT_CONVERT_OBJ_HTM
    Converting Document Format from OBJ to TXT/HTML
    SO_OBEJECT_MIME_GET
    No MIME Document Received. Error Code: MNA_DOC
    SX_GENERATE_NDR
    Internal Error: SO_OBJECT_MIME_GET Exception: 0
    or
    SX_GENERATE_NDR
    Internal error: SO_OBJECT_MIME_GET Exception: 2
    Solution:
    Please refer to Note 530932.
    1. You can refer to SAP Note 487754.
    2. Error in Sending External Mail
    3. Re: BWCCMS: send email if process chain fails?
    Hope this will solve your issue.
    Re: Send mails
    Re: SCOT Setup
    Reward points..

  • How to send an external mail from workflow.

    Hi,
    I have created a send mail in my workflow but it isnot sending the external mail
    Any guesses?

    Check the status in SOST . If not ask ur BASIS guys to work on SCOT.
    Richard A

  • External Mail's Sending Via Abap Code

    <u>Hello, everyone.</u>
    I have a problem with an external mail's sending, I have to solve it very quickly.
    I'm tring to send mail to a specific address with an attachment but it doesn't work.
    Does any one has some source code that works (with file attached) ?
    Thanks in advance,
    Rebeka

    Hi rebeka,
    1. There is some trick involved
    in the binary files.
    2. I have made a program (and it works fantastic)
    ONLY 6 LINES FOR EMAILING
    BELIEVE ME
    ITS A FANTASTIC PROGRAM.
    IT WILL WORK LIKE OUTLOOK EXPRESS !
    3. The user is provided with
    a) file name
    b) email address to send mail
    and it sends ANY FILE (.xls,.pdf .xyz..)
    Instantaneously !
    4. Make two things first :
    1. Include with the name : ZAMI_INCLFOR_MAIL
    2. Report with the name : ZAM_TEMP147 (any name will do)
    3. Activate both and execute (2)
    4. After providing filename, email adress
    5. Code for Include :
    10.08.2005 Amit M - Created
    Include For Mail (First Req F16)
    Modification Log
    Data
    DATA: docdata LIKE sodocchgi1,
    objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
    objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
    objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objhex LIKE solix OCCURS 10 WITH HEADER LINE,
    reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA: tab_lines TYPE i,
    doc_size TYPE i,
    att_type LIKE soodk-objtp.
    DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
    FORM
    FORM ml_customize USING objname objdesc.
    Clear Variables
    CLEAR docdata.
    REFRESH objpack.
    CLEAR objpack.
    REFRESH objhead.
    REFRESH objtxt.
    CLEAR objtxt.
    REFRESH objbin.
    CLEAR objbin.
    REFRESH objhex.
    CLEAR objhex.
    REFRESH reclist.
    CLEAR reclist.
    REFRESH listobject.
    CLEAR listobject.
    CLEAR tab_lines.
    CLEAR doc_size.
    CLEAR att_type.
    Set Variables
    docdata-obj_name = objname.
    docdata-obj_descr = objdesc.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addrecp USING preceiver prec_type.
    CLEAR reclist.
    reclist-receiver = preceiver.
    reclist-rec_type = prec_type.
    APPEND reclist.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addtxt USING ptxt.
    CLEAR objtxt.
    objtxt = ptxt.
    APPEND objtxt.
    ENDFORM. "ml_customize
    FORM
    FORM ml_prepare USING bypassmemory whatatt_type whatname.
    IF bypassmemory = ''.
    Fetch List From Memory
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = listobject
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'LIST_FROM_MEMORY'.
    ENDIF.
    CALL FUNCTION 'TABLE_COMPRESS'
    IMPORTING
    COMPRESSED_SIZE =
    TABLES
    in = listobject
    out = objbin
    EXCEPTIONS
    OTHERS = 1
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'TABLE_COMPRESS'.
    ENDIF.
    ENDIF.
    Header Data
    Already Done Thru FM
    Main Text
    Already Done Thru FM
    Packing Info For Text Data
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'TXT'.
    APPEND objpack.
    Packing Info Attachment
    att_type = whatatt_type..
    DESCRIBE TABLE objbin LINES tab_lines.
    READ TABLE objbin INDEX tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = att_type.
    objpack-obj_name = 'ATTACHMENT'.
    objpack-obj_descr = whatname.
    APPEND objpack.
    Receiver List
    Already done thru fm
    ENDFORM. "ml_prepare
    FORM
    FORM ml_dosend.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = docdata
    put_in_outbox = 'X'
    commit_work = 'X' "used from rel. 6.10
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    TABLES
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    CONTENTS_HEX = objhex
    OBJECT_PARA =
    object_parb =
    receivers = reclist
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8
    IF sy-subrc <> 0.
    MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
    WITH docdata-obj_name.
    ENDIF.
    ENDFORM. "ml_customize
    FORM
    FORM ml_spooltopdf USING whatspoolid.
    DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    Call Function
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = whatspoolid
    TABLES
    pdf = pdf
    EXCEPTIONS
    err_no_otf_spooljob = 1
    OTHERS = 12.
    Convert
    PERFORM doconv TABLES pdf objbin.
    ENDFORM. "ml_spooltopdf
    FORM
    FORM doconv TABLES
    mypdf STRUCTURE tline
    outbin STRUCTURE solisti1.
    Data
    DATA : pos TYPE i.
    DATA : len TYPE i.
    Loop And Put Data
    LOOP AT mypdf.
    pos = 255 - len.
    IF pos > 134. "length of pdf_table
    pos = 134.
    ENDIF.
    outbin+len = mypdf(pos).
    len = len + pos.
    IF len = 255. "length of out (contents_bin)
    APPEND outbin.
    CLEAR: outbin, len.
    IF pos < 134.
    outbin = mypdf+pos.
    len = 134 - pos.
    ENDIF.
    ENDIF.
    ENDLOOP.
    IF len > 0.
    APPEND outbin.
    ENDIF.
    ENDFORM. "doconv
    CODE FOR PROGRAM
    5.
    REPORT zam_temp147 .
    INCLUDE zami_inclfor_mail.
    DATA
    DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : file_name TYPE string.
    data : path like PCFILE-PATH.
    data : extension(5) type c.
    data : name(100) type c.
    SELECTION SCREEN
    PARAMETERS : receiver TYPE somlreci1-receiver lower case.
    PARAMETERS : p_file LIKE rlgrap-filename
    OBLIGATORY.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CLEAR p_file.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    file_name = p_file.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM ml_customize USING 'Tst' 'Testing'.
    PERFORM ml_addrecp USING receiver 'U'.
    PERFORM upl.
    PERFORM doconv TABLES itab objbin.
    PERFORM ml_prepare USING 'X' extension name.
    PERFORM ml_dosend.
    SUBMIT rsconn01
    WITH mode EQ 'INT'
    AND RETURN.
    FORM
    FORM upl.
    file_name = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = file_name
    filetype = 'BIN'
    TABLES
    data_tab = itab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    path = file_name.
    CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
    EXPORTING
    complete_filename = path
    CHECK_DOS_FORMAT =
    IMPORTING
    DRIVE =
    EXTENSION = extension
    NAME = name
    NAME_WITH_EXT =
    PATH =
    EXCEPTIONS
    INVALID_DRIVE = 1
    INVALID_EXTENSION = 2
    INVALID_NAME = 3
    INVALID_PATH = 4
    OTHERS = 5
    ENDFORM. "upl
    regards,
    amit m.

Maybe you are looking for

  • Sales Information System Performance Transaction MCSI

    Hi, We create a few years ago some Sales Information System using structures and tables Snnn. This structures/tables are accessible from transaction MCSI . Right now the performance of the access to this information is very bad. We need a lot of time

  • Ora-01468 in discovere

    I have 1 master 2 detail tables i am joining them as the query below. i am using a calculation and using that calculation in a condition. the calulation is a sum of 2 columns between the 2 detail table. every time i use this calculation in a conditio

  • How to get the column index of the selected column

    Hi All, I have a dynamically populated advanceddatagrid. Iam trying to edit any column of a particular row. In my as file im able to get the row index using selecteditem property. But I need to get the column Index and the updated value of the column

  • MacBook Pro Internal HDD Not Recognized

    My late 2012 MacBook Pro does not seem to want to recognize internal hard drives any longer. I have pulled the original startup disk and installed it in an external hard drive case and the mac will now boot from that. The brand new replacement hard d

  • 1131 APs have refused to register with WLC2106

    Hi all, my 1131 AP has refused to register with a WLC2106. I get this on my AP console when i enable DHCP: *Mar 1 00:00:09.493: %SNMP-5-COLDSTART: SNMP agent on host AP001d.e555.df68 is undergoing a cold start *Mar 1 00:00:10.368: %LINK-3-UPDOWN: Int