The main purpose of this document is to hide the attachments based on the business role user logged in .
Hide the attachments in the opportunity based the Business Role.
1.Open the WebUi. Select the business role
2. Open any one opportunity.
3. Next upload a document of any type (text/pdf/doc) in the attachments assignment block.
4. Open SE18 T-Code and create an implementation for the badi “CRM_DOC_AUTHORITY” and write the below code in the method “authority_check”.
5. Next open the webui again in new session. And select the same business role.
6. Open the same opportunity and navigate to attachments assignment block.
( Here user can view the attachment as the user logged into SALESPRO business role.)
7. Next open the webui in new session and select any other business role.
(Here I am selecting a zsalespro business role which is created for my project).
8. Open the same opportunity and navigate to attachments assignment block.
Like this we can hide the attachments based on the business role user logged into.
Furthermore we can use the function module “CRM_KW_PROPERTIES_GET” to read the properties of the attached document and we can manipulate the visibility of the documents based on those properties.