Changing sender on sent email via SAP

I need to change the sender on sent email via sap; i mean, no sy-uname, something like [email protected]
Regards

Check the sample code
*& Report  ZASD
REPORT  ZASD.
This example shows how to send
  - a simple text provided in an internal table of text lines
  - and an attached MS word document provided in internal table
  - to some internet email address.
All activities done via facade CL_BCS!
DATA: send_request       TYPE REF TO cl_bcs.
DATA: text               TYPE bcsy_text.
data: binary_content     type solix_tab.
DATA: document           TYPE REF TO cl_document_bcs.
DATA: sender             TYPE REF TO cl_sapuser_bcs.
DATA: recipient          TYPE REF TO if_recipient_bcs.
DATA: bcs_exception      type ref to cx_bcs.
data: sent_to_all        type os_boolean.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename                      = 'c:\wagonTrain.gif'
   FILETYPE                      = 'BIN'
  HAS_FIELD_SEPARATOR           = ' '
  HEADER_LENGTH                 = 0
  READ_BY_LINE                  = 'X'
  DAT_MODE                      = ' '
  CODEPAGE                      = ' '
  IGNORE_CERR                   = ABAP_TRUE
  REPLACEMENT                   = '#'
  CHECK_BOM                     = ' '
  VIRUS_SCAN_PROFILE            = VIRUS_SCAN_PROFILE
IMPORTING
  FILELENGTH                    = FILELENGTH
  HEADER                        = HEADER
  TABLES
    data_tab                      = binary_content
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
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
    PERFORM main.
      FORM main                                                     *
FORM main.
  try.
    -------- create persistent send request ------------------------
      send_request = cl_bcs=>create_persistent( ).
    -------- create and set document with attachment ---------------
    create document from internal table with text
      APPEND 'Hello world!' TO text.
      document = cl_document_bcs=>create_document(
                      i_type    = 'RAW'
                      i_text    = text
                      i_length  = '12'
                      i_subject = 'test created by BCS_EXAMPLE_2' ).
    add attachment to document
    BCS expects document content here e.g. from document upload
    binary_content = ...
      CALL METHOD document->add_attachment
        EXPORTING  i_attachment_type = 'GIF'
                   i_attachment_subject = 'My attachment'
                   i_att_content_hex    = binary_content.
    add document to send request
      CALL METHOD send_request->set_document( document ).
<b>*     -
set sender -
    note: this is necessary only if you want to set the sender
          different from actual user (SY-UNAME). Otherwise sender is
          set automatically with actual user.
      sender = cl_sapuser_bcs=>create( sy-uname ).
      CALL METHOD send_request->set_sender
        EXPORTING i_sender = sender.</b>
    --------- add recipient (e-mail address) -----------------------
    create recipient - please replace e-mail address !!!
      recipient = cl_cam_address_bcs=>create_internet_address(
                                    'YOUR [email protected]' ).
    add recipient with its respective attributes to send request
      CALL METHOD send_request->add_recipient
        EXPORTING
          i_recipient  = recipient
          i_express    = 'X'.
CALL METHOD send_request->set_send_immediately( 'X' ).
    ---------- send document ---------------------------------------
      CALL METHOD send_request->send(
        exporting
          i_with_error_screen = 'X'
        receiving
          result              = sent_to_all ).
      if sent_to_all = 'X'.
        write text-003.
      endif.
      COMMIT WORK.
*                     exception handling
* replace this very rudimentary exception handling
* with your own one !!!
  catch cx_bcs into bcs_exception.
    write: 'Fehler aufgetreten.'(001).
    write: 'Fehlertyp:'(002), bcs_exception->error_type.
    exit.
  endtry.
ENDFORM.
*Check the BOL Part
Message was edited by: Amandeep  Singh

Similar Messages

  • Recive/Send Emails VIA SAP

    Hi
    I am just wondering is there any way we can receive email via SAP B1. I know I can send email using the outlook add-on. Is there any add-on or program that can be used to receive emails directly to SAP B1? Basically I just want to replace outlook.
    Thank you very much for your help
    Sanjaya

    Dear,
    You can user SBO Mailer function in the SAP Service Manager
    For installing it, Go to the Server Tool folder > Double Click "Setup.exe" > Select
    "Modify" option > Select (Check) the SBO Mailer component > and finish
    the installation..
    I attached a note 1145354 for your information as below :
    Symptom
    The following troubleshooting information may be required in configuring
    the Mail Services, in addition to the information covered in the
    Administration Guide:
    1.  Ensure that You have already setup an e-mail account for SAP
        Business One users on your mail server. To verify the connection
        with the mail server, choose Test Connection.
    2.  The mail service checks the connection with the specified mail
        server and e-mail account and displays an appropriate message.
    If the SMTP server requires some authentication, for example if the SMTP
    server is configured to accept only login authenticated mails, but you
    selected No Authentication, the test connection will be successful.
    However, no e-mails are sent.
    To check whether the connection to the SMTP server works, send a test
    e-mail.
    If the connection fails, make sure:
        o  You have entered the correct name of your mail server.
         o  You have entered the correct user name and password.
    After changing any of the settings, restart the SBO Mailer.
    Other terms
    SBO Mailer, SMTP server, test e-mail, configuring Mail Services,
    Reason and Prerequisites
    FAQ
    Solution
    The SAP Business One mail service supports mail server authentication
    using user name and password. This note describes troubleshooting
    information in addition to the information provided in the  Administration Guide.
    Wish the information above is useful for you.
    Regards
    Apple

  • How to configure canon ir 2250 to send scans to emails via exchange server 2010

    Hello
    I have one question:
    How to configure canon ir 2250 to send scans to emails via exchange server 2010?

    Hi,
    Based on my research, the member limit of a distribution list depends on the scalability and performance of your environment:
    http://blogs.technet.com/b/exchange/archive/2009/02/19/3407003.aspx
    Thanks,
    Angela Shi
    TechNet Community Support

  • I just downloaded Photos and I have lost the ability to easily send photos by email via Outlook.  Any suggestions?

    I just downloaded Photos and I have lost the ability to easily send photos by email via Outlook.  Any suggestions?

    If you use Mac Mail and Microsoft Outlook mail like I do, you could switch from one to the other mail program for send photos.
    iPhoto  >>  Preferences  >>  General tab  >>  E-mail foto's via  >>  select Microsoft Outlook.
    Click a photo  in iPhoto  >>  Share  >>  select E-mail …   >>  Microsoft Outlook will be launch.

  • Recruitment : Send email Via SAp System

    Hi,
    I am facing a big problem when I send email to application to cofirm that their application was received. I use Tcode PBAT to send email to application. In result screen, there is list of applicants that I sent email to . But all records noticed that "No fax or internet adress" .  I have already inputed internet adresses in IT0105
    I don't khow why System can't read data in IT0105 (Comunication).
    Please help me to undersatnd more about the Recruitment Module.
    Thanks so much
    Best Regards,
    Edited by: Sushi_intel on Dec 9, 2009 10:09 AM

    Hi all,
    Sorry for my delay. I went to SCOT and SOST to configure but the error still appear. I can send email to other internal address. But internet address is not. I don't kow why system can not read data in infotype Communication. Is there something wrong? I went to Mail Connection and configured as follow:
    *001  Mail confirmation of Receipt
    IDTXT RECEIPT
    RECV1
    RECV2 X
    RECV3 X
    SUBTY 0001
    OUTBX X*
    Please tell What I can do to send email to applicants automatically .
    Thanks so much.
    Edited by: Sushi_intel on Dec 15, 2009 9:21 AM

  • Sent email via iphone notes

    I sent someone an email via iphone notes to their yahoo account and was wondering how i can see a copy of that in my sent. it's not showing up in my gmail sent file.

    If you are using Verizon/Yahoo, then you need to change our servers to incoming.yahoo.verizon.net and outgoing.yahoo.verizon.net
    Your login info should be the same.
    Hope this helps!
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.
    "All knowledge is worth having."

  • Send BDC session link via SAP Office

    I know I've seen this somewhere.  If you have some code I can use, that would be wonderful.  If you even know a way to generate a SAP Office message with a link in it to process a BDC session, I'll debug it myself to figure it out and repost here.
    Basically, I'm doing a Call Transaction in a background process, if it fails, it will write to a BDC session.  I'd like to instantly send a SAP Office message to a group with a link in it to process the specific session that was generated.
    Thank you for any suggestions, code snippets, or references to where something like this is currently done in SAP.  I know I've seen it somewhere!

    Hi Ivan,
    I'm not sure of the exact details but I believe you have to change the processing type of the email action. I think there is a method call that you can select to send a mail to the SAP office mail.
    regards,
    Jason

  • Send error logs email through SAP workplace

    Hi,
    I need to send 4 different error log files to a unique user's email using SAP workplace, from my program. Plz provide a solution.
    Thanks.

    Hi,
    I need to send 4 different error log files to a unique user's email using SAP workplace, from my program. Plz provide a solution.
    Thanks.

  • How do you send comma dilimited email via cfmail?

    Hi All,
    Can anyone help what I need to do is to send email via cfmail in a comma dilimited format.  Is there an easy way to do this?
    Best,
    Joy

    Hi JR,
    This is my mailto output.
    <label>Name    </label>,#form.name#,
    <label>Company    </label>,#form.company#,
    <label>Address    </label>,#form.address#,
    <label>Address 2    </label>,#form.address2#,
    <label>City    </label>,#form.city#,
    <label>State    </label>,#form.State#,
    <label>Zip Code    </label>,#form.zip#,
    <label>Phone    </label>,#form.phone#,
    <label>Email    </label>,#form.email#
    This is how it comes out in the email.
    Name    ,Joy Lobdell, Company    ,testing email, Address    ,33 Puritan Drive, Address 2    ,, City    ,Port Chester, State    ,New York, Zip Code    ,10573, Phone    ,914-939-4681, Email    ,[email protected]
    How do you do it as a CSV string??  Because I think what I have won't work?
    Best,
    Joy

  • Why do i get a return comment of 'user account is in INVALID mode' when i send a pic email via cell

    my printer is the hp 3050a deskjet all in one j611g . when i send pics from phone via email, the return message via email says' user account is in INVALID mode'. why is this and how do i fix it?

    Hi shannee7, it may be because the Web Services function on your printer was removed. You could try re-enabling Web Services, which will print a new printer code by:
    Pressing the ePrint button on your printers front panel
    Scrolling down to "Remove Web Services" and selecting OK
    To re-enable Web Services press the ePrint button on the front panel
    Select OK to accept the terms of the service
    Front panel display should read "Downloading from Web" and a new Web Services info sheet should print out with a new code for your printer.
    If you have setup an ePrintCenter account you can log in and update your printers e-mail address  using the new code
    Let me know how you get on
    If my reply helped you, feel free to click on the Kudos button (hover over the "thumbs up").
    If my reply solved your problem please click on the Accepted Solution button so other Forum users may benefit from viewing the post.
    I am an HP employee.

  • Can't send or recieve email via gmail or yahoo thru apple mail

    I applied the update this morning, now I can't send or receive mail thru apple mail on any of my updated computers. Just shows gmail and yahoo "offline". try to take online, just get failure notice. Am on Yosemite 10.10.1

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try this: Delete the account in Mail and then set it up again.
     Cheers, Tom

  • External Send - Sending PO by email from SAP automatically

    Hi All,
    Please help me.
    I want to send email with PO, but no idea under the case below.
    We have 3 LOBs under 1 legal entity, so that the vendor master is shared with 3 LOBs.
    Then, a vendor has 2 departments ("A" department and "B" department) as well.
    Our 1 LOB want to send PO via email to "A" department in the vendor, however, we don't want to send PO to B department.
    On the other hand, the other LOB in our company wants to send PO to "B" department in the vendor, but does not want to send it to "A" department.
    This requirement can be handled in SAP?
    I would greatly appreciate your advice.
    Thanks.

    hi
    You can send purchase order via e-mail in SAP system, there are some configurations and pre-requisites to do as follow:
    1. You must maintain an e-mail address in the address in the vendor master.
    2. The same applies to your own user master. You also have to specify an e-mail address there in order to identify the sender.
    Note that it is not possible to change the e-mail address of the vendor via the SAP purchase order transaction (ME21N, ME22N, and so on). The system only uses the e-mail address of the vendor that is maintained in the vendor master!
    3. For the output type for default values, a communication strategy needs to be maintained in the Customizing that supports the e-mail. You can find the definition of the communication strategy in the Customizing via the following path: (SPRO -> IMG -> SAP Web Application Server -> Basic Services -> Message Control -> Define Communication Strategy). As a default, communication strategy CS01 is delivered. This already contains the necessary entry for the external communication. Bear in mind that without a suitable communication strategy it is not possible to communicate with a partner via Medium 5 (external sending).
    4. Use the standard SAP environment (program 'SAPFM06P', FORM routine 'ENTRY_NEU' and form 'MEDRUCK') as the processing routines.
    5. In the condition records for the output type (for example, Transaction MN04), use medium '5' (External send).
    6. You can use Transaction SCOT to trigger the output manually. The prerequisite for a correct sending is that the node is set correctly. This is not described here, but it must have already been carried out.
    7. To be able to display, for example, the e-mail in Outlook, enter PDF as the format in the node.
    For more details, check out the OSS note :191470
    regards
    kunal
    award if helpful

  • IPhone 5 sending all "Sent Emails" to "Trash" Folder and deleted items not showing up at all

    My boss has an iPhone 5 and today she realized that trash folder only has the last 50 emails that she has sent.
    The trash folder is empty.
    We use gmail. Her outlook is fine and the web interface is fine. She's tried restarting her phone. Will we have to delete the account and resync? (please say no...)
    Thanks!

    Dear Mr. Rakesh Vijayan,
    What is your justification for below behavior?
    Using basic Gapps (free) email server,IMAP option client with MSO2013. Window 7 professional
    MO Professional Plus,
    (15.0.4535.1006), MSO(15.0.4535.1507)32-bit.
    Auto migrated/upgraded from MS2007 to MS2013 in March, 2013.
    Inbox repair tools has been run 03 times since last 6 months in safe mode..
    Already configured Settings> advanced and deselect "Do not save copies of sent items
    Already configured File > Account Setting > double-click your IMAP account and adjust "Mail to keep offline" to "All".
    Since March 2013, 95% mails are getting saved/appearing in Sent Items folder. Only some times few mails are not appearing in sent item outlook client folder.
    All those emails are also appearing in All mail Folders.
    Any email sent from Gapps web interface/browser definitely getting save/ appearing in sent item outlook client folder.
    But now since last 4 days no email sent using outlook are appearing in sent items folder.
    Sincerely Yours
    Kranti Mohan | Head-Corporate Sales, Mkt. & Development |
    GPS Address:30.725144N,76.765755E
    Maya Hotels|SCO 325-328 | Himalaya Marg | Sector-35B | Chandigarh-160022, India. 
    T: +91(0172) 4688774x (D)/4688700x174 | M: +91 (0) 9915707030 | F: +91 (0172) 2660555
    [email protected] |  http://www.mayahotels.in
    http://www.facebook.com/mayahotel |  http://www.youtube.com/user/mayahotels
    http://twitter.com/mayahotels  |  https://www.orkut.co.in/Main#Community?cmm=101119348

  • Sending pictures to email via messages produces an error message

    I fairly certain that I've done this before, but I'm trying to forward pictures from messages to my email. Everytime I try I get an error message saying that the recipient has chosen not to receive messages from a 900-0 number on sprint. Has anyone else had this error or is it not possible to send pictures to an email address this way. Again, I'm pretty sure I've done this in the past.
    Any help is appreciated.

    http://www.kirupa.com/developer/actionscript/flash_php_email.htm
    hth,
    blemmo

  • Cannot send email via wifi in Microsoft exchange.

    Ever since updating my iPad and iPhone to iOS6, I have not been able to send Microsoft Exchange email via my home wifi network.  It just sits in my outbox.  I have tried deleting the account and setting up again but no change.

    Hi ronaldosy,
    How about the work flow of Outlook or OWA on PC internally/externally?
    If only phone has this issue, I suggest ask ActiveSync Forum for help so that you can get more professional suggestions. For your convenience:
    http://social.technet.microsoft.com/Forums/exchange/en-US/home?forum=exchangesvrmobility
    Best Regards,
    Allen Wang

Maybe you are looking for

  • SQLDeveloper 1.5

    Mac OSX 10.4.11 G4 2GB RAM installed SQLDeveloper 1.5. There is no connections tab (and no Connections under the view menu) and anything database related does not work, e.g. setting SQL database parameters under Tools/Preferences/Database - nothing c

  • Unwanted apps wont go away..

    I apoligize if this has already been posted, but I have updated some of my apps, and they get stuck jst saying ''loading..'', I can't delete them and can't re-update them. Is there anyway to get them off my ipod? Here's a pic of what i'm seeing. http

  • Windows not defined in the form

    Hi I created a zscript defining all the windows.and wrote a driver programm for the same. When I execute the driver program ,it runs into an error sating that 'window' including main window is not defined forthe form. Can anybody throw some light reg

  • JQuery Mobile and page transitions in Apex - how do they go together?

    Hi guys, I started off on a jQuery Mobile project with APEX - although I am still quite new to both. I have done quite a bit of research, but I haven't found really anything substantial about how they go together. Rather it appears to me, that both h

  • Search Resources

    Hi, I wanted to search a given XDP for the fragments used in it using the Search Resources API. I am stuck in writing the query for the search. Can someone help me out with this and help me building the query or post the query here