EHS users need to have sales information with EHS characteristics.
EHS data have to be sent from BW to BO using 3 flat file using the ";" as field separator:
BW_PPS_EHS_LIBSUBST.TXT
BW_PPS_EHS_SUBSTCAS.TXT
BW_PPS_EHS_COMPO_STD.TXT
Files are placed in the folder: /exploit/BW/CIS.
This file contains all the specifications that have a long description and a substance nature.
Z_EHS_FILENAME
Specification InfoObject (0EHS_SPEC)

:
Field | Technical name | Type |
Specification | /BI0/PEHS_SPEC-EHS_SPEC | char 12 |
Substance Nature of the specification | /BI0/PEHS_SPEC-EHS_SUCH | char 10 |
Specification long description | /BI0/TEHS_SPEC-TXTLG | char 60 |
The specification has a substance nature,
The specification has a long description,
The specification code is between '100000000000' and '200000000000',
Only English descriptions are loaded.
100000000019;Z_SUB_MONO;Ultramarine blue
100000000053;Z_SUB_MONO;terephthalic acid
100000000054;Z_SUB_MONO;ethylbenzene
This file contains all the specifications that have a short description.
Z_EHS_FILENAME2
Specification InfoObject (0EHS_SPEC)

:
Field | Technical name | Type |
Specification | /BI0/PEHS_SPEC-EHS_SPEC | char 12 |
Substance Nature of the specification | /BI0/PEHS_SPEC-EHS_SUCH | char 10 |
Specification short description | /BI0/TEHS_SPEC-TXTSH | char 20 |
The specification has a short description,
The specification code is between '100000000000' and '200000000000',
Only English descriptions are loaded.
100000000019;Z_SUB_MONO;57455-37-5
100000000053;Z_SUB_MONO;100-21-0
100000000054;Z_SUB_MONO;100-41-4
This file contains the percentage of specifications in the commercial products for a selected month.
Z_EHS_FILENAME3
Material-Specification Mapping Datastore Object (DSO_EHS1),

Commercial Product InfoObject (C_PROD)

:
Field | Technical name | Type |
Commercial Product | /BIC/ADSO_EHS100-/BIC/C_PROD | char 18 |
Specification | /BIC/ADSO_EHS100-EHS_SPEC | char 12 |
Authorization Group | /BIC/ADSO_EHS100-EHS_AUTH | char 10 |
Substance Nature of the Commercial Product | /BIC/PC_PROD-EHS_SUCH | char 10 |
Percentage Specification in Material | /BIC/ADSO_EHS100-EHS_SPMA |
Number
8 decimals
The specification is not like ‘PRCO*’ or the percentage specification in material <> 100%,
Data are limited to the specified month (input criteria)
‘0‘s on the left of the commercial product code are deleted,
Negative sign ‘-‘ in the percentage must be on the left of the number,
Before the loading a screen allows the user to choose a specific month for the extraction
90000317;100000000000;ZZ_BU_00;;100.00000000;%
90001679;100000002090;ZZ_BU_10;;89.00000000;%
90001679;100000001974;ZZ_BU_10;;11.00000000;%
Name: Z_DOWNLOAD_FILE_EHS
For each file, here are the steps followed by the program:
BW_PPS_EHS_LIBSUBST.TXT
{{code language="abap"}}SELECT SPECEHS_SPEC SPECEHS_SUCH SPECTTXTLG
FROM /BI0/PEHS_SPEC AS SPEC
JOIN /BI0/TEHS_SPEC AS SPECT ON SPECEHS_SPEC = SPECTEHS_SPEC
AND SPECTLANGU = 'E' AND SPECTTXTLG <> ''
INTO TABLE itb_spec
WHERE SPECEHS_SUCH <> ''
AND SPECEHS_SPEC >= '100000000000'
AND SPECEHS_SPEC < '200000000000'/code
BW_PPS_EHS_SUBSTCAS.TXT
{{code language="abap"}}SELECT SPECEHS_SPEC SPECEHS_SUCH SPECTTXTSH
FROM /BI0/PEHS_SPEC AS SPEC
JOIN /BI0/TEHS_SPEC AS SPECT ON SPECEHS_SPEC = SPECTEHS_SPEC
AND SPECTLANGU = 'E' AND SPECTTXTSH <> ''
INTO TABLE itb_spec2
WHERE SPECEHS_SPEC >= '100000000000'
AND SPECEHS_SPEC < '200000000000'/code
BW_PPS_EHS_COMPO_STD.TXT
{{code language="abap"}}SELECT DSO/BIC/C_PROD DSOEHS_AUTH CPRODEHS_SUCH DSOEHS_SPEC DSOEHS_SPMA
FROM /BIC/ADSO_EHS100 AS DSO
JOIN /BIC/PC_PROD AS CPROD ON CPROD/BIC/C_PROD = DSO/BIC/C_PROD
INTO TABLE itb_spec3
WHERE DSO/BIC/C_PROD <> '' AND DSOEHS_SPEC <> ''
AND ( DSOEHS_SPEC NOT LIKE 'PRCO%' OR DSOEHS_SPMA <> 100 )
AND DSOCALMONTH = P_MONTH{{/code}}
Some adjustments have been done on BW:
The substance nature (0EHS_SUCH) was added as a navigational attribute of the commercial product (C_PROD) which has been populated by the specification extractor (0EHS_SPEC_ATTR) with specifications that are beginning by "PRCO". The substance nature of a commercial product is populated by the substance nature of the specification in the extractor as show below.


In the start routine, specifications that are not like ‘PRCO*’ are deleted from the source package.
The commercial product is calculated with a formula by concatenating ‘0000000000’ on the left of the eight right last characters of the specification: '0000000000' & RIGHT( 8, SUBID ).
The DTP which load C_PROD was added in “Performance RCS EHS KPI” process chain.
Before running Z_DOWNLOAD_FILE_EHS program, the loadings of 0EHS_SPEC (texts an attributes), C_PROD and DSO_EHS1 have to be completed. So it was decided to trigger an event (PC_GENERATE_EHS_FILES event) at the end of “Performance RCS EHS KPI” process chain which runs monthly on the 1^st^ month day. “GENERATE EHS FILES” process chain was created and it starts on this event.
The program could be executed manually by choosing a month in the user screen.