Hello Experts,
When customer sends e-mail including attachments to sap crm system, it creates activity and through my code I add that attachments into activity. Everything works fine but when customer sends csv type attachments, system cannot find mime type for it and its content. As a result, my code adds csv format document without its content. Clients cannot open csv attachments.System creates mail with ZL_CRM_ERMS_AH_CREATE_IR(CL_CRM_ERMS_AH_CREATE_IR) class and IF_CRM_ERMS_SERVICE~EXECUTE method in it.
lr_sc_mail_data = cl_crm_email_utility=>get_mail_data_from_so( iv_send_request_id = lv_bcs_key ) -> get_mail_data_from_send_req->.GET_MAIL_DATA_FROM_SEND_REQ
code return mail content and attachments content. Without csv type everything it is fine. But system when ı debug here GET_MAIL_DATA_FROM_SEND_REQ method ->
in code
CALL FUNCTION 'SKWF_MIMETYPE_OF_FILE_GET'
EXPORTING
FILENAME = LV_FILE
IMPORTING
MIMETYPE = LV_MIME_TYPE.
csv format is not found.
I try to add table to csv but now
-> get attachment's content from KPRO
CALL FUNCTION 'SO_KPRO_DATA_FROM_OBJCONT_GET'
IMPORTING
LOIO_OBJECT = LS_LOIO_KPRO
TABLES
OBJCONT = LT_OBJCONT
CONTEXT = LT_CONTEXT
EXCEPTIONS
MISSING_KPRO_DATA = 1
OTHERS = 2.
CALL FUNCTION 'SO_LOIO_PHIO_GET'
EXPORTING
LOIO_OBJECT = LS_LOIO_KPRO
IMPORTING
PHIO_OBJECT = LS_PHIO_KPRO
TABLES
CONTEXT = LT_CONTEXT
EXCEPTIONS
KPRO_INCONSISTENCY = 1
X_ERROR = 2
OTHERS = 3.
* --> Get content
CALL FUNCTION 'SDOK_PHIO_LOAD_CONTENT'
EXPORTING
OBJECT_ID = LS_PHIO_KPRO
TEXT_AS_STREAM = 'X'
TABLES
FILE_CONTENT_BINARY = LT_CONTENT_BINARY
EXCEPTIONS
NOT_EXISTING = 1
NOT_AUTHORIZED = 2
NO_CONTENT = 3
BAD_STORAGE_TYPE = 4
OTHERS = 5.
LS_LOIO_KPRO is initial for csv mime type so ı couldnt get csv format content.
so.
Does KPro support csv ? Should ı open note for it ?
Can ı find this csv attachments content somewhere ?
when activity created via class. we can find its relation SOFM in doc_flow. Can ı use cl_crm_documents=>GET_INFO with this ?
Any suggestion for this situation. Will point given.
Thank You.