File Adapter problem for Fixed Length output file
Hi There!,
The following is my sample data format
ABCD 2345 03Accounting Swissland
ABCD 011234 1000Jack Gates 400000 03
ABCD 021234 1001Bill Welch 400000 03
In the first record has dept details:
DummyText, Row identifier(not given in case of dept), Identifier, Deptno, Deptname, Location
The second and third records are emp details:
DummyText,Row identifier, Identifier,EmptNo,Emp Name, Manager, Salary, Deptno.
Notice that the primary key is defined by the first three columns DummyText, Row identifier, Identifier.
When I use Native Format Builder from File Adapter and scan the first three columns I get all three records (i.e dept and both employees). I deleted the second employee and proceeded to finish the configuration. But, the problem I face is that the key value shows as "ABCD% 011234" for both the employee records where as I would like it to show as "ABCD 011234" for the first record and "ABCD 021234" for the second record.
How do I get around this problem?
Moreover if I have a group or recurring records and not just one record recurring. I mean assuming I have the following:
First row: Department
Second row: Employee
Thrid row: Manager
Fourth row: Employee
Fifth row: Manager
How do I get this done?
Does anyone have an idea where to find details of nxsd.
Thanks in Advance.
Hi Manoj
Give the FCC parameter as
RecordSet Structure = Header,,Detaillnes,,Detaillines2,*
Header.endSeparator = 'nl'
Header.fieldFixedLengths = field length
Header.fieldFixedLengthType = char/byte
Header.fieldNames = field1,field2,field3,.....
Header.keyFieldValue = Header
Detaillnes.endSeparator = 'nl'
Detaillnes.fieldFixedLengths = field length
Detaillnes.fieldFixedLengthType = char/byte
Detaillnes.fieldNames = field1,field2,field3,.....
Detaillnes.keyFieldValue = Detaillnes
Detaillines2.endSeparator = 'nl'
Detaillines2.fieldFixedLengths = field length
Detaillines2.fieldFixedLengthType = char/byte
Detaillines2.fieldNames = field1,field2,field3,.....
Detaillines2.keyFieldValue = Detaillines2
The keyFieldValue should be the Value which identifies your record either as Header/Detaillines/Detaillnes2.
Regards
Santhosh
Message was edited by:
Santhosh Kumar V
Similar Messages
-
File Content conversion for Fiexed length output file
Hi,
I am Working on Idoc to File scenario.
I would like to know the content conversion partmenrts for the follwoing structure.
Structrure is as below:
Message Type
Header Record 1..unbounded
. Field1 0...1
. Field2 0...1
. Field3 0...1
.. Detaillines 0...unbounded
... Field3 0..1
... Field4 0..1
.. Detaillines2 0..unbounded
... Field6 0...1
... Field7 0...1
Can you please advise.
Regards,
Manoj KumarHi Manoj
Give the FCC parameter as
RecordSet Structure = Header,,Detaillnes,,Detaillines2,*
Header.endSeparator = 'nl'
Header.fieldFixedLengths = field length
Header.fieldFixedLengthType = char/byte
Header.fieldNames = field1,field2,field3,.....
Header.keyFieldValue = Header
Detaillnes.endSeparator = 'nl'
Detaillnes.fieldFixedLengths = field length
Detaillnes.fieldFixedLengthType = char/byte
Detaillnes.fieldNames = field1,field2,field3,.....
Detaillnes.keyFieldValue = Detaillnes
Detaillines2.endSeparator = 'nl'
Detaillines2.fieldFixedLengths = field length
Detaillines2.fieldFixedLengthType = char/byte
Detaillines2.fieldNames = field1,field2,field3,.....
Detaillines2.keyFieldValue = Detaillines2
The keyFieldValue should be the Value which identifies your record either as Header/Detaillines/Detaillnes2.
Regards
Santhosh
Message was edited by:
Santhosh Kumar V -
Configuring unicode charcterset for fixed length control file
Hi all,
we are setting our control file to support any language characters while data loading, we all set with our database configuration , need to configure our control file which is fixed length, we are using CHARACTERSET UTF8 and and also tried with CHARACTERSET AL32UTF16, its working fine for variable length control file but for fixed length the foriegn charecers like latin-I,greek, danish charactrers are taking more byte and affecting to next position data. and our data file is in UTF8 (not in regular ANSI formatt).
please advise
here is our control file example:
options (errors=999,SKIP=0)
Load DATA
CHARACTERSET UTF8
append
INTO TABLE TABLE_NAME
TRAILING NULLCOLS
field_name1 position(1:30) "trim(:fiels_name1)",
field_name2 position(247:306) "trim(:field_name2)",
)I think you should move thread to: {forum:id=732}.
-
Gui_download issue - trailing spaces getting truncated for fixed length fil
Hi All,
I have a requirement where I need to download an internal table as a fixed length file.
The code is as follows:
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = L_FILE
FILETYPE = 'ASC'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = ' '
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = IT_TEXT
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
Each row in the internal table IT_TEXT is 242 chars long.
The FM is truncatinf the trailing blanks on the file. How do I get the FM to not truncate the trailing blanks in each row?
My internal table has multiple rows and the number of rows on the table should be same as the number of rows on the downloaded file.
I tried setting the WRITE_LF parameter to space.
In this case, the trailing spaces are not truncated(which is as per my requirement), BUT all the rows in the internal table appear in a single line on the downloaded file instead of multiple rows.
I also tried setting the TRUNC_TRAILING_BLANKS field to space but that does not work either. Spaces at the end of the row are still truncated.
so the requirement is: the spaces at the end of each row should not be truncated and
each row on the internal table should have a corresponding row on the downloaded file.
(it is a fixed length file)
I also tried using the following code
class cl_abap_char_utilities definition load.
DATA: BEGIN OF IT_TEXT OCCURS 0,
TEXT(242) TYPE C,
cr_lf TYPE c VALUE cl_abap_char_utilities=>cr_lf,
END OF IT_TEXT.
when i compile, i get the following error
The type "CL_ABAP_CHAR_UTILITIES" is unknown.
Im using R/3 4.6C. Could this be a problem?
Please suggest a solution for this problem.
Thanks!
Sandeep
Edited by: sandeep reddy on Jul 25, 2008 7:16 PMHi,
Try this..This worked..Add a dummy character at the end of the internal table...Then pass trunc_trailing_blanks = ' '...
PARAMETERS: p_file TYPE rlgrap-filename
DEFAULT 'c:\test_download.txt'.
DATA: BEGIN OF s_data,
data TYPE char10,
dummy, " Added this.
END OF s_data.
DATA: t_data LIKE TABLE OF s_data.
s_data-data = 'Test'.
APPEND s_data TO t_data.
s_data-data = 'Test2'.
APPEND s_data TO t_data.
s_data-data = 'Test3'.
APPEND s_data TO t_data.
s_data-data = 'Test4'.
APPEND s_data TO t_data.
* Download.
DATA: v_file TYPE string.
v_file = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_file
trunc_trailing_blanks = ' '
TABLES
data_tab = t_data
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
Thanks
Naren -
How to create Fixed Length Flat File from Open Hub in BI 7.0
My requirement is to produce a Fixed length Flat file by Open Hub destination. My Open Hub has four fields. Now the requirement is to create another extra field in Open Hub which will contain all of the four fields value. In addition to that the fields should be fixed length that means if for any field no value is there and the field length/type is CHAR4 then 4 spaces should be there as the field value. SO, basically the Open Hub output will be single field which will contain information of four fields.
How to get this using End Routine of Transformation (from DSO to Open Hub) ?Hi,
You can map the four input fields to the new field in the Open Hub, and change rule type to "Routine".
For example, if your source fields are called "first", "second", "third" and "forth", the ABAP routine could be similar to:
DATA: l_t_1 TYPE C LENGTH 4,
l_t_2 TYPE C LENGTH 4,
l_t_3 TYPE C LENGTH 4,
l_t_4 TYPE C LENGTH 4.
IF source_fields-first IS INITIAL.
l_t_1 = ' '.
else.
MOVE source_fields-first TO l_t_1.
endif.
IF source_fields-second IS INITIAL.
l_t_2 = ' '.
else.
MOVE source_fields-second TO l_t_2.
endif.
IF source_fields-third IS INITIAL.
l_t_3 = ' '.
else.
MOVE source_fields-third TO l_t_3.
endif.
IF source_fields-forth IS INITIAL.
l_t_4 = ' '.
else.
MOVE source_fields-forth TO l_t_4.
endif.
CONCATENATE l_t_1 l_t_2 l_t_3 l_t_4 into result.
In the example, the program uses four blank spaces if any of the fields has no value.
Additionally, if non-initial values in input fields could be shorter than 4 characters (if the input fields have no fixed length), you could use STRLEN to evaluate if it is necessary to add blank spaces to complete the fixed length of 4.
I hope this helps you.
Regards,
Maximiliano -
File Adapter-Problem Reading Huge Files
Hi,
Here is the issue that i am facing
When reading huge file(csv file upto 6MB-8MB) the communication channel configured as File Adapter with a polling interval of 7 min(420 sec) is inconsistent in reading the complete file.Sometimes it reads the the complete file of 6 MB and sometimes it reads a part of the file say 3MB/6MB.Can this inconsistent behaviour be resolved.??
Your suggestions highly appreciated.
Regards
PradeepHi Pradeep !
8mb is not a huge file for XI, I think it is a small one. Maybe your problem is not the size..please check if XI is not starting to read the file before it is completely written to the source folder. If you are creating that csv file from another application directly to the poll source directory of the XI scenario specified in the file adapter, and your poll interval is small, XI could start reading the file while you are still writing it. If this is the case, try to put the file with a different extension or filename than the specified in file adapter comm channel and when the file is completely written, rename it to its final filename and check if you are still having that misbehavior.
You can write the file to a temp directory and the move it to the XI directory once finished.
Regards,
Matias. -
Conversion of fixed length flat files to oracle table
hello friends
Please help me getting the code for conversion of fixed length flat files to oracle table
Should the tables be pre-defined ?????
In this case the de-limiters are variable length spaces and not commas.Please help me with the same
Regards,
-MaheshYou can use SQL*Loader to load fixed-width files into Oracle. Instructions on writing appropriate control files are in the Oracle Utilities manual
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch03.htm#1004687
You can also use external tables, assuming you're using 9i or later (the syntax for external table definitions is nearly identical to the syntax for SQL*Loader control files).
You'll need to create a table definition in Oracle. You can either create a "normal" table and use SQL*Loader to populate it or you can create an external table definition.
Justin -
I am working on creating a fixed length flat file with data from multiple files.
This flat file will have 4 different record formats.
My idea is to create a table for each one of these record formats, populate it in my PL/SQL program and utilize the [DUMP_CSV|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:95212348059] procedure to then select from each of these tables. My idea is that if the record format changes it could be as simple as altering the table, and recompiling the program. Suggestions/comments on my approach?
ThanksUse External Tables. By that you can even skip the PL/SQL code that you may need to write if you use normal table to load them.
-
Sender File Adapter Problem when text document is a single line.
Hi All,
I have posted this question earlier too. But did not get a proper answer.
I am using File adapter to fetch data from a file system.
My input data is: AA123BB45678AA345BB78564.
It is just reading the first segment i.e.AA123 and not reading the remaining.
How can I configure my Sender File adapter to pick this pattern of data? It works fine if I have line break after each record that is if the input is as below.
AA123
BB45678
AA345
BB78564
In the above there is a Line break after each segment. So File adapter picks it fine.
I have also tried using xml.A.endSeparator equals to blank in the module configuration. But it does not work either.
Can anyone throw some light to this?Abhi
I tried a different approach to send your file data In..
You can get each line in the source structure in separate row as
<?xml version="1.0" encoding="utf-8" ?>
- <ns:SingleRowDT xmlns:ns="http://xxxxx.com/xi/pocs/sriram">
- <Recordset>
- <row>
<rowElt>AA123BB45678AA345BB78564</rowElt>
</row>
- <row>
<rowElt>AA123BB45678AA345BB78564AA123BB45678AA345BB78564</rowElt>
</row>
- <row>
<rowElt>AA123BB45678AA345BB78564AA123BB45678AA345BB78564AA123BB45678AA345BB78564</rowElt>
</row>
</Recordset>
Now you can use a suitable mapping logic to split the individual records into the 2 field structure as expected in the target..
Trying your way would be a limitation on file adapter I think..Let me know if this helps..I can give you the content conversion config for this model..
its simply
RecordSet - Leave it empty
RecordSet Seq - Row, *
Recordsets/msg - *
row.fieldSeparator - 'nl'
row.endSeparator - 'nl'
row.fieldNames - 'rowElt
..So each line will be pulled into a single Row in the source structure and then u can apply a specific mapping to split into 2 fields for your target
Regards
Sriram V.
Regards
Sriram V. -
Exporting Crystal .rpt to a fixed length text file
Post Author: jnesbitt
CA Forum: Exporting
I am attempting to write a Crystal report that formats data to be exported to a fixed length text file. Each record will be made up of a number of fields with specific start locations and lengths. Is there any way to set the field start position and field length. I've been able to adjust the character per inch text export parameter to get close, but I can't update the paramete any longer.
How can I reset the "Characters per inch" text export parameter?
Version: Crystal 9.2Hi Jakob
Take a look a this
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94353
Regards
DV -
Download data to Fixed Length Text File
Can anyone share the sample code on how to download data into fixed length text file and place the file in the server directory?
One way i would advice is to declare a text variable and move values using offset.
Eg:
move: <struc>-fld1 to l_text(8),
<struc>-fld2 to l_text+8(3),
<struc>-fld3 to l_text+11(15).
transfer l_text to <file>.
Try this approch and see the result.
Kind Regards
Eswar -
XI 3.0 PROXY/ File adapter problem
We have XI 3.0. We used the proxy to send a file from R3 to XI and used file adapter in XI to put the file back to R3 file server.
From the SXMB_MONI in R3, the message was successfully sent from R3 to XI.
From the SXMB_MONI in XI, the URL address https://aaaa###.com:52201/MessagingSystem/receive/AFW/XI (the SAI_AE_DETAILS_GET returned) had the SSL service number(port number 52201) that I do not know where it was defined. I checked the communication channel and SM59 but found out nothing about 52201, neither the SSL part.
Would some one please tell me where the SSL security was defined?
Thanks for your help in advance!Satish,
I checked the communication channel in the Configuration and the the transport protocol was "File System(NFS). We did not use FTP.
Thanks!
Fisher -
Can someone tell me why my message is not processed by XI. I use a File Adapter. The File Adapter is "active" with the following configuration.
Adapter type = File
transport protocal = Filesystem
message protocol = File
adapter engine = integration server
Source directory = "e:/XIprocessFiles"
File name = *.xml
File type = textEdward,
What do you exactly meant with not processed? Is the file adapter not processing/sending your xml file to the XI system? Or
is your interface defined in XI not doing anything with the input message?
Assuming your situation is the first one; Then you should start by checking the source file name, source directory name, contentType (you have text, this should be text/xml), ContentKind (this should be T) and PollingInterval...
In the second situation you should then look at adapter config settings like: namespace, sender interface name, sender business name etc...
Cheers,
Rob -
File Adapter: Is it possible to track files?
Hello XI community,
I've a scenario where the sender and receiver is the file adapter using NFS. When XI picks up the inbound file from a certain directory with a wildcard name like "T_xxx*" is there any chance to see the original name? In addition I'd like to know how to find out the relationship between the inbound filename and the outbound name which is actually created from the file adapter like "xxxxx_timestamp.xxx". The files I'm using are binaries so I don't use the file content in anyway. They are just passed through XI. But I'd like to track the files to be able to know which input file belongs to which output file. Maybe some of you know where to see this.
Thanks in advance
/MichaelHi once emore:
take a look at this document:
https://websmp201.sap-ag.de/nw-howtoguides
-> exchange infrastructure -> how to Create Modules for the J2EE Adapter Engine
it may help you:)
Regards,
michal -
how to define a schema for fixed length consisting of multiple records of different types having header detail and footer at positions 22 and 23 namely having 10 for header ,20 for detail and 30 for footer.
here is the sample file
DDWTYBILL13092502572 1000000112\\NHLSFS\ORACLE\ORACLE\BILLING\VERIFY\ 2013/09/25 01:19:08 BILLEND
DDWTYBILL13092502572 2000000212PRIVATE PRIVATE STY5572142 010700 INV 12STYD000789 02-AUG-20130000010472 STY STY 1100611006MGIT 91 NNM DIMPHANA,CN,CELESTE NERINA 09-JAN-1964 TYG A2 DR DU PREEZ 5602181 63301345 TB731543 Suspect TB ?CA, (L) EMPIEEM Ward A2 TYGERBERG HOSPITAL Z03.0 Z03.9 05-AUG-201305-AUG-201324-SEP-2013FEND 113.60
DDWTYBILL13092502572 2000000312PRIVATE PRIVATE STY5572149 010700 INV 12STYD000789 02-AUG-20130000010472 STY STY 1100611006MGIT 91 NNM DIMPHANA,CN,CELESTE NERINA 09-JAN-1964 TYG A2 DR DU PREEZ 5602181 63301345 TB731548 Empyema BPF Ward A2 TYGERBERG HOSPITAL Z03.9 Z03.9 05-AUG-201305-AUG-201324-SEP-2013FEND 113.60
DDWTYBILL13092502572 2000000412PRIVATE PRIVATE STY5572351 010700 INV 12STYD000789 02-AUG-20130000010472 STY STY 1100611006MGIT 91 NNM DIMPHANA,CN,CELESTE NERINA 09-JAN-1964 TYG A2 DR DU PREEZ 5602181 63301345 TB731584 Suspect TB ?EMPIEEM, ?CA Ward A2 TYGERBERG HOSPITAL Z03.0 Z03.9 05-AUG-201305-AUG-201324-SEP-2013FEND 113.60
DDWTYBILL13092502572 2000000512PRIVATE PRIVATE STY5572352 010700 INV 12STYD000789 02-AUG-20130000010472 STY STY 1100611006MGIT 91 NNM DIMPHANA,CN,CELESTE NERINA 09-JAN-1964 TYG A2 DR DU PREEZ 5602181 63301345 TB731585 Suspect TB ?EMPIEEM, ?CA Ward A2 TYGERBERG HOSPITAL Z03.0 Z03.9 05-AUG-201305-AUG-201324-SEP-2013FEND 113.60
DDWTYBILL13092502572 2000000612MAJOR MAJOR STY5577530 010700 INV 12ZTYG000009 02-AUG-20130000010472 STY STY 1100611006MGIT 91 NNS ZOZI,S,SIYAMBONGA 27-MAR-2010 TYG D3 DR MAHOMED 5602181 113799662 TB731663 Lymphadenitis Ward D3 TYGERBERG HOSPITAL I88.9 Z03.9 H1 07-AUG-201307-AUG-201324-SEP-2013MEND 58.52
DDWTYBILL13092502572 2000000712MAJOR MAJOR STY5577537 010700 INV 12ZTYG000009 06-AUG-20130000010472 STY STY 1100611006MGIT 91 NNS DLAMINI,N,NTLANTLA 09-OCT-1976 TYG F1 DR WZESE 5602181 135524676 TB731666 Suspect TB Ward F1 TYGERBERG HOSPITAL Z03.0 Z03.9 H1 07-AUG-201314-AUG-201324-SEP-2013MEND 58.52
DDWTYBILL13092502572 30003034120000003032ENDYou can create an nXSD using Native Format Builder and use lookAhead attribute to read values at specific position and use that as the choice. You can find an example here
http://docs.oracle.com/cd/E11036_01/integrate.1013/b28994/nfb.htm#BGBBAJFD
Maybe you are looking for
-
My iPod Touch is hanging. I tried to reset it, but as soon as it finished starting up it goes back to streaming. The battery is very hot and there is no option for me to turn it off. Any information would be appreciated
-
Help with buying used printer, please!
I have 5 - 15AHP Laserjet Print Cartridges (my sister closed her office) ..... I have a LaserJet 4000 and the 15A doesn't fit of course. I am thinking of buying a used printer so I could use these cartridges. 15A fits HP Laserjet 1000; 1005; 1200;
-
CRS 10.0.2 Error
Hi I have installed CRS 10.0.3 , set up was successful without error, But when I am starting server, getting errors. Environment : Weblogic 10.3.5 ATG 10.0.3 JDK 1.6.0_24 SQL server 2008 / MySql 5 (tried both ) log : Thu Dec 22 09:23:16 IST 2011 1324
-
Need help with Safari auto fill.
Auto fill problems. 1. It's spotty in its application. On some pages it works fine and fills in all fields with one click. On others it says "can't complete form", but then as I begin typing each field, it gives me fill in options. Why can't it just
-
Can you export to a Bluetooth device?
I wonder if it possible to export pictures to a mobile phone via bluetooth.