Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Prerequisite

The reader of this weblog is expected to be familiar with Generic Object Services, ABAP and SAP content server 

Requirement
Our customer needed a solution to store business documents/attachments in external content servers.The external store could be archive link or any other HTTP based content store. The solution should be reusable across transactions and business objects. The customer could potentially choose to use the solution in sales orders, purchase order or any other transaction.


The relevant links need to be established between the attachment and the business transaction/document. The interface should be simple to use and scale just like google docs.

 

Business Benefit

Here is a simple business benefit that would be easy to relate for the IT community.

Typically, for the development of FRICE objects , the relevant specs and test cases are stored either in sharepoint or Solman. The developer has to login to diff systems to check in and check out files. 

These custom services would ensure that the developer uses the same SE38 executable of the program to get all access docs. This one interface approach will ensure that there is a document for every object we create and every business process we support throuch custom apps. The UI remains the same ABAP workbench and the ABAP runtime, which is essentially the custom transaction we invoke.

 

 

Solution Development:

The solution was to add two services to the generic object services is SAP.


More details about Generic object services can be found in

URL: Generic Object Services

The following functionalities will be covered in document attachments

1) Creating an attachment
2) Deleting an attachment
3) Viewing an attachment

 

Two custom services were created using the following steps mentioned in Naimesh Patel's blog. Thank you Naimesh

The custom services in our example are:

1) ZCREATE_DMS - Class - ZCL_DMS_ATTACHMENT_CREATE - Create attachment. Cloned from CL_GOS_SRV_ATTACHMENT_CREATE.

2) ZVIEW_DMS - Class - ZCL_GOS_SRV_ATTACHMENT_LIST - View attachment container. The functionalities - Create, Export, delete and view are within this class.This class is cloned from CL_GOS_SRV_ATTACHMENT_LIST.

3)These classes are inherited from CL_GOS_SERVICE. 

 

After making these table entries in SGOSATTR with the relevant classes, we will proceed with making the relevant code and customization changes for GOS attachments.

 

It is worthwhile to refer to Business Document Service API's before proceeding to read the solution specfics.

The following functionalities are implemented in the Custom Services
1) Authorizaton checks for transactions using TVARV.
2) Calling Business Document Service API's. The API's called are in the class CL_BDS_DOCUMENT_SET.

The information flow across classes is as follows:

CL_GOS_SERVICE - Abstract - All GOS classes inherit this behavior


ZCL_GOS_SRV_ATTACHMENT_LIST - The control passes to this class with the BOR instance ID, when we click on the service in the GOS toolbar.


Apart from the classes assigned to custom services, the following classes were cloned or created. Again, we could do all in one, if required.

ZCL_GOS_ATTACHMENTS - Cloned from CL_GOS_ATTACHMENTS to customize the menu in the attachment list container
ZCL_BDS_AL_ITEM - CLoned from CL_BDS_AL_ITEM to call BDS document service methods for create, attach and display
ZCL_BDS_DOCUMENT -  COntains the methods to display, export and delete a document,

CHECK_STATUS and execute are the critical methods in all of these classes inheriting CL_GOS_SERVICE.

CHECK_STATUS - Can be used for authorization or any other checks before the service is called.
EXECUTE - determines the action of the service when invoked.

 

Solution specifics- All code mentioned here are only deviations from standard SAP methods in cloned classes.

Class - ZCL_GOS_ATTACHMENTS-

 

Solution specifics for Create Attachment

Class: CL_GOS_DOCUMENT_SERVICE contains all methods relevant to create. This was cloned into ZCL_GOS_DOCUMENT_SERVICE for calling BDS relevant methods for create.

Class  :  ZCL_GOS_DOCUMENT_SERVICE

 

Configuration 

It is possible to literally configure our business object to point to a content store when we use  Business Document Services. The relevant customization can be maintained in BDS_CL_DOC. An entry in this table for your BO will override any TOAOM entries. Content server settings are a pre requisite.

Consuming custom Services 

A simple way to call custom services or the GOS toolbar is to use the class CL_GOS_MANAGER. A sample report is shown below:

 

Road Ahead

 

  • Exposing Web services for GOS attachments
  • Sharepoint workflow collobaration
  • Document workflow and automatic notification
  • GSA(Google Search Appliance)  integration of all docs in kpro/archivelink/sharepoint/content server 
5 Comments