Fast Skip on SAP Document Management Service 02

作者:郑德鼎 约 4 分钟阅读 更新日期:2024-02-22 2 年前更新 标签:ABAP, Basis, Data Engineering, MM, SD, 工具, 开发, 技术, 数据工程, 物料管理, 系统管理, 销售分销

Fast Skip on SAP Document Management Service 02

FollowRSS feedLike

1 Like 1,068 View 1 Comment

Preface

I personally don’t want to split this topic into 2 pieces. But it seems to me SCN blogs has limitation that only allow you insert 30 pictures. Then I have to using this second episode to introduce the other 2 solutions to realize document attachments in your applications.

Fast Skip on SAP Document Management Service 01

Customized Solution on DMS

A customized attachment solution means only use DMS as a storage service, and use Z-tables to store meta data and object link information.  To be more intuitive, I will give a real example on how to implement an attachment service for purchase order.

Create your own APIs

1. Create 2 Z-tables. ZMMR1034 (Header table), and ZMMR1035 (Item table) are created

2.  Create a Class: ZCL_MM_ATTACH_SERVICE to encapsulate DMS operations: upload, read, get detail, and delete.

The class is mainly based on SAP BAPIs in function group: CVBAPI.

Function group: ZMM_ATTACHMENT is the main entry point which invokes the class object and synchronizes data with the 2 tables.

Embed in Standard PO Application

1. Add an attachment button in ME23N

You achieve this through a user exit(introduced bellow) to add a customer screen, in which you can add your buttons.

2. Click the button will pop up a screen to allow you upload, read, and delete attachments of PO.

3. Use Tcode: CMOD to open USER EXITS . Double click the screen exit: SAPMM06E 0101.

You can then add the attachment APIs and your own logic into the screen flow. This solution has the advantage that you bypass a lot of complexity of pure DMS, and you get more flexibility in implementing your own solutions. But you should also aware of the data atomicity when you save the PO. The document operations and PO operations should be in one transaction.

SAP GOS (Generic Object Service)

Introduction

SAP GOS is a collection of many personal/general functionality. Document attachment is one of them.

SAP GOS document attachment is based on KPro and ArchiveLink. ArchiveLink is another solution in SAP for store archived documents. ArchiveLink is based on CMS too, and is much simpler than DMS.

When you choose “Create Attachment” in GOS, the document is stored as SAPoffice document using Knowledge Provider Interface (KPRO). For more information, refer the following link: Frequently asked questions about Generic Object Services GOS – Application Server Infrastructure – SCN Wiki

There are also 2 very helpful notes

530792 – Storing documents in the generic object services and

904711 – SAPoffice: Where are documents physically stored?

Store Attachments using ArchiveLink

Configuration

1. Define content repository: The ID must only have 2 characters.

Path: SPRO–> SAP NetWeaver–> Application Server –> Basis Services –> ArchiveLink->Basic Customizing->Define Content Repositories

2. Edit document class

SPRO–> SAP NetWeaver–> Application Server –> Basis Services –> ArchiveLink->Basic Customizing->Edit Document Classes

3. Edit document type

SPRO–> SAP NetWeaver–> Application Server –> Basis Services –> ArchiveLinkàBasic CustomizingàEdit Document Types

4. Edit Links: This step links document type with business object.

SPRO–> SAP NetWeaver–> Application Server –> Basis Services –> ArchiveLink->Basic Customizing->Edit Document Types

5. Call ME23N to upload an attachment. Double click “PO Attachment” and upload a PDF file.

6. When successes, in the attachment list you will find the new item

Where to store attachments in GOS

By default, KPRO stores the SAPoffice data in the database table “SOFFCONT1 ”. You can select external content server by customize using Tcode: SKPR08. According to Note: 668271, you can edit table “SDOKPHCL” using se16 by adding following content.

After that, call SKPR08 you will find the entry: SOFFPHIO. Add a new category “ZSD_DMS” which is defined in DMS configuration steps. Now, upload document will be uploaded to SAP content server.

Now you can upload document using “Create Attachment” in GOS, and it will show you the creator and create time compared with before.

How to Invoke GOS in Applications

If you want PO applications to invoke GOS, you must enhance the application to add GOS codes. Take ME23n as an example, User exits should be found to adding code like bellow:

report ZPO_ATTACHMENT_POP2.

parameters

P_EBLEN type EBELN.

data: W_BTN_LOTDOC type CHAR100,

W_GOS_MANAGER type ref to CL_GOS_MANAGER,

W_GOS_LOTOBJ type BORIDENT,

W_GOS_SVC type SGS_SRVNAM.

*check W_GOS_SVC is not initial.

clear:W_GOS_LOTOBJ.

W_GOS_LOTOBJ-OBJTYPE = 'BUS2012'. "PO

W_GOS_LOTOBJ-OBJKEY = P_EBLEN.

"GOS MANAGER

create object W_GOS_MANAGER

exporting

IP_NO_COMMIT = ''

exceptions

OTHERS = 1.

"TO GENERATE OUTPUT

W_GOS_SVC = 'VIEW_ATTA'. "All the attribute are in table SGOSATTR

*W_GOS_SVC = 'ARL_LINK'.

call method W_GOS_MANAGER->START_SERVICE_DIRECT

exporting

IP_SERVICE = W_GOS_SVC

IS_OBJECT = W_GOS_LOTOBJ

exceptions

NO_OBJECT = 1

OBJECT_INVALID = 2

EXECUTION_FAILED = 3.

Run the program will pop up the screen directly.

Conclusion

Now we have 3 solutions to realize document attachment in applications, they are:

Standard DMS solution

Customized DMS solution

Standard GOS solution.

If you want no version management and document editing features, option 2 and 3 are preferred. While option 3 is the simplest way but lack of customization functions like adding additional fields in the pop up screen or embed as the sub screen in applications. A well designed option 2 solution could be the most appealed choice.

Alert Moderator

Assigned tags

Retagging required

vincent zhang s blog

Related Blog Posts

Fast Skip on SAP Document Management Service 01

By Vincent Zhang, May 20, 2016

SAP Cloud Platform Document Management – A new offering on SAP Cloud Platform

By Karunaharan V, Jun 15, 2020

SAP Teched Las Vegas VCM Sessions

By Michael Hesse, Oct 08, 2013

Related Questions

SAP Cloud Document Service

By Abhi S, Jul 31, 2020

Bin Sorting

By Sachin Arora, Aug 18, 2020

Billing date should not be before service start date

By S Jeeva, Feb 26, 2013

1 Comment

Shiv Kumar

March 15, 2018 at 11:38 am

Hi Vincent,

It is indeed a wonderful document. This has helped me a lot in Understanding DMS. I want a little explanation on GOS, Archive Link and DMS. Since we can store documents in an External server (Content Server) using any of these 3 interfaces. GOS is one of the simplest amongst all three. Then what is the advantage of  using Archive link and DMS, when we can achieve the functionality using GOS?

Like(0)

Reply

PH CLASS | SOFFPHIO

CREA USER | SAP

CREA TIME | 16.07.1998 21:10:00

VERSTYPE | 0

HEADERTAB | SOFFPHIO

STOR CAT | SOFFDB

BUFF XPIRE | 0

CAT MAINT | X

郑德鼎

关于作者:郑德鼎

企业信息化与 SAP 技术顾问,长期专注 SAP ABAP、FI/CO、MM、SD 等模块的技术分享与实战经验总结。查看更多介绍

来源说明:本文内容由「Fast Skip on SAP Document Management Service 02.docx」整理生成,仅用于内部技术分享与学习交流。