Skip to Content
Author's profile photo Former Member

How to include headers in an Open Hub Destination

Determine the data source for the Open Hub

/wp-content/uploads/2014/05/openhubheader01_452254.png

Define the Open Hub Destination

/wp-content/uploads/2014/05/openhubheader02_452291.png

In the Destination tab Define the properties for the Open Hub, such as the server and file name, as well as the format

/wp-content/uploads/2014/05/openhubheader03_452292.png

In the Field Definition tab, include the field names for the Open Hub Destination

/wp-content/uploads/2014/05/openhubheader04_452293.png

 

Create the corresponding Transformation

/wp-content/uploads/2014/05/openhubheader05_452294.png

Map each InfoObject to their corresponding field

/wp-content/uploads/2014/05/openhubheader06_452295.png

It is possible to add regular formulas

/wp-content/uploads/2014/05/openhubheader07_452296.png

Use the End Routine to define the name for the fields in the Open Hub, but consider a counter only for the first line.

/wp-content/uploads/2014/05/openhubheader08_452297.png

Execute the DTP

/wp-content/uploads/2014/05/openhubheader09_452298.png

Once the Data Transfer is complete, the file is generated and it can be viewed through AL11

/wp-content/uploads/2014/05/openhubheader10_452299.png

ABAP Routine

*$*$ begin of routine – insert your code only below this line        *-*

“insert your code here

   DATA: t_rs TYPE TABLE OF _ty_s_TG_1,
          wa_rs TYPE _ty_s_TG_1.

wa_rsaccount =‘ACCOUNT’.
wa_rsflow =‘FLOW’.
wa_rscat_code =‘CAT_CODE’.
wa_rscompany =‘COMPANY’.
wa_rscurrency =‘CURRENCY’.
wa_rsdata_source =‘DATA_SOURCE’.
wa_rsinterco =‘INTERCO’.
wa_rsprofit_center =‘PROFIT_CENTER’.
wa_rsri_code =‘RI_CODE’.
wa_rsscenario =‘SCENARIO’.
wa_rsscope =‘SCOPE’.
wa_rstime =‘TIME’.
wa_rssigneddata =‘SIGNEDDATA’.
wa_rscreatedate =‘CREATEDATE’.

ZCOUNTER = ZCOUNTER + 1.
IF ZCOUNTER = 1.
  APPEND wa_rs TO t_rs.
ENDIF.
LOOP AT RESULT_PACKAGE INTO wa_rs.
  APPEND wa_rs TO t_rs.
  DELETE RESULT_PACKAGE.
ENDLOOP.

RESULT_PACKAGE[] = t_rs[].

*$*$ end of routine – insert your code only before this line         *-*

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Donnie Burhan
      Donnie Burhan

      Hi,

      In case that the result package is greater than one, then we need to make sure that the header line will only showing on the first data package, and not showing for the subsequent data package:

      If datapackid = '000001'
      
      //Insert your code here.
      
      Endif.

       

      Author's profile photo Lakshmikanth Adharapurapu
      Lakshmikanth Adharapurapu

      Thanks your tip solved my issue ­čÖé

      Author's profile photo Former Member
      Former Member

      Hi Cesar and Donnie,

      Just want to ask some inquiries. Does ZCOUNTER part of the declaration? And error alwasys occur when wa_rs-xxxx is input, there is a syntax error that stating, it should be "wa_rs-" and not ''wa_rs-xx". thank you for your kind help.

      Author's profile photo Jay Roble
      Jay Roble

      I created an ASUG EDW Enhancement Request.

      BW Open Hub Destination - Add Option Create ONE CSV file with header row

      Take a look at it, comment if you wish, there is a detailed attachment with screen shots.

      Vote if you like, Only one vote per company.

      Author's profile photo Gilberto Jose Hernandez Mendoza
      Gilberto Jose Hernandez Mendoza

      How to do with key figures header, can't put string over numeric values?

      Author's profile photo Do Hai Dang Le
      Do Hai Dang Le

      It would do it in a different way.

      For every DSO that need to be exported, I create a Field-based DSO with all fields defined as CHAR, which I call a landing zone for export. Then I will write 1:1 all values of the original DSO to the landing zone DSO and export the value from that to an OpenHub.

      Since all fields are CHAR, you can write anything you want to the fields.

      Author's profile photo SAP BASIS
      SAP BASIS

      It is not working in case of key figures e.g. Quantity with data type Quan and decimal precision 2.

      If you can help how to resolve to populate header for key figures.