Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Applies to:

SAP Business Intelligence (BI).

Summary

Access the file created by Open Hub during run time.

Author:  

 Name: Prabhakar Kilaru 
Company:  IBM India Pvt Ltd  
Created on:    19-Aug-2011
Author(s) Bio SAP Technical Consultant.

Having 5 years of SAP Experience.

Content:

Need:

to access the file created by Open Hub:

Many times we may need to edit the file which OpenHub creates or we may need to create a new file based on the old file during run time.

The changes can be following:

1)       Addition of a header line which includes type of data, date, no. of records etc.

2)       Changing the format of data line which includes remove/add/modify some field’s data.

3)       Addition of a footer line.

This is not possible in standard SAP.

This can be achieved with the procedure explained in this document.

·        Solution

Procedure to edit the file created by Open Hub or to create a new data file based on the file created by OpenHub during run time:

New program should be created which will be added as a next step to openhub in the process chain.

Program Logic:

1)       Reading Background Job Runtime Data: Function Module “GET_JOB_RUNTIME_INFO” is used to get the run time data.

Import Parameters:

  • Job count of job
  • Job name of job
  • EVENTID
  • EVENTPARM

2)       Get Job header data of the read job: Function Module “BP_JOB_READ” is used to get the Job header data of the read job.

Export Parameters:

  • Job count of job
  • Job name of job

Import Parameters:

  • job_read_jobhead (Job header data)

3)       Get Log ID:

Retrieve data from Table ‘RSPCPROCESSLOG’ with the help of job details.

This will provide us the Log-ID of a Process Chain Run.

4)       Get DTP request with the help of LOG ID.

Retrieve data from Table ‘RSDDSTATDTP’. This will provide us Data Transfer Process Request.

5)       Get details of DTP Request.

Retrieve data from Table ‘RSDDSTATDTP’.

Here we will get the number of records transferred to file (LINESTRANSFERRED) and Name of the Data Target for a Data Transfer Process(TGT).

In this case Data Target field contains OpenHub name.

6)       Get File details for that OpenHub:

Retrieve data from Table ‘RSBFILE’.

      Now we get the file path.

      Some times we might get the logical file name from which we have to get path.  

      From those details we need to pick the latest file based on the timestamp.

7) Now we can edit the data of file or we can create a new file with that data.

·        Benefits        

1)      Access the file created by Open Hub during run time.

2)      Add header and footer details in the file. This will be helpful for the people or 3rd party system which uses that.

3)      Change the format of the file as per the requirement.

4)      Send alerts about the file.

Useful Information

access the file created by Open Hub