使用ABAP程式碼給SAP CRM Business object建立附件Attachment
For a complete list of all my blogs regarding content management, please see here.
I create a utility class with method CREATE_DOC. It has following four input parameters:
- iv_data type xstring – the binary data which you would like to store as attachment
- iv_bor_type type string – the BOR type of your business object. You can view view business object model in tcode SWO1
- iv_guid type raw16 – the guid of your business object instance
- iv_file_name type string – the file name which will appear in attachment assignment block.
The source code of method below: ( in fact all attributes for an attachment could be available in the input parameters of this method. For simplicity reason I
just hard code them in the sample code )
I write a piece of code to test it. After report runs I could see the generated attachment.
You can also test whether the attachment is created successfully in the backend. Test class method get_info in SE24.
Specify importing parameter BUSINESS_OBJECT:
Execute and you should get result as below: one physical object and one logical object according to how-is-attachment-physically-stored-in-database-table-in-cm-framework.
Never forget to call COMMIT WORK in your code, since the persistence of the relationship between attachment and your business object are implemented via generic object service in a update process.You could easily find this via SAT trace on your code
or switch on update debugging in your debugger settings.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2702903/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用程式碼修改SAP CRM附件的屬性
- 如何使用ABAP程式碼建立SAP Product CategoryGo
- SAP Fiori 的附件處理(Attachment handling)
- 使用ABAP程式碼提交SAP CRM Survey調查問卷
- SAP 中的 BOPF(Business Object Processing Framework)ObjectFramework
- 使用 ABAP 程式碼刪除指定 SAP CRM 系統裡 Opportunity 訂單的文字Unity
- 使用ABAP程式碼返回S/4HANA Material上維護的Attachment明細
- 如何查詢Authorization object在哪些ABAP程式碼裡使用到Object
- 如何使用程式碼建立和讀取 SAP CRM 訂單的 Text 資料
- SAP CRM user引數CRM_UI_PROFILE是在哪行ABAP程式碼裡讀取的UI
- 如何使用 ABAP 程式碼傳送帶有 PDF 附件的電子郵件
- SAP MM 給合同的ITEM上傳附件以及附件查詢
- [外掛擴充套件]附件Attachment外掛套件
- SAP CRM 裡 Attachment 搜尋的實現邏輯介紹
- SAP CRM附件模型的Authorization scope原理介紹模型
- 如何使用 ABAP 程式消費 SAP ABAP OData 服務
- SAP工作流介紹之ABAP Business Workflow介紹
- 給某個 SAP S/4HANA 使用者分配 Business Role
- 動態控制SAP CRM附件的可編輯性
- 使用ABAP建立QR Code(二維碼)
- 使用ABAP程式碼建立S/4HANA裡的Sales Order
- 使用 Prometheus 監控 SAP ABAP 應用程式Prometheus
- 使用 SAP Business Application Studio 建立 Fiori Elements 應用顯示 OData 資料APP
- SAP Hybris和ABAP Netweaver裡的DAO(Data access object)Object
- 動態隱藏某些特殊型別的SAP CRM附件型別
- 如何啟用SAP CRM附件UI上的advanced按鈕UI
- 如何讓你的SAP CRM應用支援附件上傳
- 關於用 ABAP 程式碼手動觸發 SAP CRM organization Model 自動決定的研究
- 如何透過 ABAP 程式碼給 SAP OData 後設資料增添註解試讀版
- 如何在 SAP BTP 上建立以及消費 Business Rule Service
- An introduction to SAP Business Workflow
- 在SAP CRM WebClient UI中用javascript觸發ABAP eventWebclientUIJavaScript
- 使用SAP WebIDE進行SAP Cloud Platform Business Application開發WebIDECloudPlatformAPP
- 使用 SAP CRM Application Enhancement Tool(AET) 建立擴充套件欄位APP套件
- 如何使用程式碼的方式刪除 SAP CRM 訂單 Text 資料
- 如何使用程式碼修改SAP CRM One Order CUMULAT_H物件的值物件
- 兩種使用程式碼獲得SAP CRM product sales status的辦法
- 使用Java程式碼在SAP Marketing Cloud上建立Contact資料JavaCloud