How to include headers in an Open Hub Destination
Determine the data source for the Open Hub
Define the Open Hub Destination
In the Destination tab Define the properties for the Open Hub, such as the server and file name, as well as the format
In the Field Definition tab, include the field names for the Open Hub Destination
Create the corresponding Transformation
Map each InfoObject to their corresponding field
It is possible to add regular formulas
Use the End Routine to define the name for the fields in the Open Hub, but consider a counter only for the first line.
Execute the DTP
Once the Data Transfer is complete, the file is generated and it can be viewed through AL11
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_rs–account =‘ACCOUNT’.
wa_rs–flow =‘FLOW’.
wa_rs–cat_code =‘CAT_CODE’.
wa_rs–company =‘COMPANY’.
wa_rs–currency =‘CURRENCY’.
wa_rs–data_source =‘DATA_SOURCE’.
wa_rs–interco =‘INTERCO’.
wa_rs–profit_center =‘PROFIT_CENTER’.
wa_rs–ri_code =‘RI_CODE’.
wa_rs–scenario =‘SCENARIO’.
wa_rs–scope =‘SCOPE’.
wa_rs–time =‘TIME’.
wa_rs–signeddata =‘SIGNEDDATA’.
wa_rs–createdate =‘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 *-*
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:
Thanks your tip solved my issue 🙂
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.
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.
How to do with key figures header, can't put string over numeric values?
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.
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.