Me -> /iwbep/if_sb_dpc_comm_services ~ rfc_save_log ( Ls_messages – message_v4 = ls_error – v4. Ls_messages – message_v3 = ls_error – v3. Ls_messages – message_v2 = ls_error – v2. Ls_messages – message_v1 = ls_error – v1. Ls_file_attach – file_loio_guid = ls_loio – objid. ****Upload the Attachment for Territory Plan in CRM WEBUI****ĬALL METHOD cl_crm_documents => create_with_tableįile_content_binary = lt_file_content_binary Ls_file_access – mimetype = ls_file_attach – mime_type. Ls_file_access – file_name = ls_file_attach – filename. Ls_file_access – file_size = lv_file_size. ****Convert the Attachment File Data from XSTRING to BINARY**** Ls_properties – value = ls_file_attach – mime_type. Ls_properties – value = ls_file_attach – description. Ls_properties – value = ls_file_attach – name. Ls_properties – name = ‘KW_RELATIVE_URL’. ****Convert the Territory Plan ID into GUID****ĬALL FUNCTION ‘CONVERSION_EXIT_CGPLP_INPUT’ Ls_file_attach – file_value = is_media_resource – value.
Ls_file_attach – mime_type = is_media_resource – mime_type. SPLIT iv_slug AT ‘/’ INTO ls_file_attach – tp_id ***IV_SLUG parameter will be passed from the front-end side Lt_file_access, ls_file_access, lt_file_content_binary, ls_loio , Lr_dmtp_service TYPE REF TO zcl_dmtp_service ,ĬLEAR : ls_file_attach, lv_tp_guid, ls_bo, lt_properties, ls_properties , Lo_dp_facade TYPE REF TO /iwbep/if_mgw_dp_facade , Lt_messages TYPE zif_zdmtp_service => bapiret2_t , Lt_file_content_binary TYPE sdokcntbins , Lo_tech_read_request_context TYPE REF TO /iwbep/cl_sb_gen_read_aftr_crt , ĭATA : ls_file_attach TYPE ztp_s_file_attachment , METHOD /iwbep/if_mgw_appl_srv_runtime ~ create_stream. Then Redefine the CREATE_STREAM Method (/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_STREAM) in the *DPC_EXT class and implement the below logic to upload the file attachment into the CRM WebUI for a given Territory Plan.Īll input parameters/values we have to get into the SLUG parameter from the UI Side (If we have multiple input parameter values then with concatenation of multiple parameter values with delimiter we have to get the values in SLUG parameter). Lo_property = lo_entity -> get_property ( iv_property_name = ‘MIME_TYPE’ ). Lo_entity = model -> get_entity_type ( iv_entity_name = ‘TerritoryFileAttachment’ ). Lo_property TYPE REF TO /iwbep/if_mgw_odata_property. Then Redefine the DEFINE method in the *MPC_EXT class and add the below logic:ĭATA : lo_entity TYPE REF TO /iwbep/if_mgw_odata_entity_typ ,
In the Entity Type Properties select the check box: MediaĪnd then map the RFC function module for the Create Operation in the Entity Set.Īnd do the mapping for Get Entity (Read) Operation in the Entity Set.
Dhc rest client download code#
Step-by-Step to upload the file attachment in CRM WebUI using Net Weaver Gateway.Ĭreate the project in SEGW Transaction Code and the Entity Type: