RE: Mail sent to SAP inbox-Urgent.

Hi,
I sent mail with attachment( internal table contents) to SAP inbox using the below codw.
   DATA: l_text TYPE char255.  " Text
*DATA: l_text(280) TYPE c.  " Text
DATA: l_lines TYPE i,
      l_size    TYPE  sood-objlen.      " Size of Attachment
Mail related
DATA: i_content         TYPE   soli_tab, " Mail content
      i_attach          TYPE   soli_tab. " Attachment
DATA: l_send_request    TYPE REF TO    cl_bcs,   " E-Mail Send Request
      l_document        TYPE REF TO    cl_document_bcs,   " E-Mail Attachment
      l_recipient       TYPE REF TO    if_recipient_bcs,  " Distribution List
      l_sender          TYPE REF TO    if_sender_bcs,     " Address of Sender
      l_uname           TYPE           salrtdrcpt,        " Sender Name(SY-UNAME)
      l_bcs_exception   TYPE REF TO    cx_document_bcs,   " BCS Exception
      l_addr_exception  TYPE REF TO    cx_address_bcs,    " Address Exception
      l_send_exception  TYPE REF TO    cx_send_req_bcs.   " E-Mail sending Exception
DATA: l_recipient_soos  TYPE           soos1.
*data : p_uname TYPE ad_smtpadr .
FORM send_to_sap_mail .
Preparing body of the Mail
  MOVE 'Pending Delivery Documents List' TO l_text.
  APPEND l_text TO i_content.
Preparing contents of attachment with Change Log
  PERFORM prepare_attachment.
Creates persistent send request
  TRY.
      l_send_request = cl_bcs=>create_persistent( ).
Creating Document
      l_document = cl_document_bcs=>create_document(
                                    i_type  = 'RAW'
                                    i_text  = i_content[]
                                    i_subject = 'Pending Delivery Documents' ).
     DESCRIBE TABLE i_mara LINES l_lines.
DESCRIBE TABLE it_output LINES l_lines.
Size to multiplied by 2 for UNICODE enabled systems
      l_size = l_lines * 2 * 255.
Adding Attachment
      CALL METHOD l_document->add_attachment
        EXPORTING
          i_attachment_type    = c_ext
          i_attachment_size    = l_size
          i_attachment_subject = 'Pending Delivery Documents'
          i_att_content_text   = i_attach[].
Add document to send request
      CALL METHOD l_send_request->set_document( l_document ).
Get Sender Object
      l_uname = sy-uname.
      l_sender = cl_sapuser_bcs=>create( l_uname ).
      CALL METHOD l_send_request->set_sender
        EXPORTING
          i_sender = l_sender.
E-Mail
      TRANSLATE p_uname TO UPPER CASE.
     l_recipient_soos-recesc = 'B'.
     l_recipient_soos-recnam = p_uname.
Preparing recepient from SAP Logon Name
          CALL METHOD cl_send_request_bcs=>create_recipient_from_soos1
                EXPORTING
                  i_soos1 = l_recipient_soos
                RECEIVING
                  result = l_recipient.
Add Recipient
      CALL METHOD l_send_request->add_recipient
        EXPORTING
          i_recipient  = l_recipient
          i_express    = 'U'
          i_copy       = ' '
          i_blind_copy = ' '
          i_no_forward = ' '.
*Trigger E-Mail immediately
      l_send_request->set_send_immediately( 'X' ).
      CALL METHOD l_send_request->send( ).
      COMMIT WORK.
    CATCH cx_document_bcs INTO l_bcs_exception.
    CATCH cx_send_req_bcs INTO l_send_exception.
    CATCH cx_address_bcs  INTO l_addr_exception.
  ENDTRY.
Refresh it_output.
clear l_text.
clear I_content.
refresh I_attach.
ENDFORM.                    " Send_to_sap_mail
*&      Form  prepare_attachment
      text
-->  p1        text
<--  p2        text
FORM prepare_attachment .
FIELD-SYMBOLS: <lfs_table>,    " Internal table structure
                 <lfs_con>.      " Field Content
DATA: l_text TYPE char1024.     " Text content for mail attachment
DATA: l_text(1280) TYPE c.     " Text content for mail attachment
  DATA: l_con(50) TYPE c.        " Field Content in character format
Columns to be tab delimeted
  LOOP AT it_output ASSIGNING <lfs_table>.
    DO.
      ASSIGN COMPONENT sy-index OF STRUCTURE <lfs_table>
             TO <lfs_con>.
      IF sy-subrc NE 0.
        CONCATENATE c_cr l_text INTO l_text.
        APPEND l_text TO i_attach.
        EXIT.
      ELSE.
        CLEAR: l_con.
        MOVE <lfs_con> TO l_con.
        CONDENSE l_con.
        IF sy-index = 1.
          CLEAR: l_text.
          MOVE l_con TO l_text.
        ELSE.
          CONCATENATE l_text l_con INTO l_text
             SEPARATED BY c_tab.
        ENDIF.
      ENDIF.
    ENDDO.
  ENDLOOP.
ENDFORM.                    " prepare_attachment
Here my problem is in my internal table i have 30 columns and the row output length is more than 255 char,
and the SOLI structure fields defined as CHAR255, thats why when i am opening the sap mail attachment in Excel sheet, last three fields data is not displaying can any one please let me know the answer.

loop at output_table.
  concatenate g_string
                     filed1
                     filed2
                 CL_ABAP_CHAR_UTILITIES=>CR_LF
  into g_string separted by
           CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
endloop.
now pass the filled string to
CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
    EXPORTING
      text            = g_string
  IMPORTING
    LENGTH          = LENGTH
    TABLES
      ftext_tab       = obj_bin.
pass this objbin to SO_NEW_DOCUMENT_ATT_SEND_API1
now you will get the desired excel sheet.
NOte: dont put urgent in your subject.it is arule that people should not ans question which have urgent.
Edited by: S.r.v.r.Kumar on Jun 18, 2008 10:25 PM

Similar Messages

  • PO workflow mail not sent to SAP Inbox

    Hi All,
    I have created a standard PO workflow WS20000075 , Task TS20000166 and in SPRO i have maintained Object type as "US"(user) and agent is maintained.No agent determination rule is maintained for the task.
    When i create and Save PO, system is not triggering workflow to my SAP Inbox.
    When i test the workflow using SWDD by giving PO number and release code, i am getting mail to my SAP Inbox
    What setting i am missing to trigger the workflow to my SAP Inbox as soon as i save my PO.

    Hi,
    I have verified the setting is SWDD -Basic data, event linkage and binding exists
    The event to workflow container details are given below
    &_EVT_OBJECT&                             &PURCHASE ORDER&
    &RELEASECODE&                            &RELEASECODE&
    &_EVT_CREATOR&                          &_WF_INITIATOR&
    Please let me know what setup is missing to trigger the workflow automatically

  • Mail not in SAP inbox.

    Hi Gurus,
    I am new to workflow.. I have created a workflow from one of the examples of User Decision and SendMail.
    After i recive the work item .. i have three options: Approve, reject and cancel.
    when i click aprrove ior reject, i am supposed to recieve mail in my sap inbox..
    But i am unable to see the same/get the same..
    Can neone tell me if some settings need to be in place..?
    Best Regards,
    Navin Fernandes.

    Please check the setting in SWU3...
    there Maintain Runtime Environment should be maraked as Green tick mark...
    If not...please do the Perform Automatic customizing...by clicking the second icon at the top....
    Then test your workflow....

  • Mail to be sent from SAP inbox to user outlook

    Dear All,
    Any idea of sending the mails automatically present in SAP Inbox  into user outlook inbox.
    All at a time cannot schedule all the users.
    Only once we can schedule.
    Regards,
    Anand.

    Hi,
    refer http://wiki.sdn.sap.com/wiki/display/ABAP/SendSpoollistofbackgroundjobtoSAPinbox
    Thanks,
    Chandra

  • To Call a transaction from message body of an e-mail sent from SAP

    I have requirement to call a transaction (say MM03) when I click on some text ( Like  Hyperlink ) in the message body of an email sent by SAP.
    Please let me know how it should be done.

    I dont know whether you can do hyperlink in the mail but i can think of following 2 options:
    1)  Use Workflow and send it to user and then attach transaction MM03 to that so that when user receives message, he/she can directly open MM03.
    2)  In report, you can have hyperlink.

  • Mail to Buyers SAP inbox once PR is released

    Hi All,
    How to configure the system so that a mail will be triggered to buyers SAP inbox once PR is released.
    Thanks in Advance
    Pavan H S

    Hi,
    Found this in SAP Note 365604 for release strategies in purchasing:
    "3. User exit
    During the individual release for purchase requisitions, the user exit
    is called in function module ME_REL_STRATEGIE_EBAN, in the overall
    release, it is called in function module ME_REL_GENERAL_STRATEGY_EBAN.
    (Enhancement M06B0002, EXIT_SAPLEBND_001, ZXM06U13)"
    You may be able to get a programmer to insert some code in this customer exit to initiate the mail message.
    Regards

  • How do I get my AOL mail sent to my inbox on iMac

    How do I get my AOL mails sent to my iMac inbox?

    Hi there,
    Go to System Preferences, then click on 'Mail, Contacts & Calendars', click add, at the bottom of the list of accounts, and then scroll and click 'AOL'.
    Let me know you get on,
    Nathan

  • Mail alerts with sap inbox

    Hi can any one tell me the procedure of   Pushing  BO inbox item to Lotus Notes and SAP Inbox with step by step means , how to cofigure it ?

    Hi,
    well you should ask your Lotus Notes administrator to setup an SMTP gateway on the LotusNotes side for you. I know that this is possible but I have not done it myself before. And since this is an SAP BusinessObjects forum I am not sure you will get an answer about this here.
    Regards
    Stratos
    PS: I found the following link in the internet
    [http://www-12.lotus.com/ldd/doc/domino_notes/Rnext/help6_admin.nsf/89d3962efd85426f85256b870069c0aa/f0e11c47fc62bc2e85256c1d00394ef9?OpenDocument]
    Not sure if this applies to your version though.

  • How to generate a mail into the SAP Inbox

    Hi everyone,
    I have an MM Workflow that is starting correctly and a mail is supposed to be generated in the user Inbox in SAP after the completion of a material enhancement but it does not. The Workflow was copied from another system and it was working fine.
    I tried to see any event (step) that is sending a mail in the Workflow and I found only 1 but it seem correctly configured from what I can see. I am not even sure this is the right event that I am looking at.
    Does anyone have an idea of what I should look for and how I could manage to see why no mail is generated?
    I am still a beginner in Workflow so try to give me as much detail as possible.
    Thank you in advance for your answers.
    Best regards,
    Sylvain

    Hi Sylvain,
    The issue could be at many places.
    Check the workflow step that needs to send the mail to the desired user.
    Check if the agent who needs to recieve the mail is pesent in the current system. If the user is not hard-coded, check how the user is getting fetched in the step. If it is through rules, etc you need to debug the same.
    Also check the authorizations of the user in SU01. Check the agent assignment for the task as well.
    You can find much information in the workflow  log to start with the debugging.
    Hope this helps!
    Regards,
    Saumya

  • Virus in Auto generated mail sent by SAP

    Hi ,
    One of our user has received virus in sales order confirmation mail. Mail was sent directly from SAP to User.
    We are working on hardware part to check the virus but do we have anything to block virus at SAP level or in SOST , SCOT anywhere in messaging loop can we find any virus information.
    Please suggest.
    Shivam

    I would first check if the user who send that mail was indeed the SAP system - or if it was another using faking the identity to be allegedly from the SAP system.
    Markus

  • Issue in sending mail to SAP Inbox from Workflow

    Hi All,
    I need to send the mail to the creator of the document about the user decision. If i am executing the workflow through the event ( ouput type) , the workflow processing in SWIA is complete but the mail is not sent in the SAP Inbox. But If i try to manually execute the workflow, mail is sent to the SAP Inbox.
    I've used WF_INITIAITOR in the Expression. I need to send the mail not to the approver but to the creator of the workflow.
    Thanks,
    Neha

    Hi,
    the event is also triggered from my Id but in that case I do not recieve any e-mail. None of the users recieve the e-mail in the SAP Inbox for the mail step after the decision.
    In workflow Log the last step shows the details as
    name of the manager and the workflow background for mail sent step as shown below
    Sumit Vij     Background work item created     10.01.2012     12:08:43     
    Sumit Vij     Execution started automatically     10.01.2012     12:08:43     
    Workflow Hintergrund     Work item processing complete     10.01.2012     12:08:44     
    Thanks

  • Not able to send mail to SAP Inbox(SBWP)

    When i create a new message in SBWP and send it to SAP Inbox, It is moving to outbox.  When I resubmit this mail , then it move to  SAP Inbox. Please Help me to solve this problem.

    Hi,
    When i create a new message in SBWP and send it to SAP Inbox, It is moving to outbox.
    When ever you send a new message (mail) from the SAP Inbox, Outbox will have a copy, Like sent items in the Outlook.
    When I resubmit this mail , then it move to SAP Inbox. Please Help me to solve this problem. code}
    When creating a new message, If you give the correct User Id in the recipient  it will go correctly. Click Refresh  in the SAP Inbox and check it.
    Regards,
    Surjith

  • Outgoing mail from SAP Inbox

    Hi,
    I have a problem of the mail sending from SAP inbox to external email id. The text which Iam entering in the mail is converted into pdf format and being sent as an attachment. we are using the version 46C. Please let me know on this.
    Thanks!
    Sreenivas

    what is the issue ?
    u dont want PDF ? then chek ur settings in SCOT.
    in SCOT -->double click on STMP nore >internet>here u will get converion format settings
    Regards
    Prabhu

  • Reply from the notifiaction mail (from outlook) to sap Inbox

    HI
    I have a requirement where in I am sending a notification mail to user saying Document verification is OPEN(pending) in your name.1s he finshes that task he will reply to the same mail saying ClLOSED.
    Now can we get this mail reply to SAP Inbox of the reply receiver ?
    And If yes How can we process that either by subject or body content to close that activity.
    (We dont want to send workitem shortcut to the user,This will make us not to involve user into SAP S\W)

    Hi- you could refer below thread
    http://forums.sdn.sap.com/thread.jspa?threadID=2132333
    vinoth

  • SAP Inbox to My Mail Account

    Hi
    I need to send the mail from the SAP Inbox (i.e. from Tcode SO01) to my personal mail account.
    In Tcode SO01, I am creating a new message and under recipient I am providing my mail ID (for eg [email protected]), and I am selecting Recp. Type as Internet Mail.
    I am checking the status in SOST, It is showing error messge 806 and 817.
    So How to proceed future and is there any thing else to configure in my system.
    If so, Please send me the relavant document which explains the step to step solution.
    U can reach me at [email protected] or [email protected]
    Thanks and Regards
    Vijay Kumar Varma

    Hi Amit
    As you told that some configuration should be wrong in SCOT. In my company, I need to take care of  basis job also. So can u please help me out what should be configured in SCOT.
    If any suitable document from yourside will be a great help for me.
    Thanks and Regards
    Vijay Kumar Varma

Maybe you are looking for

  • I can't seem to copy or cut and paste with firefox anymore

    I can highlight but I can't cut or paste words or phrases on firefox anymore. I can on explorer but not firefox == This happened == Every time Firefox opened == its been a while not sure what setting got changed

  • Exception Condition "Fatal_Error" Raised in SMQ2

    Hi, I am doing File to Proxy(ECC) Asynchronous scenario. in this getting the error in Target side(ECC) in SMQ2 message is showing error , when I double click on this error getting the error message like  Exception Condition "Fatal_Error" Raised. Beca

  • Error message when trying to delete Dropbox

    Per the instructions, I am trying to remove Dropbox.app by dragging it into the trash. I get this error message: Any advice? How do I find out which plugins are associated with Dropbox so I can kill them and remove the app?

  • Can i ask to pick up a product in a apple store on a specific date?

    I have a friend who is going to travel to New Orleans in November. Can i buy a IPhone and set the date for him to pick it up?

  • TPAM - 10g sso

    anyone have any clue where the files mentioned in the 10g single signon "third party authentication module" are? http://download-east.oracle.com/docs/cd/B10464_01/manage.904/b10851/tpsso.htm#1009577 i can't find the java files mentioned to change the