Open Hub - Add header line to file on server.
Hi All,
How can I add header description to the file being generated in the server from the Open Hub. The open hub generates a fiule with data fields only, however i want a header line.
Example
IF my data fields are displayed as below,
John M 12 2344
Thomas M 17 8960
Lin F 10 8467
Jan M 12 4323
I need to add, description as NAME above John, Thomas, Lin etc.
as GENDER above M,M,F etc.
as CODE above 12, 17,10 etc. and
as EXTENTION above 2344, 8960,8467 etc
Can anyone help.
Points will be assigned
Hi,
i don't think this can be done even in BADI.
what you can do is once the Infospoke run is complete and the file generated , run a custom report for this.
in the custom report open a file dataset , write header and then close the file dataset.
then again open the file dataset in append mode , writhe the file that the infospoke generated and close the file dataset.
include this custom program after you infospoke run in the process chain.
Regards,
Neeraj.
Similar Messages
-
How to add header line in a file from XI system using file adapters
Hi All,
I need to add header line (Column names) in a file coming from XI system.
I am using file adapters.
Thanks & Regards,
Gaurav MittalThe Receiver File Adapter is configured, using the following settings:
1) Choose File Content Conversion as the Message Protocol.
2) You give the addHeaderLine parameter as 1
3) For the fieldSeparator parameter you need to give field separator for both list and substructure (referring to the data type above). For eg: it may be a , (comma) for substructure in a comma separated file.
4) The endSeparator parameter needs to given for substructure only. For eg: it may be a nl (new line)
5) Give the file name, the directory and the Construction mode. Activate all the settings. Receiver File Adapter with F.C.C. is configured.
please visit the blog.
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2 -
How to add header to a file in mapping
Hi,
I need to add header to a file , the header information i am getting is dynamic , it is an IP address of the m/c from where i received the file and keeps on changing.
Can we add this information in the header in mapping or there is any other way to acheive this.This IP is used to make a lookup at a latter stage for verification purpose.
Regards,
SRiHi Sri,
Write Java class or an ABAP class
in Java class or ABAP class write logic to find the first word or line
once you find that word in your incoming file, you need to replace with a string which has the static header+firstword what you have searched
for exmple
Incoming file
abcd
<abc>123</abc>
<def>321</def>
Your logic should find "abcd"
String Header = "http://www.sap.sdn.com"
String A = "abcd" (bcoz u kow u r searching for this word)
now concat A+Header and return the string
IF you are writing an ABAP or Java class include this in Interface Mapping
Hope this helps. -
Add header line to the text file in receiver file adapter
Hello Experts,
I have to add a new line to the text file generated at the receiver end.
My structure is
Record
Item......0-unbounded
field1
field2
field3
I have defined below parameters in receiver FCC.
RecordSet Structure : Record,Item
Item.fieldSeparator : ;
Record.fieldSeparator : nl
Record.endSeparator : '0x0D''0x0A' ( this is to get a carriage return at the end of the file)
Item.addHeaderLine : 1
With the above configuration, i am getting the desired output with NO header line.
Please help.
Thanks,
Swetha.Hi, it looks like that the headerline "specification is only permitted if exactly one structure is defined." Please check [SAP help under Define Parameters for Recordset Structures|http://help.sap.com/saphelp_nw73/helpdata/en/44/686e687f2a6d12e10000000a1553f6/frameset.htm].
One solution would be to generate the header fields in the message payload. Generate an additional first line containing the header names, e.g.
<Item>
<field1>Header1
<field2>Header2
<field3>Header3 -
Add Header Line tot he output File
Hi,
Proxy to File Senario.
Details records are coming through proxy.
I need to add a static header line in the file that is created..
The Header line is something Like this :- "SSN";"UPI";"EFF_DATE";"STATUS";"STATUS_ACTION_CD";"PAY_CONTINUATION";"LASTNAME";"FIRSTNAME";"MI";"NAME_SFX";"LOC_CODE";"EMP_CAT";"
The configuration that i did in Content Conversion:-
Recordset :- HEADER,ROOT
HEADER.addHeaderline : 1
HEADER.headerline : "SSN";"UPI";"EFF_DATE";"STATUS";"STATUS_ACTION_CD";"PAY_CONTINUATION";"LASTNAME";"FIRSTNAME";"MI";"NAME_SFX";"LOC_CODE";"EMP_CAT";"
ignoreRecordsetName : true
ROOT.fieldSeparator : ;
ROOT.endSeparator : 'nl'
<b>But the error in Communication channel monitoring is : -</b>
Conversion initialization failed: java.lang.Exception: java.lang.Exception: Error(s) in XML conversion parameters found: Parameter 'HEADER.fieldFixedLengths' or 'HEADER.fieldSeparator' is missing....
So Plz help me out in this.....
Thanks
HarpreetHi Harpreet,
You can pass the static header content in your message mapping ....to the target header field..
and then use a normal FCC to print out the structure...
Regards,
Sushil H. -
Can Open Hub create a fixed length file, not CSV?
I've been given a requirement to produce a file that is not a CSV file, but a file of a fixed length where all of the fields are always in the same positions.
For example, a material "batch" number can be of variable length. They want it to always appear on the file in positions 10-20, even if in some cases it is 10 digits and in other cases it is 4 digits. There should be spaces to fill in the remaining digits.
Can the Open Hub BADI be used to do this? It seems like it always wants to compress the data (so to speak) and stick a seperator in there and the BADI is not helping.
Thanks for your help!
Chris OrlandoSimplest: Use LJustify() or RJustify() on your lines of data.
EG:
<cfset FileLine = RJustify (LineOfText, 128)> -
How to send Million records using Open hub using into my own file server
hi
i am using OPEN HUB process to send 6 miilion record to my own network server. is there any limitaiton how i need to go about that? my process is failing when i execute DTP openhub. i am abel to send few records to sap aplication server.
did any body send more than million records to aplication server out side SAP ? how to achieve this. pelase help me out..
i am trying to send ods records into file serverI'm glad you solved your problem.
Generally it is nice to post how you solved your problem so that when others have a similar problem and search the archives, they can see your solution.
Thanks -
Add header line to excel sheet when using FM RH_START_EXCEL_WITH_DATA
Hi
I'm using FM RH_START_EXCEL_WITH_DATA to download an internal table to EXCEL. But when excel is started it's without a header line.
What I would like to do, is to take the field-names/field-text from the abap dictionary, and use them as the header line. How do I achieve this ?
Regards
Morten NielsenHi ,
See this sample code.
Tables : zacg_cca,zacg_exsh.
data: P_file like RLGRAP-FILENAME.
Data: Begin of it_header occurs 0,
Header(15) ,
end of it_header.
Data : begin of it_final occurs 0,
ccode type zacg_cca-ccode,
mat_cd type zacg_cca-mat_cd,
ingr_desc type zacg_cca-ingr_desc,
conc type zacg_cca-conc,
quantity type zacg_cca-quantity,
percqty type zacg_cca-percqty,
flag ,
APP_DATE type zacg_cca-app_date,
rsamnos type zacg_cca-rsamnos,
end of it_final.
SELECTION-SCREEN : BEGIN OF BLOCK blk WITH FRAME TITLE text-000.
select-options : s_Date for zacg_cca-app_date.
SELECTION-SCREEN : END OF BLOCK blk.
it_header-Header = 'Samp_code'.
Append it_header.
it_header-Header = 'Mat_code'.
Append it_header.
it_header-Header = 'Ingr_Desc'.
Append it_header.
it_header-Header = 'Conc'.
Append it_header.
it_header-Header = 'Quan'.
Append it_header.
it_header-Header = 'Perc'.
Append it_header.
it_header-Header = 'Flag'.
Append it_header.
it_header-Header = 'Date'.
Append it_header.
it_header-Header = 'Rsamnos'.
Append it_header.
it_header-Header = 'Mat_code'.
Append it_header.
select ccode
mat_cd
ingr_desc
conc
quantity
percqty
app_date
rsamnos
from zacg_cca into corresponding
fields of table
it_final where zacg_cca~app_date in s_date.
loop at it_final.
it_final-flag = 'T'.
modify it_final.
it_final-quantity = it_final-quantity * 2 .
Modify it_final.
endloop.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
FILE_NAME = 'E:\IT\P_FILE'
CREATE_PIVOT = 0
DATA_SHEET_NAME = ' '
PIVOT_SHEET_NAME = ' '
PASSWORD = ' '
PASSWORD_OPTION = 0
TABLES
PIVOT_FIELD_TAB =
DATA_TAB = it_final[]
FIELDNAMES = it_header[]
EXCEPTIONS
FILE_NOT_EXIST = 1
FILENAME_EXPECTED = 2
COMMUNICATION_ERROR = 3
OLE_OBJECT_METHOD_ERROR = 4
OLE_OBJECT_PROPERTY_ERROR = 5
INVALID_PIVOT_FIELDS = 6
DOWNLOAD_PROBLEM = 7
OTHERS = 8
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Regards
ABG -
I managed to solve the problem using solution in attachment, but it looks quite primitive...
Additional problem:
Suppose the case:
Acquisition 1 --> header and results are written in "results.lvm"
Acquisition 2 --> I want new data to be written in the same destination file "results.lvm" (append to the file). But I need the header to know when Acquisition 2 begins. Unfortunately, what happens is that new data are appended immediately after old data; header is updated at the top of the page and information on Acquisition 2 replaces that one on Acquisition 1.
Here is the reason because I need a more efficient header maker.
Attachments:
attachement.vi 15 KB
data5_h.lvm 1 KBI looked at the VI, and you should not think that it is bad. It works and there is nothing simplier you can do to format the header.
working simple solution=good solution
I think that you may want to reapproach writing the data to file. The customization you want in the saved file will require extensive recoding of several VIs. Have you considered just writing your own algorithm for recording data? It is not difficult to learn the basic techniques then you can modify it all you want. Look on the string palette and the shipping examples for writing text to file. -
Open Hub Header and Trailer Record.
Hi,
For the Open Hub Destination
Destination Type is File,
Application server.
Type of File Name: 2 Logical File name.
How to to the get the Header and Trailer Record which will contain Creation Date, Creation Time and Total number of records.
Header record Layput :
Creation Date (YYYYMMDD)
Creation Time (HHMMSS)
Total record Count
Trailer record Layout:
Total number of Records in the file and
XXXX( Key Figure ) Total.
Thanks in advance.
Regards,
Adhvi.Hi Venkat,
write a UDF in following way...
pass the first parameter as the detail node (cache the whole queue) to the UDF pass the second parameter as the trailer countto the UDF
now loop through the detail records get the count with a counter variable
check the counter against the trailer count outside the loop
if it doesnot match trigger the alert from the UDF itself
Check the below link for triggering alert from an UDF
/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function -
Open Hub - Header in flat file
Hi there Experts.
I am working with a opeb Hub destination, and so far everything has been straight forward.
But i need to include headers in the first line of the file.
By default the Open Hub i generating a Control File, so it is possible to look in this file, but the requirements from the customer is to have fieldnames inside the same file as the data.
Any help will be awarded.
IngridI have faced this. There is no delivered mechanism. One work around would be (after the extraction) to open the file using ABAP and paste the header. If one tries to figure (in the start routine or end routine) that this is the first record of the first package, one faces the problem with data types (header has a CHAR data types where the fields of the file may not all be CHAR). We eventually convinced the user to drop the requirement. As you mention, there are generated files with header information.
Not sure this helps. -
Add Header in File Content Conversion
Hi everyone,
I have simple scenario : RFC-->flat file, but I need to add header lines at the start of the file,
Anybody any idea?
ThanksHi ,
To add header fields to the file while File generation -
DATATYPE_NAME.addHeaderLine = 1
· 0 No header line
· 1 Header line with column names from the XML document
Nanda -
To create an header for Open Hub extract
Hi guys,
How do i get an header for an open hub extract for a CSV file, an header consisting of the field names technical or otherwise.
Thanks,
Your help will be greatly appreciatedhi,
Field definition
On the Field Definition tab page you define the properties of the fields that you want to transfer.
We recommend that you use a template as a basis when you create the open hub destination. The template should be the object from which you want to update the data. This ensures that all the fields of the template are available as fields for the open hub destination. You can edit the field list by removing or adding fields. You can also change the properties of these fields.
You have the following options for adding new fields:
● You enter field names and field properties, independent of a template.
● You select an InfoObject from the Template InfoObject column. The properties of the InfoObject are transferred into the rows.
● You choose Select Template Fields. A list of fields are available as fields for the open hub destination that are not contained in the current field list. You transfer a field to the field list by double-clicking on it. This allows you to transfer fields that had been deleted back into the field list.
If you want to define the properties of a field so that they are different from the properties of the template InfoObject, delete the template InfoObject entries for the corresponding field and change the properties of the field. If there is a reference to a template InfoObject, the field properties are always transferred from this InfoObject.
The file or database table that is generated from the open hub destination is made up of the fields and their properties and not the template InfoObjects of the fields.
If the template for the open hub destination is a DataSource, field SOURSYSTEM is automatically added to the field list with reference to InfoObject 0SOURSYSTEM. This field is required if data from heterogeneous source systems is being written to the same database table. The data transfer process inserts the source system ID that is relevant for the connected DataSource. You can delete this field if it is not needed.
If you have selected Database Table as the destination and Semantic Key as the property, the field list gets an additional column in which you can define the key fields for the semantic key.
In the Format column, you can specify whether you want to transfer the data in the internal or external format. For example, if you choose External Format here, leading zeros will be removed from a field that has an ALPHA conversion routine when the data is written to the file or database table.
Assign points if helpful
Cheers!!
Aparna -
Open hub error when generating file in application server
Hi, everyone.
I'm trying to execute an open hub destination that save the result as a file in the application server.
The issue is: in production environment we have two application servers, XYZ is the database server, and A01 is the application server. When I direct the open hub to save file in A01 all is working fine. But when I change to save to XYZ I´m getting the following error:
>>> Exception in Substep Start Update...
Message detail: Could not open file "path and file" on application server
Message no. RSBO214
When I use transaction AL11, I can see the file there in XYZ filesystem (with data and time correspondent to execution), but I can´t view the content and size looks like be zero.
Possible causes I already checked: authorization, disk space, SM21 logs.
We are in SAP BW 7.31 support package 6.
Any idea what could be the issue or where to look better?
Thanks and regards.
Henrique TeodoroHi, there.
Posting the resolution for this issue.
SAP support give directions that solved the problem. No matter in which server (XYZ or A01) I logon or start a process chains, the DTP job always runs in A01 server, and it causes an error since the directory doesn´t exist in server XYZ.
This occurs because DTP settings for background job was left blank. I follows these steps to solve the problem:
- open DTP
- go to "Settings for Batch Manager"
- in "Server/Host/Group on Which Additional Processes Should Run" I picked the desired server
- save
After that, no matter from where I start the open hub extraction, it always runs in specified server and saves the file accordingly.
Regards.
Henrique Teodoro -
Is it possible to export infoprovider data through open hub to an ASCII formatted file? How would we do that in BI 7.0?
Hi,
You can use TCode RSANWB to goto APD and u can export data from any infoprovider to Flat File .
Check this link on APD:
http://help.sap.com/saphelp_nw04/helpdata/en/49/7e960481916448b20134d471d36a6b/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/49/7e960481916448b20134d471d36a6b/frameset.htm
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/96939c07-0901-0010-bf94-ac8b347dd541
Rgds
SVU123
Maybe you are looking for
-
I got a new iphone 4s which was a replacement for my 4s that got wet abuot 2 months ago. I had the applecare people walk me thru setting up the new phone. I just noticed that almost all of my music is not showing up on my phone. How can I get my m
-
Hello guys! Does anybody have any idea if there is any way not to allow a certain currency in a purchase order? Regards, Ileana
-
Can we setup the transfer of 'objectives' from one appraisal to another?
Dear All, Is it possible to setup a policy to transfer the 'objectives' from one previously started/done appraisal to another newly created appraisal automatically on the creation, based on some criteria like following: - Transfer all non-achieved ob
-
App Server Halts during the execution !!! service-passthrough error 500
We have 1.4 JAVA Application hosted by SunOne Server 7 2004Q2UR5 The setup is that user will first get into sun web server which in turn will do pass through to App server to get /appweb/index.jsp page. We are getting into repeated situation where we
-
Crystal reports server 2008 VI questions
I aplogixze if I am asking many questions in the same thread. If so please let me know. and I'll create seperate threads. Questions with Crystal reports server 2008 VI 1. In my current VS2005 web application with CR 2008 developer I have done the fol