1- Requirement
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
2- Files location
Files are placed in the folder: /exploit/BW/CIS.
3- Files description
3-1 BW_PPS_EHS_LIBSUBST.TXT
3-1-1 Brief description
This file contains all the specifications that have a long description and a substance nature.
3-1-2 Logical file name
Z_EHS_FILENAME
3-1-3 Source
Specification InfoObject (0EHS_SPEC)
3-1-4 Fields
:
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 |
3-1-5 Conditions for the loading
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.
3-1-6 Example
100000000019;Z_SUB_MONO;Ultramarine blue
100000000053;Z_SUB_MONO;terephthalic acid
100000000054;Z_SUB_MONO;ethylbenzene
3-2 BW_PPS_EHS_SUBSTCAS.TXT
3-2-1 Brief description
This file contains all the specifications that have a short description.
3-2-2 Logical file name
Z_EHS_FILENAME2
3-2-3 Source
Specification InfoObject (0EHS_SPEC)
3-2-4 Fields
:
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 |
3-2-5 Conditions for the loading
The specification has a short description,
The specification code is between '100000000000' and '200000000000',
Only English descriptions are loaded.
3-2-6 Example
100000000019;Z_SUB_MONO;57455-37-5
100000000053;Z_SUB_MONO;100-21-0
100000000054;Z_SUB_MONO;100-41-4
3-3 BW_PPS_EHS_COMPO_STD.TXT
3-3-1 Brief description
This file contains the percentage of specifications in the commercial products for a selected month.
3-3-2 Logical file name
Z_EHS_FILENAME3
3-3-3 Source
Material-Specification Mapping Datastore Object (DSO_EHS1),
Commercial Product InfoObject (C_PROD)
3-3-4 Fields
:
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
3-3-5 Conditions for the loading
The specification is not like ‘PRCO*’ or the percentage specification in material <> 100%,
Data are limited to the specified month (input criteria)
3-3-6 Particular handling
‘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
3-3-7 Example
90000317;100000000000;ZZ_BU_00;;100.00000000;%
90001679;100000002090;ZZ_BU_10;;89.00000000;%
90001679;100000001974;ZZ_BU_10;;11.00000000;%
4- Program description
Name: Z_DOWNLOAD_FILE_EHS
For each file, here are the steps followed by the program:
- Data structure definition,
- Data extraction into internal table,
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}}
- Getting the physical file name,
- Opening the dataset (physical file),
- Handling of internal table data,
- Transferring data into the file,
- Closing the dataset (physical file)
5- Data Flow modifications
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.
6- Frequency
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.
7- In case of loading error
The program could be executed manually by choosing a month in the user screen.




