Read Attachment from SAP inbox and Transfer to Application Server Folder

Hi
  I have one requirement . I have to developed one background program to read the all the attachment in SAP inbox and transfer all this attachment to sap application server folder.
Thanks and Regards
Shyam

Hi Rajendra ,
please try this code snippet , here we call a selection screen that allows us to browse the file name .
PARAMETER : p_file TYPE localfile OBLIGATORY .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file .
  data: user_action type i, filename type filetable, result type i,
        fn type file_table.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
  EXPORTING
    WINDOW_TITLE            = 'SELECT FILE'
   DEFAULT_EXTENSION       =
   DEFAULT_FILENAME        =
   FILE_FILTER             =
   INITIAL_DIRECTORY       =
   MULTISELECTION          =
  CHANGING
    FILE_TABLE              = filename
    RC                      = result
    USER_ACTION             = user_action
  EXCEPTIONS
    FILE_OPEN_DIALOG_FAILED = 1
    CNTL_ERROR              = 2
    ERROR_NO_GUI            = 3
    NOT_SUPPORTED_BY_GUI    = 4
    others                  = 5
  if user_action = cl_gui_frontend_services=>action_ok.
    clear p_file.
    loop at filename into fn.
      p_file = fn-filename.
    endloop.
  endif.
Hopefully it helps

Similar Messages

  • READ PDF ATTACHMENT FROM SAP INBOX

    Hi all,
    can any one tell me the FM's used to read the pdf attachment from the sap inbox.
    Thanks& Regards,
    Arun.

    Hi Arun
    See this [PDF|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2c678dc3-0401-0010-3c80-8ef48f450491] of SCN
    Regards
    S@chin

  • How to read a mail from sap inbox thru abap code?

    how to read a mail from sap INBOX thru abap code? can anyone tell me the technical approach? I NEED TO READ A MAIL and then need to pass the parameters to a bapi.
    Message was edited by:
            shahid mohammed syed

    Hi SSM,
    Did you manage to have your program working? I also have same requirement. I tried standard FM and BAPI but I always encounter authorization error when I tried accessing other user's mail. Thanks.
    Regards,
    Ryan

  • I want read PDF file from SAP directory and create a spool request or print

    Hi all,
    I want read PDF file from SAP directory and create a spool request or print the pdf through SAP. Can any body  help me in this.
    Also please write to me if its possible to open PDF from SAP directory to adobe pdf reader.
    Thanks in advance,
    Sunny

    Hi Sunny,
    Check these links.
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    http://www.erpgenie.com/sap/abap/pdf_creation.htm
    http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
    http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Simple code to send ALV display as XLS attachment  to SAP inbox

    Hi All,
    Simple code to send ALV display as XLS attachment  to SAP inbox.
    Also i need to send only 200 records per attachement. So in this case i need send multiple attachment per mail
    Thanks,
    Lokesh

    The following code is used to send the internal table which u pass fo  the ALV display to be send as excel sheet attachment
    Internal table is it_attach[]
    ld_email               = po_email.
      ld_mtitle              = 'Email From Z377_EMAIL_XLS'.
      ld_format              = 'XLS'.
      ld_attdescription      = 'filename'.
      ld_attfilename         = 'Allot'.
      ld_sender_address      = ' '.
      ld_sender_address_type = ' '.
    * Fill the document data.
      w_doc_data-doc_size = 1.
    * Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
      ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    * Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE li_content LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    * Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    * Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
      EXPORTING
      document_data              = w_doc_data
      put_in_outbox              = 'X'
      sender_address             = ld_sender_address
      sender_address_type        = ld_sender_address_type
      commit_work                = 'X'
    *IMPORTING
    *sent_to_all                = w_sent_all
      TABLES
      packing_list               = t_packing_list
      contents_bin               = t_attachment
      contents_txt               = li_content
      receivers                  = t_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.

  • Sending mail from sap Inbox to outlook

    Hi All,
    Iam new to SAP workflow. Here I need to send the mail from SAP Inbox to Outlook for high priority keeping red flag as icon.
    can anyone tell me how to set up this and go ahead to start.
    Thanks
    Kumar

    IF I understand you correctly, you want to send a mail to Outlook (external email address) as a step in Workflow.
    If you are on Release 6.20 or above the following solution will work. I do not remember what is available in earlier releases.
    1) Define a multiline element based on SOXNA-FULLNAME to hold the email addresses. How you populate this element with the addresses depends on your requirements.
    2) Insert a Send Mail step in the workflow.
    3) In the Mail Tab, Select 'U' as Recipient Type.
    Assign the Multi Line element defined in Step 1 to E-Mail Address.
    4) Define the Subject and the body as needed.
    Please note that you should have External mail sending from SAP enabled and a batch job that runs periodically to push the mail.
    Cheers,
    Ramki Maley.

  • 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

  • Help Required -- Can we use SQL Query to READ data from SAP MDM Tables

    Hi All,
    Please help.........
    Can we use SQL Query to READ(No Creation/Updation/Deletion  just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
    Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
    Thanks in Advance
    Regards

    All the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
    Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
    But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
    BR,
    Alok

  • On my ipad mini, when I delete an email from the inbox (and it goes into Trash), it immediately deletes that email from the server (ATT/Yahoo).  I've called support for both ATT and Apple and can't find a way to have the emails remain on the server.

    On my iPad Mini, when I delete an email from the inbox (and it goes into Trash), it immediately deletes that email from the server (ATT/Yahoo).  I've called support for both ATT and Apple and can't find a way to have the emails remain on the server. 
    My husband and I share an email address and if he misses a day checking email on his notebook, he doesn't receive the items that I have sent to Trash on my iPad Mini.
    Appreciate suggestions.
    [The curious thing is, if I "move" the deleted emails from Trash on my iPad Mini into the Inbox, I can go to my notebook, open my online email and they are back in my ATT/Yahoo Inbox.]

    Is your Yahoo account set up as POP3 or IMAP?

  • My MacBook Pro hard drive crashed a little while ago and has been replaced.  Is it possible to take tunes from iPod Classic and transfer all of them back to iTunes on computer?

    My MacBook Pro hard drive crashed a little while ago and has been replaced.  Is it possible to take tunes from iPod Classic and transfer all of them back to iTunes on computer?  Is this just for purchased tunes or can I do it for ones that have been burned from CD's as well?  Thanks for any help!

    [Zevoneer's detailed instructions on getting music off an iPod|http://discussions.apple.com/message.jspa?messageID=9053179]
    [Wired's How To: Get Your Music Off of Your iPod|http://howto.wired.com/wiki/Get_Your_Music_Off_of_Your_iPod]
    [http://www.metaphoriclabs.com/articles/5-ways-to-copy-music-off-your-ipod-window s-mac-os-x/]
    [Topic: Get music off iPhone|http://discussions.apple.com/message.jspa?messageID=11512841]
    [Copying iTunes Store purchases from your iPod or iPhone to a computer|http://docs.info.apple.com/article.html?artnum=305465]

  • I cannot delete mail from my inbox and get a message saying (msg) could not be moved to the mailbox trash-POP account".

    I suddenly cannot delete mail from my inbox and get a message saying " (msg) could not be moved to the mailbox trash-POP account".  It does not matter if I am trying to delete a single message or mulitiple messages.  Can anyone help?

    If you're running Leopard, as your profile says, then you need to post your question in that forum, not the Snow Leopard forums. So if you're really running Snow Leopard, you need to update your profile to show that, as well as give more details about what kind of mail accounts you have, and who your email provider is.

  • How do i take the music from my ipod and transfer it permanently onto my PC's itunes?

    How do i take the music from my ipod and transfer it permanently onto my PC's itunes?

    If you were using a Mac you could use a program but AFAIK there is nothing similar yet for the PC.
    However, you should have a backup of your music, correct? Just restore from that backup to your computer (and, if not, at least this will teach you the importance of always backing up your music purchases onto writable media like DVD).

  • Is it possible to read Idocs from SAP R/3 System?

    Is it possible to read Idocs from SAP R/3 System? Instead of the aRFC

    Unless Hydra emulates ECC sending IDOCS, then you just might want to use the WSMessageListener (http://help.sap.com/saphelp_xmii120/helpdata/en/45/6a86ac88130dece10000000a11466f/frameset.htm) and configure your message processing rules accordingly.

  • Messages from the Inbox and Sent folders are being transfered to the Outbox

    Why are the messages from my Inbox and Sent folders being transfered to my Outbox?

    There is probably something wrong with the Envelope Index file. In the few cases I've seen something similar, however, there was also something wrong with the structure of the Mail folder, and we must fix that before trying to re-create the index.
    In the Finder, go to ~/Library/Mail/. With that folder open, do Edit > Select All (⌘A), then Edit > Copy (⌘C), and paste it in your reply to this post, to let me see the names of the files and folders present at the root level of the Mail folder.
    Before actually posting that information, you may edit it so that the file/folder names do not reveal any details you wish to keep private, e.g. you may replace any real username with "username" if you wish; similarly, you may disguise any domain names you don't want to be revealed. Try to be consistent in how you disguise those details, though, as we may need to refer to them in subsequent posts.
    Now, go to ~/Library/Mail/Mailboxes/. With that folder open, repeat the process to let me see the names of the files and folders it contains. Again, you may disguise any mailbox names you wish to keep private.
    Finally, locate the account folders within ~/Library/Mail/ -- their name begins with the account type (POP, IMAP, .Mac), followed by the account username and the incoming mail server. For each account folder, repeat the process to let me see the names of the files and folders it contains.
    Note: For those not familiarized with the ~/ notation, it refers to the user's ~ folder. You can easily locate any of the folders referred to in this post by copying the file path here, doing Go > Go to Folder in the Finder, and pasting the file path there.

  • Logical deletion of workitem from SAP INBOX

    Hello ,
    When we are trying to delete some work items related to generic
    decision task from SAP INBOX ,logically delte button is not visible and
    we searched in menu it is in display mode.
    The same button  is visble for other workitems related to error idocs .
    We have assigned the role to delete the work items of  type all.
    The button is visible for some type of tasks .
    We have some 30 to 40 workitems (decision task)  which are to be deleted .
    Can we use reports RSWWWIDE and RSWWHIDE without archiving of those?
    Kindly suggest us.
    Best Regards,
    Veena.

    Hi Veena,
    Please have a look at the 'Data Management guide' from service.sap.com/data-archiving, which tells you abou various options for deleting/archiving WI
    Also have a look at Note 49545.
    Hope this helps,
    Naveen

Maybe you are looking for

  • How to Track the changes made to the custom table field value

    I want to track the changes made to the custom table field value in table maintenance generator.please help me it is very urgent Thanks & Regards, Kranti

  • My iPod Video is not recognized by my computer

    I've tried every little thing posted and every article about this subject. *I would like to know if there is a way to restore the iPod to its original configuration and software without being recognized by any computer.* I've tried about 10 different

  • Need Windvd 5 for my Qosmio F10

    Hello, I have a Qosmio F10..a Japanese one...I live in Turkey and formatted my f10 ..Now it is English but I do not have programs such as Windvd and dvr ...and I cannot watch TV in windows XP...please someone help me ..I need windvr 5 for Toshiba (En

  • Weblogic 10gR3 standard edition and enterprise edition

    Difference between weblogic 10gR3 standard edition and enterprise edition ??

  • Taxes to be maintained in Sale order

    HI Experts, The terms from the customer side is, invoiced should be rised for 1) 20% of the value with no tax. 2) 50% of the Value with VAT of 4%. 3) 30% of the Value with VAT of 12.5%. for indiviual line items. The above taxes are appicable to each