Skip to main content

SAP CRM: How order attachments are stored

Submitted by Stefan Barsuhn on

First off, attachments are completely independent from the rest of the transaction. As soon as you add the attachment, it's saved on the DB - no need to save the transaction.

If you're looking for standard source code how to add attachments to an object, set a breakpoint in CL_CRM_DOCUMENTS=>CREATE_WITH_TABLE and upload an attachment. (CL_CRM_BSP_CM_CONTROL=>CREATE_DOCUMENT contains some useful methods to fill the parameters.)

Once the attachment is saved, you can find it in the following tables:

  • SKWG_BREL is the contains the link between ORDER/ITEM GUID (INSTID_A) and attachment GUID (INSTID_B)
  • Transaction DMWB contains the table that holds the attachment data, for CRM Orders find it here (click on the table icon).
    image 9 
    image 10
  • In the so-found table CRMORDERLOIO, enter the GUID in field LOIO_ID and you can find the header data of the attachment.

More details can be found in this blog post on SCN: https://blogs.sap.com/2013/11/28/how-is-attachment-physically-stored-in-database-table-in-cm-framework/

Tags