In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to prevent the specified type of SAP CRM attachments from being uploaded to the server, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.
Requirement: end users are not allowed to upload attachments whose size is greater than the given limit (for example, 400KB).
Solution:
(1) through SPRO- > customer relationship Management-> basic functions-> content Management-> Business add-ins->
Confirmation of changing the file
(2) copy the following source code to BAdI implementation. For code details, see the comments on each line.
METHOD if_ex_crm_documents~carry_out_action. CONSTANTS: cv_max_size TYPE int4 VALUE 409600. "400KB DATA: lt_loios TYPE skwf_ios, ls_error TYPE skwf_error, lv_size TYPE sdok_fsize, lt_badios TYPE skwf_ioerrs. READ TABLE changed_documents ASSIGNING FIELD-SYMBOL () INDEX 1. CHECK sy-subrc = 0." The badi implementation will be called whenever there is change on attachment (create, update and delete), since it is necessary to filter out the change "mode CHECK-action = 'CREATE_DOCUMENT'." DATA (ls_bo) = VALUE sibflporb (instid =-instidbor typeid =-typeidbor catid =-catidbor). DATA (ls_loios) = VALUE skwf_io (objtype =-objtype class =-class objid =-objid). APPEND ls_loios TO lt_loios. CALL METHOD cl_crm_documents= > get_file_info EXPORTING loio = ls_loios IMPORTING file_size = lv_size. CHECK lv_size > = cv_max_size. " Since this BAdI implementation could only be called after the attachment is created, so technically speaking we could not prevent the attachment creation indeed, but could only delete the attachment after its creation CALL METHOD cl_crm_documents= > delete EXPORTING business_object = ls_bo ios = lt_loios IMPORTING bad_ios = lt_badios error = ls_error. COMMIT WORK AND WAIT. "raise an error message to prompt user to upload the attachment with smaller size lo_service- > add_message (EXPORTING iv_msg_type ='E 'iv_msg_id =' ZCM_JERRY_TEST' iv_msg_number = '000'). ENDMETHOD.
Activate the BAdI implementation:
Now, if the uploaded attachment exceeds 400KB, the end user will see an error message in UI.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.