cancel
Showing results for 
Search instead for 
Did you mean: 

EH&S - .key file creation - interface

Former Member
0 Kudos

Dear all,

I would like to buid an interface MSDS documents + metadata between two systems, we would like to use some existing functionality (but without using Dok-X System).

Therefore I would like to use the following transaction and call the following function modules:

The following standard SAP transaction within SAP EH&S will be used to import MSDS documents: CG36 u2013 Import Reports. This transaction calls the userexit (maintain within SAP EH&S u2013 SPRO > Basic Data and Tools > Basic Settings > Manage User Exists > SRE_IMPORT (EHS_DXSDB) and following functional module: C13G_DOKX_SDB_PREIMP and C13G_DOKX_SDB_IMPORT. The Function modules will call a key file.

An ABAP will be developed to create the key file from the XML input. To be able to define the structure of the Key file, we need some examples. Within Report Information Management the system can Export a key file and MSDS in .PS file format, ones exported the files are not stored on the system. Therefor, could somebody send me some example MSDS structure key files?

Thank you in advance.

Kind regards,

Roy

Accepted Solutions (0)

Answers (2)

Answers (2)

christoph_bergemann
Active Contributor
0 Kudos

Hello

in addition to what has been explained by Jayakumar: If you analyze carefully the function modules you have mentioned you will find all "constants" in the key file which can be used in upload. Some of them are useful; some of them are mandatory etc.

The procedure you are describing is used to do an "import". Coming back to your question:

"I would like to buid an interface MSDS documents + metadata between two systems, we would like to use some existing functionality (but without using Dok-X System)."

I am not so sure in which direction your are thinking.

So this would be my questions:

1.) Are both system SAP Systems having an installed EH&S ? If so you should use ALE distribution of the reports to bring them from one system to another

2.) If target system is a SAP System but EHS not installed other options exists which one might use

In addition:

"Within Report Information Management the system can Export a key file and MSDS in .PS file format, ones exported the files are not stored on the system"

(IN addition: if necessary the "PS" files could be stored. This is a matter of set up of the system)

The approach with the export can not "directly" by used to do an import into a SAP system. You could use the SAP techniques to do the job without modifications in EH&S etc.but if the targetsystem is a SAP System, you should use ALE transfer of the documents

Additionally:

An ABAP will be developed to create the key file from the XML input.

This is not "clear" enough to me. As explained by Jayakumar the key files is a simple "ASCII" File. So why using XML as an "intermediate" file type?

To my knowledge in principle it should be possible to do this:

SAP System with reports => transfer via ALE to SAP XI => transfer to a Non Sap or SAP System

But if the target system is a SAP system: the ALE approach is much simpler (wihtout using the SAP XI middleware approach).

With best regards

C.B.

Former Member
0 Kudos

Dear C.B.,

thanks for your reply.

The interface needs to be build from IA (non SAP solution)- SOURCE to SAP EH&S - TARGET. A XML file (metadata) and PDF are delivered by SOURCE and stored on TARGET SAP system.

An answer on your questions:

1.) Are both system SAP Systems having an installed EH&S ? If so you should use ALE distribution of the reports to bring them from one system to another

> No. SOURCE system is non-SAP, therefore we will not use ALE distribution.

2.) If target system is a SAP System but EHS not installed other options exists which one might use

> Target system is SAP 4.7. - EH&S is installed - Product Safety - Report Shipping Process

Do you know if it is required to run both function modules or would C13G_DOKX_SDB_IMPORT be sufficient for importing the key file and import document assignment to subid?

a) C13G_DOKX_SDB_PREIMP

b) C13G_DOKX_SDB_IMPORT

Thanks.

Roy

christoph_bergemann
Active Contributor
0 Kudos

Hello Roy

ok your plan seems to be to use the XML file and transfer it to a key file together with the pdf file and to do the upload.

To do so you need to prepare the customizing like you have described by your self. The data maintained there must fit to the data in the key file. Additionally you need to take a look in "condition table 4 " of substance generation variant finding (customizing). The data here must fit the content of the key file and what you have done in preparing the user exit like you have discribed.

If you use the process like you described there will be in the upload "two" steps. One with which you can test the "key" file (i believe this belongs to the "Preimp" function module" and the second one with which you can do the import (by mass !! if necessary.

Therefore you need both function modules in some sense.

Any file (key in combination with pdf) in the selected folder is a source of a document in SAP EH&S. Afterwards (I believe) the content of the folder is deleted automatically by EH&S (not sure about; please check that).

May be this hint could make it "easier" (or more complex):

I believe starting with SAP enterprise 4.7 ext 2.0 SAP delivers a new method to do an upload (not by mass !). to my knowledge no key file is needed using this alternative. This transaction should be part of the SAP menue.

Hope that helps

C.B.

Edited by: Christoph Bergemann on Mar 19, 2010

12:44 PM

Edited by: Christoph Bergemann on Mar 19, 2010 12:45 PM

Edited by: Christoph Bergemann on Mar 19, 2010 12:47 PM

Former Member
0 Kudos

Hi C.B.,

thanks allot for your reply and hint!

I gues and assume your mean transaction: CG36VEN (Import Vendor MSDS). Indeed you do not need any Key file. Only though there are some cons on this transaction:

CG36 versus CG36VEN

- CG36VEN looks standard to your local drive (including pop-up), we have the documents stored on SAP directory.

- CG36VEN does not have a Log transaction. (the CG36 does has CG3J - Check Report Import Log as standard)

- CG36VEN is not meant for Mass import of documents, CG36 is Mass importing (which is needed)

- CG36VEN does use the IBD_MSDS Generation Variant, others which are maintained as Master Data in the system like, MSDS_EU can not be assigned, only Generation Variants with document type IBD_MSDS is available.

The only thing is, I can't get the transaction CG36 to work yet. I have stored two files, as following:

Ak97b_85x_d4gp_p0g_85x_3.key

Ak97b_85x_d4gp_p0g_85x_3.pdf

stored under E:/USR/SAP/PUT/ (SAP Directory)

It does not show any error messages either. I have implemented SAP NOTE: 1323016 already (as no error was shown) - at the point of clicking on CHECK DIRECTORY. I have tested and implemented the note on SAP ECC6.0., without success.

I'm lost, what could go wrong?

Thank you in advance.

Kind regards,

Roy

Edited by: R. Derks on Mar 19, 2010 1:42 PM

christoph_bergemann
Active Contributor
0 Kudos

Hello Roy

Do you use UNIX as OS? I have only experince with UNIX. Reason: If you use:

"E:/USR/SAP/PUT/ "

as directory you "mix" in some sensw WindoWs logic (E:" with UNIX logic "/..."). Using UNIX /USR... is in my opinion correct (the characters of the folder you are using are case sensitive using UNIX. So I would expect "/usr/sap/put" as in most cases UNIX folder structures are using lower case characters.

Did you get any log info? In the Preimport check it seems to be that no info is given. What about the import? Is there a log created?

If you have prepared customizing correct, the generation variant correct and if you have the correct access rights it should really work without trouble. Actually I have no further idea.

With best regards

C.B.

PPS: Hello Sachin: please use your original entry here: to discuss the topic regarding ALe

Edited by: Christoph Bergemann on Mar 21, 2010 8:48 AM

Edited by: Christoph Bergemann on Mar 21, 2010 8:48 AM

Edited by: Christoph Bergemann on Mar 21, 2010 8:51 AM

Edited by: Christoph Bergemann on Mar 21, 2010 8:51 AM

Edited by: Christoph Bergemann on Mar 21, 2010 8:54 AM

Edited by: Christoph Bergemann on Mar 30, 2010 4:10 PM

Former Member
0 Kudos

Thanks!

the issue was related to Windows/Unix indeed. In order to read the transfer directory, EH&S uses a external operating

system command. Unfortunately the delivered command WWI_GET_DIR works

only on server with Unix-Like operating systems.

For servers with Window-NT operating system a specific command must be

created.

This is carried out in transaction SM69. Create in this way a command

with the following values:

Command name: ZWWI_GET_DIR

Operating syst: WINDOWS NT

Operating system command: cmd /c dir

Aditional Parameters Allowed: <yes>

So that the import uses this new command, this must be notified by the

EH&S environment parameter 'REP_IMPORT_OS_COMMAND'.

Therefore please start transaction SPRO, go to IMG-Activity

'Environment, Health & Safety -> Basic Data and Tools -> Basic Settings

-> Specify Environment Parameters' and change environmental parameter

'REP_IMPORT_OS_COMMAND' to parameter value 'ZWWI_GET_DIR'.

After this you can re-check transaction CG36.

Thanks again.

Kind regards,

Roy

Edited by: R. Derks on Apr 2, 2010 11:25 AM

Former Member
0 Kudos

Hello Roy,

Check this format

DTY=SDB

SID=SUB000000001

PRN=MAT000000001

STA=V

LAC=En

CPN=Demo CompanyName

FFT=PS

FNA=12345678.ps

DAT=2010/02/02

VER=1

More information check the SAP Note 154233

Thanks

Jayakumar

Former Member
0 Kudos

Dear Jayakumar,

Thank you very much for the structure details, very helpful! Although the SAP Note you are mentioning (SAP Note 154233) is not related to the issue I gues, could you check this?

Thank you in advance.

Kind regards,

Roy

Former Member
0 Kudos

Hello Roy,

Here's the correct number 153233. Its not a separate file on Doc-x, but in EH&S 2.2 Patch level this information is highlighted.

Thanks

Jayakumar

Former Member
0 Kudos

Hi,

My question is regarding the interfaces only but slightly diffrent. I want to duribute the Specification data of some of the classes only in a property tree but I am facing the problems. Please check the below points I have raised.

This issue is regrding the distribution model. We want to transfer the EHS data from 4.6 to ECC 6.0. Below is the requirement:

1. There are few classes which needs to be distributed and not all classes and its charecterstics in the property tree.

2. I have created a distribution model for it and entered the classes which are relevant for e.g. Flash point is the class (SAP_EHS_1014_009) which is there in the dist model. So when I change any charecterstics value in this class and Run BD21 then I can see the Class in the list under the segment E1BP1077VH and the changed charecteristics is under the segment E1BP1077PR. Which seems to be correct- But when I change another charecterstics of another class (SAP_EHS_1013_013) which is not there in the dist model. Then BD21 and still I can see the new Charecte. in the WE02 though the class is not in the distribution model. Meaning its not filtering out the irrelavant charecterstics in the property tree. Thats the reason all property data is getting transfred.

Is there is any customizing setting? I think as a Standard process it must filter out the changes of the classes which are not there in the distribution model. DO you have any hint on this?