Skip to Content
avatar image
Former Member

VERY VERY URGENT Attachment for Opportunity

I want to attach a file using a RFC/BAPI to an opportunity in CRM backend. The file will come in binary format/stream from a .NET iview.

Currently we are trying out the BAPI CRM_ICSS_UPLOAD_SR_ATTACHMENT. The file data that we given in binary format seems to go into CRM tables but when we see the opportunity through the front end transaction we dont see the file in the Attachments tab.

Please help as we want the solution urgently. Once this BAPI works we plan to make a WSDL out of it to be called from the .NET iview.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • May 03, 2006 at 06:58 AM

    Hi,

    try methods CREATE_WITH* of class CL_CRM_DOCUMENTS.

    Fill parameter BUSINESS_OBJECT with:

    INSTID = <GUID of opportunity>

    TYPEID = BUS2000111

    CATID = BO

    Pass the binary content to the corresponding parameters.

    Regards

    Wolfgang

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Sanjay,

      have a look at my Weblog:

      <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>

      there you find the complete code needed. Have you tried the search in SDN? You would have found the solution by searching for "Attachment Opportunity" or use Google with "Attachment Opportunity sap crm".

      Regards

      Gregor

  • May 04, 2006 at 12:27 PM

    Well maybe this is a good opportunity to work with abap.. This is a forum no your programmer team.

    Regards.

    Manuel.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 04, 2006 at 01:14 PM

    Hello sanjay,

    As already pointed out you would need to use the method

    CREATE_WITH_TABLE of the class CL_CRM_DOCUMENTS.

    Below is the code sample that should help you achieve this(lt_file_content conatins the file content in binary).

    ls_bo-instid = iv_parent_guid."header guid of oppt

    ls_bo-typeid = 'BUS2000120'.

    ls_bo-catid = 'BO'.

    ls_file_info-file_size = lv_length.

    ls_file_info-file_name = lv_name.

    ls_file_info-mimetype = lv_content_type.

    ls_file_info-binary_flg = 'X'.

    APPEND ls_file_info TO lt_file_info.

    CALL METHOD cl_crm_documents=>create_with_table

    EXPORTING

    business_object = ls_bo

    file_access_info = lt_file_info

    file_content_binary = lt_file_content

    raw_mode = 'X'

    parent_folder = ls_doc_info-loio

    IMPORTING

    error = ls_error.

    I hope this helps you.

    Best Regards,

    Tanmaya

    Add comment
    10|10000 characters needed characters exceeded