on 01-17-2015 10:07 AM
HI ,
I followed the following blog and now I am able to get the attachement in the system in binary format , the next part is that how I can upload or attach it with a CRM order? this is the blog i followed.
Hi Safeer,
Document can be attach to CRM order using class cl_crm_documents=>create_with_table . below is the code you can use:
DATA:
ls_business_object TYPE sibflporb,
ls_sdok_property TYPE sdokpropty,
lt_properties TYPE sdokproptys,
ls_file_info TYPE sdokfilaci,
lt_file_info TYPE sdokfilacis,
lt_content_bin TYPE sdokcntbins.
* Preparing attachment data .
* Business object = Knowledge Article
ls_business_object-instid = GUID of CRM order"lv_header_guid.
ls_business_object-typeid = Business Object of CRM Order"'BUS2000111'.
ls_business_object-catid = 'BO'.
ls_sdok_property-name = 'KW_RELATIVE_URL'.
* This is the name displayed as description
ls_sdok_property-value = File name "ls_file_access_info1-file_name."ls_attachment-filename.
INSERT ls_sdok_property INTO TABLE lt_properties.
* file info
ls_file_info-file_size = ls_file_access_info1-file_size. " Size of file
ls_file_info-file_name = ls_file_access_info1-file_name."File name
ls_file_info-mimetype = 'application/pdf' " For PDF File .
ls_file_info-binary_flg = 'X'.
APPEND ls_file_info TO lt_file_info.
* create binary file in CM as attachment from knowledge_article to activity_email
CALL METHOD cl_crm_documents=>create_with_table
EXPORTING
business_object = ls_business_object
properties = lt_properties
file_access_info = lt_file_info
file_content_binary = lt_content_bin " Binary content.
Regards,
Wasim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Wasim, another question , do you have some sample code if i want to send from CRM to other system
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Safeer,
Never worked with PI but try to check method CREATE_WITH_TABLE from class CL_CRM_DOCUMENTS. It allows you to upload a binary content to a business object (like CRM Order).
See if it helps you a little more.
Kind regards,
Garcia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
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.