cancel
Showing results for 
Search instead for 
Did you mean: 

EHS report export from CG54 to be automated

Former Member
0 Kudos

Hi all,

I have an issue regarding exporting the EHS report via CG54.

The EHS reports that are in released state are exported using the export option which shows a pop-up to select the exit for exporting.

The order gets generated and the order is further set to complete via CVD1.

Now, i have a requirement to automate this entire process of exporting i.e. the process of CG54.

I tried using a BDC by recording the steps and then creating a batch job for it.

But, it didn't work, as the job finishes successfully but does not export any report.

The recording was as per the steps followed but still no idea why it didn't work.

Also, executing the recording in foreground via SM35 showed a timed out error.

So, if any one has come across and resolved such an issue or have any idea regarding this, then please help and share your inputs.

It would be of great help as I am struggling for quite sometime.

Thanks a lot in advance. Looking forward for your replies.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Dharmin,

Since you have embarked on a way to to a BDC program for automating the entire process, I would say it is a right step but not a right approach.

Yes you would need to have a program to run as a job or as a ad hoc mode to export reports. The technique which may be used here is to

Step 1 -Find newly relased reports . The API C1F3_REPORTS_FIND_FOR_SUBSEQ could be used. I would not recommend a direct table read of ESTDH

Step 2 - generate report shipping call (EXP_CALL) . API CVEA_RDOS_CREATE_BY_EHS  could be used .

The next step would be processing the EXP_CALL function. So you need to have a proper customising for report shipping in SPRO so that the EXP_CALL processing routine is called. The standard function module to generate key file (meta data) as well as the report document (as a PDF or otherwise) is CVE9_RDO_DOKX_EXPORT

However in these steps you would need to have your adaptions of the APIs based on the business requirement. For example do you need an export when there has been no relevant change in the report. Do you need a export when there is a change in a substance and so on..

Comments from community / you are welcome.

christoph_bergemann
Active Contributor
0 Kudos

Dear Dharmin

check e.g.:

and

you will find a lot of useful tipps/tricks. Your topic/demand is quite "old"

C.B.

PS: e.g.

JuanCarlosDelga
Contributor
0 Kudos


Hi Dharmin,

In CG54 the"final" report is generated using your local WWI client, for this reason you can't run CG54 in background, there isn't communication with your local computer, the "final" report can't be generated.

You can download the documents that have been crated with WWI, RTF docs in DMS.

http://scn.sap.com/thread/3158119

Regards.

JCD

Former Member
0 Kudos

Hi Carlos,

The reports are exported to the (AL11) server in the form of two files, one key file and other the PDF one when done through CG54 through a user exit.

However no report is executed via BDC.

So, is it we cannot use a BDC or background session to export reports?

The requirement here is to eliminate manual use of CG54.

JuanCarlosDelga
Contributor
0 Kudos

Hi Dharmin,

First, you have the reports in "released" state, that means that the report exists as a DMS document (transaction CV03N - Document type SBE) but its format is RTF. But you are using CG54, this transaction use a template and the WWI client to generate a "final" report, that why doesn't work in background.

I guess your PDF file are being generated using CG54, and later exported to the server.

TRy to follow Christoph tips.

Regards.

JCD

christoph_bergemann
Active Contributor
0 Kudos

Dear Dharmin

there is an OSS note existing which states that BDC is not supported in EHS. So you will not succeed. Sorry.

Regarding Report Export in general. Please check SAP online help. You will find additional infos.

C.B.

christoph_bergemann
Active Contributor
0 Kudos

Dear Dharmin

as mentioned. your topic is discussed very often here (refer to the links in my answer). Generally you need first to write  down a good requirement. Then you need to look on the pitfalls as well. in report distribution normally only the next "major" version will be distributed; so here you need a customer specific solution as in most cass minor versions are of interes as well. Hints as provided by Anindya are helpful. But keep in mind: you have in most cases a "flexible" chapter one (content depends on in most cases sales organization); you have a lot of materials linked to REAL_SUB and a lot of released SDS reports. On the top on REAL_SUB level you might have WWI reports of type SDS and Inbound reports of type SDS. In most cases you need both documents in "export".

So in general CG54 is not a good option to start a "technical" solution. It is more related to user actions (the user can (if set up done) the requested report distribution by him/herself

C.B.

Former Member
0 Kudos

Hi Christoph,

Thanks for your reply.

I did went through some of the topics mentioned in the links.

However, everywhere i could see the use of CG54 transaction. But if BDC cannot be used, then how can this process be automated? I went thourgh the post regarding program RCVDCREO used for report export. But it didn't allow me to as everytime it gave me some error related to address number, which was entered as it was the only one shown.

So, can this report be used to schedule a background job to export the reports?

By export I mean to place the PDF generated files in the AL11 server.

Looking forward for your reply as this is totally new for me and struggling to understand the entire flow.

Thanks.

christoph_bergemann
Active Contributor
0 Kudos

Dear Dharmin

you still "misinterpret" the differenct scenarios. CG54 can be used "only" if you have some "static" approach (user action based interaction). In most cases this is not the "real "situation"

The report you mentioned is explained here:

Report Export by Program - Basic Data and Tools (EHS-BD) - SAP Library

This report is on most cases a good starting point; but it depends on your specific requirement.

According to my understandin: once again it is a "user" driven action; In most cases companies have "automized" thge whole process so that you need not to check Al11 etc.

If you do not have a good picture of report distribution then you will not succeed in finding a solution. Check e.g.

C.B.