cancel
Showing results for 
Search instead for 
Did you mean: 

How to find CRM attatchment files link table?

former_member660852
Discoverer
0 Kudos

Hi Experts,

I am searching the link table between CRMD_ORDERADM_H and its attached files.

I can find attatchment's OBJID, class (CRM_P_ORD) and table CRMORDERPHIO from attatchment tab (transaction CRMD_ORDER), but there is no information about the connection with CRMD_ORDERADM_H-GUID.

I used FM:CRM_KW_DOCUMENTS, but it only showed information of documents, not linkage.

I found this official website.

https://help.sap.com/saphelp_crm50/helpdata/en/3f/714b19aad38a4397d640f964a6f622/content.htm?no_cach...

It says there is a link table, but I could not find yet.

I really appreciate If you give me some information about this link table.

Thanks.

Makino

Accepted Solutions (1)

Accepted Solutions (1)

michael_piesche
Active Contributor

The general link table for 1Order objects is called CRMD_LINK, it connects CRMD_ORDERADM_H and CRMD_ORDERADM_I with almost all the other CRM Objects (see CRMC_OBJECTS, e.g. ACTIVITY_H, PARTNER, PRICING, etc.).

However, when it comes to attachments, it is a very different approach:

  1. you will have to look into table MDOBLREL and find the customized dbtable for your reltype
  2. once you know the dbtable (e.g. SKWG_BREL), you can cross-check for the entries based on INSTID_A = orderadm_h-guid (or orderadm_i-guid).
  3. with the INSTID_B, you get the class and the guid for the logical document
  4. with the information about your logical document you can get the info for the physical document in CRMORDERPHIO for one-order objects

The generic approache of the attachments and linkages in the document flow make it powerful, but also "hard" to read.

Let me know if you have further questions.

former_member660852
Discoverer

Dear Micheal,

Thanks to your kind explanation, I could find the table and data!!

As you mentioned, the attachments keys are stored complicated tables, and the linkage is very different from other tables.

Your information is useful for our understanding.

Thank you so much.

Makino

Answers (1)

Answers (1)

Himayatullah
Active Participant
0 Kudos

Hi Makino,

Please pass data as per below - You can get attachment info. Based on the need you can utilize other methods of the class cl_crm_documents to take it forward.

ls_business_object-instid = ls_orderadm_h-guid.
ls_business_object-typeid = ls_orderadm_h-object_type.
ls_business_object-catid = 'BO'.

 CALL METHOD cl_crm_documents=>get_info
        EXPORTING
          business_object = ls_business_object
        IMPORTING
          phioloios       = lt_phioloios
          loios           = lt_attachment_ids
former_member660852
Discoverer
0 Kudos

Dear Himayatullah,

Thank you for the information of the class.

When we have necessity to develop a programme for getting these date, we will use your sample code.

Thanks.

Makino