Upload Attachments

Hi Gurus,
I have a requirement where client is migrating from People Soft to CRM 7.0. There is a data conversion happening and we need to migrate attachments for Cases.
There is a Content Server which is installed at CRM end which will handle new attachments which can be uploaded from the local workstation.
I want to upload the attachments for the previous data which is migrated into CRM from PeopleSoft during Data Conversion process. Is there any FM or class method which I can use to do that?
Thanks in advance
Vishal

Hi Preethi,
You can use Class CL_CRM_DOCUMENTS for uploading attachments to business objects in CRM.
If you are uploading file from Presentation server, call method CREATE_WITH_FILE and if you are uplading attachment from Application Server, use method CREATE_WITH_TABLE.
The following code is an example of how to upload attachment from Presentation Server.
CONSTANTS: c_activity TYPE crmt_subobject_category_db VALUE 'BUS2000123'.
DATA: ls_bor_object  TYPE sibflporb.
DATA: ls_object_id TYPE swotobjid.
DATA: es_error TYPE  skwf_error .
DATA: lt_properties TYPE sdokproptys.
DATA: ls_properties TYPE sdokpropty.
DATA: path TYPE string.
DATA: targetpath TYPE string.
DATA: path1 TYPE sdok_chtrd.
DATA: wa_file_table TYPE file_info.
DATA: it_files TYPE STANDARD TABLE OF file_info.
DATA: x TYPE i.
DATA: l_object_id TYPE crmt_object_id_db.
DATA: l_object_id1 TYPE crmt_object_id_db.
DATA: ext TYPE string.
DATA: l_object_guid TYPE crmt_object_guid.
DATA: lv_filename TYPE sdok_filnm.
DATA: ls_phio TYPE skwf_io.
DATA: rc TYPE i.
data: l_filename TYPE string,
*data: lv_filename(40).
        l_filesize TYPE i,
        l_filecontents TYPE TABLE OF sdokcntbin.
CALL METHOD cl_gui_frontend_services=>directory_list_files
  EXPORTING
    directory                   = path
    filter                      = '*'
    files_only                  = 'X'
   directories_only            =
  CHANGING
    file_table                  = it_files
    count                       = x
  EXCEPTIONS
    cntl_error                  = 1
    directory_list_files_failed = 2
    wrong_parameter             = 3
    error_no_gui                = 4
    not_supported_by_gui        = 5
    OTHERS                      = 6
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
l_object_guid = 'DF2F786D3130ECF1A605002655269F60'.
CHECK x IS NOT INITIAL.
LOOP AT it_files INTO wa_file_table.
  lv_filename = wa_file_table-filename .
  CONCATENATE path lv_filename INTO path1.
  IF sy-subrc = 0.
    ls_object_id-objtype = c_activity.
    ls_object_id-objkey  = l_object_guid.
    CLASS cl_swf_utl_convert_por DEFINITION LOAD.
    ls_bor_object =
           cl_swf_utl_convert_por=>convert_bor_to_ibf( lv_filename ).
    ls_properties-name = 'KW_RELATIVE_URL'.
    ls_properties-value = lv_filename.
    APPEND ls_properties TO lt_properties.
    ls_properties-name = 'DESCRIPTION'.
    ls_properties-value = lv_filename.
    APPEND ls_properties TO lt_properties.
    CALL METHOD cl_crm_documents=>create_with_file
      EXPORTING
        file_name       = lv_filename
        directory       = path1
        properties      = lt_properties
        business_object = ls_bor_object
      IMPORTING
        phio            = ls_phio
        error           = es_error.
  ENDIF.
  CLEAR: wa_file_table,l_object_id,l_object_guid,l_object_id .
endloop.
I hope this helps.
Thanks
Vishal

Similar Messages

  • Question on the upload attachments process in a request form

    hi,
    I have a question on the upload attachments process in a request form. I have 2 pages, one is a request form and the other is an attahment page
    The request form let users fill the mandatory fields (e.g. name, email, address...) And in the form, there is a link (URL without submit) to the attachment page.
    In the attachment page, users can upload the supporting file for their rquest. The file will be uploaded to APEX_APPLICATION_FILES view and then it will be copied it to a customized table (table A) and remove from the view.
    When the users finish uploading files (i.e. the files are stored in table A), users need to press a "Done" button back to the request form to submit the form.
    My question is:
    As the request form is not yet submitted while the attached files are stored in table A, there is no request_id (request from table primary key generated in an Insert trigger after submission) is generated to tag with the files in table A. Is there any standard practice to do this?
    What I am doing now is to generate a hidden value in sequence when user goes to the attachment page. The hidden value is stored in table A togehter with the files when uploading. When user goes back to the request form, the hidden value is passed back as session cache. When the request form is submitted, I make an update statement by using the hidden vaule in the Insert trigger to tag the request_id to the attached files in table A.
    Is my way appropriate?
    Thanks for advice.
    cheers,
    Pong

    Pong,
    Yes, this would work just fine. You may want to consider enabling session state protection so that your process is not succeptable to URL tampering, which would cause a user to change the value of the REQUEST_ID in the URL and potentially associate other attahments with their request.
    Thanks,
    Scott

  • I cannot upload attachments to e-mails. When I click on browse in the attachment pop up nothing happens

    I cannot upload attachments to e-mails. When I click on browse in the attachment pop up nothing happens, I cant even type in a document address in the file location box
    == This happened ==
    Every time Firefox opened
    == I downloaded the latest version of firefox

    Again, where are you seeing the date?
    Select one of the imported photos, type Command + i and check in the iPhoto Info drawer to see what the EXIF capture date is for those photos. 
    If the date is correct then you're looking at the file created or modified date and not the EXIF capture date that's embedded in the image file itself.
    OT

  • Mass upload attachments?

    Hi,
    Is it possible in any way for us to mass upload attachments in an Oracle EBS form?
    The requirement is to have each finished goods item to have a picture attachment, and we have an awful lot of new finished goods created each month, while attaching picture one at a time is really time consuming.
    Thanks,
    Gerry

    Have to have it coded, after you setup the required attachement categories for the item screen/function.
    Api FND_WEBATTCH.ADD_ATTACHMENT for programatically doing this

  • HT1694 How do I upload attachments to email?

    I'm trying to attach a document from PDF lite to an email and can nontrivial work out to upload attachments on hotmail mobile or via mail. Help!

    If you are using PDF Reader Lite app then there are instructions here for how to select a PDF in it and email it via the Mail app : emailing PDFs.

  • New version of yahoo beta mail will not upload attachments with foxfire browser

    I have switched to yahoo email's new beta version. I can not upload attachments while using foxfire browser on my PC but can using windows on my laptop? Yahoo live help could not find solution and felt it was a problem with the browser- foxfire? I just need to find solution to problem. Have any suggestions?

    I misunderstood the "of 25MB" part of the image. Maybe that's Yahoo's maximum allowance.
    The typical next step is to try to rule out a conflicting add-on. A standard diagnostic to bypass interference by extensions (and some custom settings) is to try Firefox's Safe Mode. More info on Safe Mode: [[Troubleshoot Firefox issues using Safe Mode]].
    To start in Safe Mode you can use:
    Help > Restart with Add-ons Disabled
    In the dialog, click "Start in Safe Mode."
    If uploads works correctly, this points to one of your extensions or custom settings as the likely culprit.
    If there's no difference, you could also test for a plugin conflict by disabling those here:
    orange Firefox button (or Tools menu) > Add-ons > Plugins category
    You probably have to reload the page or start a new message to test that change.
    Any difference?

  • Can't upload attachments consistently in gmail using firefox 34

    I'm running into an odd problem that doesn't seem to be addressed anywhere I've searched. I am trying to add attachments to gmail messages using Firefox 34, but I get an error message "Attachment Failed" with options to try again. The interesting this is that if I click "Try again" multiple times, it will eventually load the attachment. Now for some of the facts:
    1. I've made an exception for mail.google.com in my pop-ups
    2. I've cleared my cookies and cache...repeatedly.
    3. I've noticed that my Kaspersky 2014 URL Advisor extension is not compatible with Firefox 34, but I can't see how that is the problem.
    4. I have even tried turning off my proxy to see if it helps - it doesn't
    5. I can upload attachments fine in IE - a browser I detest.
    Any suggestions?

    Does the happen in Safe Mode?
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that temporarily turns off hardware acceleration, resets some settings, and disables add-ons (extensions and themes).
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
    *In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    *In previous Firefox versions, click on the Firefox button at the top left of the Firefox window and click on ''Help'' (or click on ''Help'' in the Menu bar, if you don't have a Firefox button) then click on ''Restart with Add-ons Disabled''.
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".
    :[[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, theme, or hardware acceleration. Please follow the steps in the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • Upload/Attachments Problem

    Hi I was wondering if anyone could help.
    I have been having trouble uploading attachments to my emails and even loading photos on Facebook.
    I keep getting an error that says something like...." did not receive the whole file, therefore the file could not be attached"
    has anyone else had this problem or does anyone know how to fix it.
    Thanks

    Try my Mac Performance Guide.
    If that doesn't help, post back here with the results of all the things you tried to do as part of that guide.

  • Virus Scan of Customer Uploaded Attachments in iStore

    In iStore, the customer has the ability to upload attachments. Does anyone have experience with "virus scanning" customer uploaded attachments ?? Also, is there a configurable way to limit the actual file extensions that a customer can upload (i.e. doc,xls,vsd) ??
    Thanks in Advance

    hsawwan --
    The note indicates that there are no capabilities. Within iStore, the attachment functionality is encapsulated with jsp files. Any method that you know of to scan for viruses or limit the file extensions that can be uploaded ??
    Thanks

  • Uploading attachments to a program

    HI,
    I have a requirement to upload attachments (PDF, Excel) to a program.
    These attachments should be visible on the screen (out put of program) for users to view these files.
    I would appreciate if any one could send me an example for  this.
    Thanks,
    Veduru

    Hi Narendra,
                     Use FM 'Gui_upload'.
    Refer this code :
    FM to view these files path.
    CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SY-REPID
          DYNPRO_NUMBER = SYST-DYNNR
        IMPORTING
          FILE_NAME     = P_FILE.
    V_FILE = P_FILE.
    *&---FM TO UPLAOD DATA FROM FLAT FILE.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
       FILENAME                      = V_FILE
       FILETYPE                      = 'ASC'
      HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
      VIRUS_SCAN_PROFILE            =
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          DATA_TAB                      = I_TAB
    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.
    Reward points if helpful.
    Regards,
    Hemant

  • Gmail not uploading attachments

    Gmail not uploading attachments. When I click on "Attach a file" it opens Finder (Mac) the quickly returns to mail before an attachment can be specified. NOTE: this DOES NOT happen in Safari.
    == This happened ==
    Every time Firefox opened
    == in last month

    Hi and Welcome to the Forums!
    A couple of things to check...
    1) At work, can you see your Sent Items? Is the attachment there (on the forwarded sent item)?
    2) Can you check your GMail via their web interface? Is the attachment there?
    Let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Display and Upload attachments to Opportunities

    Hi,
    We are building an external Application for the CRM in WebDynpro for Java.
    1. We need to attache (upload) documents to opportunities
    2. We need to display attachments of opportunities
    These two actions should be performed using RFCs because this is an external application.
    I will appreciate your advice.
    Thanks,
    Aviad

    Hello Aviad,
    I think my Blog on <a href="/people/gregor.wolf3/blog/2005/10/02/inbound-mail-processing-150-attach-files-to-opportunity">CRM: Inbound mail processing – Attach files to Opportunity</a> could be a good starting point.
    Regards
    Gregor

  • Cannot upload attachments in Gmail using Firefox 5.o

    Gmail locks up when I try and upload an attachment. I have to kill it with the Task Manager. This happened after I upgraded to Firefox 5.0 --there was some blurb about a Gmail problem, but I don't recall it as impacting attachments or I wouldn't have proceeded

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that turns off some settings, disables most add-ons (extensions and themes).
    If Firefox is open, you can restart in Firefox Safe Mode from the Help menu:
    *In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    *In previous Firefox versions, click on the Firefox button at the top left of the Firefox window and click on ''Help'' (or click on ''Help'' in the Menu bar, if you don't have a Firefox button) then click on ''Restart with Add-ons Disabled''.
    If Firefox is not running, you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".<br>
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • Using iFS as a repository for file upload attachments

    We are creating an auction website where auction owners are allowed to post any number of attachments (*.doc, *.pdf, etc...) to describe the product being auctioned.
    What is the best way to go about managing these file attachments? The difficulty lies in storing them uniquely. Should we use iFS or store them as BLOBs?

    Where can i find a sample application does something like this ? i.e a document management system such as the one fisher1 has discussed about where any file(*.xls,*.pdf etc) can be uploaded.Iam trying to design such a system myself but have little material(in the form of examples,books etc) to go on.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Luis:
    If your application is going to store files in the database, then you should certainly use iFS. If you're going to take advantage of jsps and/or servlets, then you will the iFS Java API will be a tremendously valuable asset.<HR></BLOCKQUOTE>
    null

  • APEX Bugs: Editing customer contacts and uploading attachments

    I'm using the pre-packaged application, "customer tracker"
    Application Version 2.2.35
    Build Version 4, Application Express 4.2.3
    I am using it on a MAC
    And am having some issues with the pre-packaged application "customer tracker".  I uploaded a bunch of data. However, now when I try to edit a contact record, I get the following error:
    1 error has occurred unable to extend table application_name.EBA_CUST_History by 8 in tablespace APEX_5956688132079418188.
    It doesn't matter if I'm using Firefox or Safari.
    The only way I can modify customer records is to completely delete them and then manually add each one back in -- which is not very scalable. I was able to edit records previously.  This just started yesterday.
    Is this a known issue?  Any way to fix?
    I end up getting the same type of issue when I try to manually add an attachment  It doesn't matter if I'm adding a word doc or a PDF, same error.  This error started after I manually uploaded a handful of attachments last week. The error reads as follows:
    Unable to extend lob segment application_name.sys_LOB0006066941C00008$$ by 128 in tablespace APEX_5956688132079418188.
    Could someone please assist?
    Thanks!

    Not an APEX issue,  your database tablespace needs cleaning up/expanding...
    Thank you,
    Tony Miller
    LuvMuffin Software

Maybe you are looking for

  • Ability to record video in QT Pro on Win 8.1

    Just bought QT 7 pro for Windows registration key. App states it is registered QT pro for Windows, have downloaded and installed version 7.5.x and app shows registered as QT Pro. I see no create new movie recording options under this QT Pro install o

  • How to design a Structure without Key figures in Row.

    Hi Experts,   Could you please advise me how to design Keyfigure Current year(2013) Keyfigure previous year(2012) attached csv file . Keyfigure Current year(2013) Keyfigure previous year(2012) Calday 01-09-2013 02-09-2013 03-09-2013 04-09-2013 05-09-

  • Bad Install Disk

    I have a 14 inch iBook, and recently figured out that my hard drive is bad. I can get on it, but the s.m.a.r.t. status is "failing". Anyways, I got a new external hard drive and I want to install Panther onto it, but the 1st disk is very scratched up

  • Flash 11 on Mac OSX 10.8.3

    This installation will not work no matter what I try.  Ive tried everything on the list you guys gave.  It says the instalation was successful everytime but it hasnt worked. It's getting pretty frustrating. Can anyone help me? please.

  • Deletion of a Payment method

    Dear comcast I had set up two payments method in my profile. Want to delete on payment method in the online profile.Please guide me for this.