Read and Exchange Specification Data from SAP EHS to .Net system Using ABAP Web-Services


Contents

1. Introduction

2. Overview of EHS Specifications in SAP EHS

3. Reading a Specification

4. SAP Web-service connections


Introduction

This document explains details of reading an SAP EHS Product Safety Specification using standard EHS BAPI_BUS1077_GETDETAIL and using Web services to exchange this data with Non-SAP 3rd Party system.


Source of Data: SAP EHS Product Safety Module

Consumer of Data: .Net Application

Middle-ware: SAP Web service (RFC Enabled Function Module)


SAP EHS Product Safety Specification Overview

In SAP EHS Product Safety, consists of Specifications, which are analogous of a material in other SAP Modules Like MM. Specifications contain the information on Hazardous Data, Safety information, Transport classification, Precautionary statements, etc. which are used by business in labeling, printing Material Safety Data Sheets (MSDS), sending the relevant data to multiple consumer systems such as websites, printing software, other SAP Landscapes, etc.



In the below screenshot you can see a test Specification TEST_EU. These specifications have property Tree structure which is used to store data specific to each property. E.g in the below screenshot, you can see Safety Related properties this section stores all the properties related to Safety measures to be taken while handling the material.


Identifier tab shows the different Names/Numbers/alphanumeric tags related to this specification.

Each specification has a Specification Type based on the data it is holding.


/wp-content/uploads/2014/09/1_530915.png


EHS has a unique structure of property Tree, Value Assignment, Classes and Characteristics which is used to store the Data in EHS. The specification data is not stored in a single table, but across a multiple tables which are linked using linkage of Record Numbers between multiple EST* tables. This structure of storing data makes it difficult for directly reading the Data for a particular specification. This standard BAPI provided by SAP BAPI_BUS1077_GETDETAIL is used.


Reading a Specification

EHS specification can be read by using an ABAP Program using a standard BAPI provided by SAP BAPI_BUS1077_GETDETAIL. This BAPI takes inputs in form of FLAGs Sets and Specification details. Using this BAPI, all data for one or more specifications can be read by assigning values to certain import parameters. The selection of the data can be restricted by entering details in specific import or export tables.

The key of the specification object to be read must be specified in the specification header table SUB_HEADER of the BAPI. These flags can be set based on the sections of the specifications you want to read.

Input Flag Setting

Corresponding BAPI Table

Meaning

– FLG_HEADER = ‘X’

SUB_HEADER

Substance Header Data (Specification key)

– FLG_HEADER_USAGE = ‘X’

PROP_USAGE

Usage details of Each Value Assignment. One can specify the rating and validity area for which data is to be read.

– FLG_REFSUBS = ‘X’

REFSUBS

Reference Substances linked to the specification

– FLG_IDENT = ‘X’

IDENT_HEADER, IDENT_SUBLIST

Identifiers in Headers and Linked Specifications

– FLG_IDENT_LONGTEXT = ‘X’

IDENT_LONGTEXT

Identifier Long text

– FLG_IDENT_USAGE = ‘X’

PROP_USAGE

Value assignment usage

– FLG_PROPERTIES = ‘X’

PROP_HEADER, PROP_VAL

Property header Data, Property Values, if they are inherited from other specification or Not

– FLG_PROP_DATA = ‘X’

PROP_DATA, PROP_COMPONENT

– FLG_PROP_DETAILS = ‘X’

PROP_USAGE, PROP_RELIABILITY

PROP_SOURCE

– FLG_PROP_FTEXT_LONGTEXT = ‘X’

PROP_FTEXT, PROP_FTEXT_LONGTEXT

Long text linked to property

– FLG_DANG_GOOD_DATA = ‘X’

PROP_TAB07, PROP_TAB0B, PROP_TAB0D

Dangerous Goods Data, Hazard inducers

PROP_TAB0F


We need to pass the specification Number to the SUB_HEADER Table as shown below:

/wp-content/uploads/2014/09/2_530916.png

One can read the specification details for a particular USAGE by setting the relevant USAGE in PROP_USAGE table

More details on the BAPI can be easily obtained from the BAPI Documentation provided by SAP.


Creating an SAP Web service connections


The approach that we used was to create an RFC Enabled Function Module which takes the specification number as the input and reads the specification by setting relevant Flags in BAPI. The Data is then extracted and stored in a structure table. This structure is dynamic in nature i.e. the fields are dynamically populated based on the number of values returned by BAPI.


Step 1: Create a RFC Function Module

Create a Function Module and enable the Remote Function Call.


Step 2: Publish a services provider based on the FM

In the menu, MENU->Utilities->More Utilities->Create Web Service->From the Function Module.


/wp-content/uploads/2014/09/3_530917.png

Mention the Service defination and the SOAP Application.

Also the profile should be set to PRF_DT_IF_SEC_HIGH as shown in the below screenshots:

/wp-content/uploads/2014/09/4_530918.png

/wp-content/uploads/2014/09/5_530919.png

Next Steps are to Use the SOAMANAGER t-code and configure the web-service. Choose the second tab “Application and Scenario Communication”, then click “Single Service Administration”.

/wp-content/uploads/2014/09/6_530920.png

Search with the web-service name. Once the web-service is selected, click Display selected Binding’s WSDL URL. This will give you the URL which needs to be passed to the .net Team. They will consume this URL in the web application code and call the FRC function Module.

The web-service can be activated using the transaction SICF. The transported web-service might be needed to be created manually in the Next System.

The web-service created in the above step will be consumed by the .Net application.

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

Leave a Reply