cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to use Characteristic ID and Phrase Key to find linked Material Numbers in SAP EHS .

PratapYendru
Newcomer
0 Kudos
223

 

Hi SAP Community,

I'm working on a cross-functional requirement involving SAP EHS, and I would greatly appreciate your expert advice

**Background:**

I’m an **SAP SD Consultant**, and this is my first time working in the **SAP EHS** space. I don’t have deep expertise in EHS data models or BAPIs, so please excuse any gaps in terminology. I need some guidance to approach this correctly.

**Requirement:**

I only  the following input Characteristic ID (e.g.,ZSAP_EHS_9999_000_CATEGORY) and Phrase Key (e.g., CUST-TD-9999). 

Using only this information, I need to retrieve a list of Material Numbers (MATNR) that are linked to substances/specifications where the characteristic matches this phrase key using  BAPI_BUS1077_GETDETAIL

.My Main Questions : 

  1. Can I use `BAPI_BUS1077_GETDETAIL` to find specifications/materials based on Characteristic ID and Phrase Key — or is it not intended for that use case?
  2. If not, is there any alternative standard method (table join, report, function module) that can help me:  Find SUBIDs where a characteristic has the target phrase key?
  3. Then map those SUBIDs to  Material Numbers (MATNR)?
  4. Are these the correct tables to manually trace it?
  •  ESTVA , ESTVP , ESTPP` for phrase/characteristic values
  •  ESTMJ` to link SUBID with MATNR

**Expected Output:**

A list of **Material Codes** where:

  • The material is linked to a **specification (SUBID)**
  • That specification includes a given **Characteristic ID**
  • With a specific **Phrase Key** value

Any support, guidance, or example logic would be very helpful.

Thank you all in advance for your help .

Regards,

Satya

 

Accepted Solutions (0)

Answers (3)

Answers (3)

christoph_bergemann
Active Contributor
0 Kudos

Hello

from function point of view as mentioned): normaly the demand is solved by a user.

Step 1: by using the EHS search capability a so called "hit list" is generated

Step 2: then it need to be checked by the user: is there a material assigned to the identfied objetc and if yes. list them

The issue is the second step. Here the options in SAP standard are limited

The "BAPI" is only useful for the second step and not for the first step

BUt as the first step is done (from technical perspective) by using a "function module" to which some parameter are handed over:

You can write down a E2E process which could be done 100% by an ABAP routine

Many people "hate" the EHS data model: therefore they try to extract the data to BW or other tool for doing the same story. This is possible as well.

There is a small "but":  based on the number of data the inquiry can take longer; and as the data will change over the time: any day you might get a different (but clearly correct) result

I wish the best

C.B.

christoph_bergemann
Active Contributor
0 Kudos

Hello

regarding the first part:

**Requirement:**

I only  the following input Characteristic ID (e.g.,ZSAP_EHS_9999_000_CATEGORY) and Phrase Key (e.g., CUST-TD-9999). 

Using only this information, I need to retrieve a list of Material Numbers (MATNR) that are linked to substances/specifications where the characteristic matches this phrase key using  BAPI_BUS1077_GETDETAIL

This is normally achieved by a real "user" /using SAP transaction CG02) and not via ABAP" Report; but via ABAP report it is in theory possible to achieve this.

EHS does have some "powerfull search options (please check SAP online help).. Assuming the following:

The material in scope should be assigned to a "REAL_SUB": by using the CG02 search options you can get a list of specifications having the needed data. On top: you can extract than the "materials" as assigned to the REAL_SUB

But by specifying a "material number" (as part of the research) in the so called "hit list" the material name is displayed.

In a nutshell:  Anyhow: the last step: here you can use then BAPI_BUS1077_GETDETAIL to read the data, For the other part: you nee to look for the function modules which are responsible for the "search". There is on function module used to search for if the input is only a "phrase key".  But i propose: To get  solution you should look for a functional EHS ressource and a technical resource which can help you to get the solution.

Wish you the best

C.B

nischayupadhyay
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Satya, 

From technical side, you could use either the BAPI or the Table mapping. 

If you just need the list as on output, I would personally prefer using the table mapping. 

The tables you listed are correct. Should give you the output. 

  •  ESTVA , ESTVP , ESTPP` for phrase/characteristic values
  •  ESTMJ` to link SUBID with MATNR

SUBID corresponds to RECN and then you can do all the mapping across above tables to get your output. 

From a functional side, you have various options available:

1. Use "Advanced Search" app

2. Use "Substance Workbench" (CG02) 

 

Hope this helps. Good luck.

 

Regards

Nischay