乐趣区

关于sap:从-SAP-帮助文档的页面谈谈-SAP-Content-Management-的实现

咱们关上一个 SAP 帮忙文档的页面,看到如下链接:

https://help.sap.com/docs/SAP…

其中 q=site 表明查问关键字为 site,loio 前面是一串 guid:loio76a5e87baecd4900b2d0f16e3768354e

version=2205 表明 Commerce Cloud 的版本号。

在 SAP CRM 中 URL 对象以逻辑对象 (LOIO) 和物理对象 (PHIO) 的模式存储。

为了取得 LOIO 和 PHIO 的值,咱们须要应用办法:CL_CRM_DOCUMENTS=>GET_INFO_URL。

咱们须要将 INSTID_A + TYPEID_A + CATID_A 字段传递到数据库表 SKWG_BREL 作为输出。

函数 SDOK_LOIO_GET_URI 能够用来读取 url.

应用如下的代码,依据 loio guid,取得 document url:

TYPES : BEGIN OF l_typ_instid,
instid_a LIKE skwg_brel-instid_a,
END OF   l_typ_instid.

**  Get URL link
DATA : l_tab_loios    TYPE skwf_ios,
l_tab_phios    TYPE skwf_ios,
l_wa_loios     TYPE skwf_io,
l_wa_phios     TYPE skwf_io,
l_wa_busobject TYPE sibflporb,
l_wa_object    TYPE sdokobject,
l_wa_skwg      TYPE skwg_brel,
l_wa_url       TYPE sdokcomurl,
l_var_url      TYPE saeuri.

DATA : l_tab_skwg     TYPE STANDARD TABLE OF skwg_brel,
l_tab_instid   TYPE STANDARD TABLE OF l_typ_instid.

FIELD-SYMBOLS : <l_wa_instid>  TYPE l_typ_instid,
<l_wa_guid>    TYPE os_guid.

LOOP AT it_object_guid ASSIGNING <l_wa_guid> .
APPEND INITIAL LINE TO l_tab_instid ASSIGNING <l_wa_instid>.
<l_wa_instid>-instid_a = <l_wa_guid>.
ENDLOOP.

SELECT *
FROM skwg_brel
INTO TABLE l_tab_skwg
FOR ALL ENTRIES IN l_tab_instid
WHERE instid_a = l_tab_instid-instid_a
AND instid_b LIKE‘L/CRM_L_URL%’.

SORT l_tab_skwg BY instid_a typeid_a catid_a.
DELETE ADJACENT DUPLICATES FROM l_tab_skwg
COMPARING instid_a typeid_a catid_a.

LOOP AT l_tab_skwg INTO l_wa_skwg.
CLEAR   : l_wa_busobject.
REFRESH : l_tab_loios, l_tab_phios.

l_wa_busobject-instid = l_wa_skwg-instid_a.
l_wa_busobject-typeid = l_wa_skwg-typeid_a.
l_wa_busobject-catid  = l_wa_skwg-catid_a .

CALL METHOD cl_crm_documents=>get_info_url
EXPORTING
business_object = l_wa_busobject
IMPORTING
loios_url       = l_tab_loios
phios_url       = l_tab_phios.

LOOP AT l_tab_loios INTO l_wa_loios.
CLEAR : l_wa_object, l_var_url, l_wa_url.
MOVE-CORRESPONDING l_wa_loios TO l_wa_object.

CALL FUNCTION‘SDOK_LOIO_GET_URI’EXPORTING
object_id = l_wa_object
IMPORTING
uri       = l_var_url.

MOVE l_wa_skwg-instid_a  TO l_wa_url-component.
MOVE l_var_url           TO l_wa_url-url.

APPEND l_wa_url TO et_urls.
ENDLOOP.
ENDLOOP.

SAP Document 存储反对如下几种形式:

  • SAP DMS
  • Generic Object Services
  • Direct upload as in CRM, PPM
  • Business Document Services
  • Archivelink

以上办法除了 archivelink 外,都应用 LOIO 和 PHIO 类的概念在 SAP 中上传原始文件。除了 archivelink 外,每个文档上传办法都有链接的 PHIO 和 LOIO 类。SAP Object 链接到 LOIO id,原始文档链接到 PHIO id。每种文档上传办法的 LOIO id 和 PHIO id 之间存在肯定的关系。

默认状况下,对于除 archivelink 之外的每种文档上传办法,原始文档都存储在 SAP 数据库表中。对于 SDOKPHCL 表中针对各自的 PHIO 类的每个上传办法,都能够应用默认的 SAP 数据库表。如果须要,能够应用配置将这些原始文件定向到内容服务器。

退出移动版