Monday, 16 April 2018

Hyperlink in Object Documentation

In this blog, I would like to share the possible solutions that could be used to achieve the desired result.

Requirement:


SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides, SAP ABAP Learning

User will click on “Click here to open SAP.com” and system will open https://www.sap.com in new session of the browser.

In the same way, the requirement is to provide an hyperlink to open documents stored on customers network, on share-point or on solution manager system ( link can be generated for document stored on solution manager system ).

Possible Solutions:

Option 1: To use the URLA option provided by SAP.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides, SAP ABAP Learning

Shortcomings:

With this solution we face a constrain for the length i.e numbers of characters that can be passed in the hyperlink. As the tag for DS cannot be extended to new line, we are left with only 72 characters in which we have to provide TAG and URL.This option is ruled out as URL for documents stored on internal network can be very lengthy.

Option 2: Transaction link.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides, SAP ABAP Learning

Provide the transaction and link the transaction to the report which will have the following code

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides, SAP ABAP Learning

Shortcoming:

The limitation with this approach is to create a new tcode for every hyper-link that
we want to provide in the documentation.

Option 3: Create Custom Document class and FM’s for the document class.

Step 1) Create a table entry in table TDCLD. This table contains document class

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides, SAP ABAP Learning

Table: TDCLD is the master table for Document class with maintenance allowed. However there is no table maintenance generator for the same. Also there is no tcode/report available to maintain data for this table. Hence you will have to maintain this table via SE16 or SE16N. Best would be to copy URLA table entry and give your own denomination for the respected value. In our example document class is ZRJK.

Step 2) Coping standard FM’s.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides, SAP ABAP Learning

Copy FM’s URLA_OBJECT_SHOW and URLA_OBJECT_TITLE with first 4 characters should be the document class. In our example, ZRJK_OBJECT_SHOW and ZRJK_OBJECT_TITLE.

Step 3) Pass values from documentation to the FM.

DOKNAME will contain the value passed to the FM.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides, SAP ABAP Learning

String after “ZRJK.” contains document name which will be passed to FM. In our example we are passing LOIO number for documents stored on solution manager system.

Step 4) Build the URL in FM and call the link in browser.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides, SAP ABAP Learning

Keep the FM for TITLE with empty body. In our example ZRJK_OBJECT_TITLE is copied from URLA_OBJECT_TITLE but with empty body. Since with the last option we get control in FM where dokname contains the document name passed through documentation, we can build many solutions depending on the requirement.

1 comment:


  1. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
    SAS Consulting Services in usa

    ReplyDelete