on 05-03-2006 7:37 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi varma,
Even my requirement is same, thanks for the steps you have mentioned.
I called the method cl_crm_document->create_with_table.
I have handled all the parameters mentioned by you except PARENT_FOLDER.
for MIME_TYPE am passing, the value 'application/winword',
i pass the binary content to file_content_binary.
When i check the opportunity, its getting attached, but the data is in binary format.
Do i need to handle any other parameters or parent_folder parameter has to be handled?
Please do suggest.
Thanks & Regards,
Karthik.
Well maybe this is a good opportunity to work with abap.. This is a forum no your programmer team.
Regards.
Manuel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply. But can you give me an example as I am new to CRM coding and classes. I saw the parameters of the create_with_file method and following are the parameters. Can you indicate which parameters I need to use specifically as I dont find a parameter to pass the binary content.
I have removed the optinal parameters assuming that they wont be required.
FILE_NAME
DIRECTORY
BUSINESS_OBJECT
LOIO
PHIO
ERROR
Which is the parameter for passing binary content
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
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.