File sequence number in a Flat file
Hi,
I am working on Idoc to file scenario wherein my output file will have a sequence number assigned to each level.
there are 4 levels and hence 4 sequence number to be genearted and its values should also have the same sequence number.
i am doing this just by using Counter function.
But when i am getting a multiple detail records, for each detail record(0040) level its keep incrementing.but it should have the same value what its level has.
for ex:
ALPHAMER AS2 E5 710 20114806124829 01.00
0000 00000000 20100102 V3.0 SORD CZ1
0010 00000001 76767 123 100 WER Constant BNG 560011 RAJ WERR 560011 BTM X EN RT
0020 00000001 TYUIOP
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000002 8765 6532 200 45 10 WE 20 AG
0040 00000003 8765 6532 200 45 10 WE 20 AG
0040 00000004 8765 6532 200 45 10 WE 20 AG
9999 99999999
It has to be like this.
ALPHAMER AS2 E5 710 20114806124829 01.00
0000 00000000 20100102 V3.0 SORD CZ1
0010 00000001 76767 123 100 WER Constant BNG 560011 RAJ WERR 560011 BTM X EN RT
0020 00000001 TYUIOP
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000001 8765 6532 200 45 10 WE 20 AG
0040 00000001 8765 6532 200 45 10 WE 20 AG
9999 99999999
Can someone help me in achieving this.
Regards
Hi there,
Just to try out from a different view, the following case could be implemented if the pre-requiisites are satisfied:
Pre-requisites:
1) The element that carries a primary factor, let us say, '8765' from your example.
2) Functionally there is an element in your header item that relates the line items under it.
My understanding of your example:
1) Line items present for 00, 10, 40
2) Line item 30 absent in the series
Proposal:
Map source field (the one that is arelating factor, here the one that carries '8765') -> INDEX (start by 0, increment by 1) -> multiply by one.
INDEX standard function property: Donot Reset for every context;
Srikanth Srinivasan
Edited by: Srikanth Srinivasan on Jan 10, 2011 11:02 AM
Similar Messages
-
File record number in a Flat file
Hi Guys,
I am working on Idoc to file scenario and generating a file at the target.
at the file...for each line i have to add a line count.
i have 2 header and 5 detail records set..and details are repeating multiple times.
For Ex:
H1........001
H2....002
D1------003
D2----
004
D3----
005
D4-------006
D5----
007
Footer-----008
Could someone help me in resolving this issue?
Thanks
sahilHi Sahil,
You can write UDF as follow
AbstractTrace trace= (AbstractTrace)container.getTrace();
GlobalContainer globalContainer = container.getGlobalContainer();
String str = (String) globalContainer.getParameter ("COUNTER");
if(str!=null){
int tempRowCounter =(new Integer (str)).intValue();
globalContainer.setParameter("COUNTER",tempRowCounter++);
return tempRowCounter+"";
}else{
globalContainer.setParameter("COUNTER", "1");
return "1";
Regards
Ritu -
Our requirement is to generate file sequence number using FTP adaptor so that we acheive the following pattern
for eg.,
VAP001.xml
VAP002.xml
VAP003.xml
VAP010.xml
VAP011.xml
i.e., the sequence number will be a fixed length and it should be lpadded with zeroes.
We tried to the following
VAP%SEQ%.xml
then BPEL generated as
VAP1.xml
VAP2.xml
VAP10.xml
We also tried this i.e.,
VAP00%SEQ%.xml
bpel generated
VAP001.xml
VAP002.xml
VAP0010.xml
Pls guide us with a solution. THis is very urgent and important for our business.
RegardsOur requirement is to generate file sequence number using FTP adaptor so that we acheive the following pattern
for eg.,
VAP001.xml
VAP002.xml
VAP003.xml
VAP010.xml
VAP011.xml
i.e., the sequence number will be a fixed length and it should be lpadded with zeroes.
We tried to the following
VAP%SEQ%.xml
then BPEL generated as
VAP1.xml
VAP2.xml
VAP10.xml
We also tried this i.e.,
VAP00%SEQ%.xml
bpel generated
VAP001.xml
VAP002.xml
VAP0010.xml
Pls guide us with a solution. THis is very urgent and important for our business.
Regards -
hi
for 0amount field i am getting data in excel like
-535.905.031.022.492
-111.801.379.067.257
433.124.355.469.709
-0.405316272683086
-0.378415176841429
-0.404278225058806
this allignmnet will be fine or we need code required all will be in proper allignmentHi,
select the entire column of 0AMOUNT in flate file ->Rt. Click->format cells->select number->uncheck Use 1000 seperators (,)
Hope this helps...
Rgs,
Ravikanth. -
Sequence number problem in control file
hI,
I have table called mast_route which contains route,seq_no fields.
I need to load the data using sql loader.while loading i have to reset the sequence based on the route.
that means whenevr a different route is encountered the sequence number should be set 1.
I have to load the data as shown below.
ROUTE SEQ_NO
10B, 1
10B, 2
10B, 3
10B, 4
10B, 5
10B, 6
10B, 7
10B, 8
10B, 9
10B, 1
10B, 1
10B, 1
10B, 1
10B, 1
10B, 1
10B, 1
10C, 1
10C, 2
10C, 3
10C, 4
10C, 5
10C, 6
10C, 7
10C, 8
10C, 9
10C, 1
10D, 1
10D, 2
I used the following loader script,but its not working
load data
infile 'routedest_master.csv'
append into table mast_route
fields terminated by "," optionally enclosed by '"'
TRAILING NULLCOLS
( route,
seq_no ?? here i need to insert the sequence number based on route ,
any idea pls
cheers
RRKhi,
I have another field called "Destination" in my table.
under one route there may be several destinations.
Here the sequence number indicates the unique destination number under a route.
the sample data looks as follws.
ROUTE, DEST, SEQ_NO
10B, 204, 1
10B, 223, 2
10B, 242, 3
10B, 290, 4
10B, 303, 5
10B, 513, 6
10B, 521, 7
10B, 539, 8
10B, 577, 9
10B, 60,1 0
10B, 626, 11
10B, 725, 12
10B, 839, 13
10C, 1011, 1
10C, 369, 2
10C, 377, 3
10C, 384, 4
10C, 388, 5
10C, 56, 6
10C, 689, 7
10C, 87, 8
10C, 888, 9
10D, 354, 1
10D, 360, 2
10D, 398, 3
10D, 495, 4
10D, 501, 5
10D, 66, 6
10D, 66, 7
10D, 765, 8
10D, 765, 9
10D, 837, 10
10D, 899, 11
10D, 906, 12
10E, 205, 1
10E, 306 2
10E, 34, 3
10E, 348 ,4
I guess ,now u can understand the prob.
cheers
RRK -
IDoc to File - IDoc number : Variable substitution in File Adapter
Hi,
I have an IDoc to File scenario. I want to use the IDoc Number as part of the target filename (using variable substitution) in the File Adapter. However, the target flat file does not have a field where I can store the IDOC number. I know the IDoc number is also stored in the message header ( under the IdocInbound tab), but is there any way I can access this in the variable substitution?
Failing this, if I have the Idoc number in the target XML, is there any way I can skip it in the flat file generated?
example...
XML looks like this...
<Root>
<Record>
<IdocNum>99999</IdocNum>
<HeaderRecord>
</HeaderRecord>
<LineRecord>
</LineRecord>
<LineRecord>
</LineRecord>
</Record>
</Root>
But the flat file should be..
HeaderRecord...
LineRecord...
LineRecord...
Cheers
ManishHi Chandra,
Thanks for this
But this is standard stuff that is detailed in SAP help files (http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm)
What I was looking for was in Sravya's blog (refer the earlier entry).
Thanks anyway
Cheers
Manish -
File Content Conversion i.e Flat file 2 Flat file
Hi guys,
I am new 2 SAP XI
and i am trying 2 do "Flat File To Flat File".
Input File contains following data:
Name:varun
Surname:rajaraman
Address:B-2
Employee no:8204
i.e Each Data is in separate Row.
Output File Should contain the following data:
I am varun rajaraman staying at B-2 bearing employee no. 8204.
(name,surname) (address) (Employee No.)
i.e data should be in a single row.
So, i have a problem of reading the data from input file i.e data from each row and transfering it into output file along with which i need 2 insert "i am " ,"staying at", etc.
pls tell me the procedure in detail.
Thanks and regards
santhosh rajaramanHi,
Check this links for file content convertion.
File content conversion sites
/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
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/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
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Regards,
Phani
Reward Points if Helpful -
Xml file to translate to be flat file
hello
I have file 2 file scenario. in the out put I recieve my file as an XML (with the tags) and I would like it to be a flat file and not an XML how do I do it?
for example:
now my out put file is like this:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:SheoneyHanahr_Output_MT xmlns:ns0="com:bankhapoalim.co.il:hr:SheoneyHanahr"><item><Item><Headrot>p20</Headrot><ZihoyMasof>0907</ZihoyMasof><TaarichHachtama>22062008</TaarichHachtama><ShatHachtama>130800</ShatHachtama><MisparCartisNochechot>02206882</MisparCartisNochechot><SdeMogdarLokoach>04203</SdeMogdarLokoach></Item></item></<ns0:SheoneyHanahr_Output_MT>
I would like it to be:
P20,0907,22062008,130800,02206882,04203
how do I make the translate? I believe it is in the adpater module of the reciever and content conversion but I am not sure. help is required, preferred with examples.
Thanks
KfirHI
File Content prameters for the Receiver Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm
File Content prameters for the Sender Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Refer
File Receiver with Content Conversion
File Receiver with Content Conversion
Configuring the Receiver File/FTP Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/95/bb623c6369f454e10000000a114084/frameset.htm
File content conversion sites
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Please see the below links for file content conversion..
The specified item was not found. - FCC
The specified item was not found. - FCC
File Content Conversion for Unequal Number of Columns
File Content Conversion for Unequal Number of Columns - FCC
Content Conversion (Pattern/Random content in input file)
Content Conversion (Pattern/Random content in input file) - FCC
XI Configuration for MDM Integration - Sample Scenario - FCC - MDM
XI in the role of a FTP
XI in the role of a FTP - FCC
File to R/3 via ABAP Proxy
File to R/3 via ABAP Proxy - FCC
XI/PI: how to exclude files in a sender File adapter? - EOIO - File
http://help.sap.com/saphelp_nw04/helpdata/en/ee/c9f0b4925af54cb17c454788d8e466/frameset.htm - cc
http://help.sap.com/saphelp_erp2005vp/helpdata/en/95/bb623c6369f454e10000000a114084/content.htm - fcc cOUNTER
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/da1e7c16-0c01-0010-278a-eaed5eae5a5f - conversion agent
File Content prameters for the Receiver Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm
File Content prameters for the Sender Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Refer
File Receiver with Content Conversion
File Receiver with Content Conversion
Configuring the Receiver File/FTP Adapter
http://help.sap.com/saphelp_nw04/helpdata/en/95/bb623c6369f454e10000000a114084/frameset.htm
File content conversion sites
Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
File Receiver with Content Conversion
Content Conversion (Pattern/Random content in input file)
NAB the TAB (File Adapter)
Introduction to simple(File-XI-File)scenario and complete walk through for starters(Part1)
Introduction to simple (File-XI-File)scenario and complete walk through for starters(Part2)
How to send a flat file with various field lengths and variable substructures to XI 3.0
Content Conversion (Pattern/Random content in input file)
NAB the TAB (File Adapter)
File Content Conversion for Unequal Number of Columns
Content Conversion ( The Key Field Problem )
The specified item was not found.
File Receiver with Content Conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Please see the below links for file content conversion..
The specified item was not found. - FCC
The specified item was not found. - FCC
File Content Conversion for Unequal Number of Columns
File Content Conversion for Unequal Number of Columns - FCC
Content Conversion (Pattern/Random content in input file)
Content Conversion (Pattern/Random content in input file) - FCC
cheers -
Load of hierarchies from R/3 via flat file: how to generate the flat file?
Hello,
I need to build a custom extractor for a hierarchy. The hierarchy exists in R/3, but there's no standard datasource to extract it. I know I can upload it via flat file, but I have a question related to this.
Does anyone know if there's a program (standard or custom by SAP) or function module in R/3 which allows me to generate that flat file, with the required format by BW?
I would appreciate very much any help about this topic
Thanks in advanceIn CO-PA there is a way to generate Hierarchy Extractors (see Note 422175 for more details). With a Custom Program you generate a specific DataSource.
Hope it helps
GFV -
Load of hierarchies from R/3 via flat file: how to generate that flat file?
Hello,
I need to build a custom extractor for a hierarchy. The hierarchy exists in R/3, but there's no standard datasource to extract it. I know I can upload it via flat file, but I have a question related to this.
Does anyone know if there's a program (standard or custom by SAP) or function module in R/3 which allows me to generate that flat file, with the required format by BW?
I would appreciate very much any help about this topic
Thanks in advance
PatriciaHi Patricia,
if there is, I'd love to get hold of it.
I have only ever managed this by extracting the relevant data into Excel and then doing a long series of VLOOKUPS to establish parent and child ids.
I have a sample spreadsheet I can send you if you like.
Regards,
Mike -
Reducing the time interval in file Adpt to write a flat file at a location
Hi All,
I hav a scenario where i hav to write a flat file (<b>XXX.txt</b>) to a location. b4 doing that, i hav to check whether <b>XXX.txt</b> already exists or not. If it doesn't exists then i hav to write the <b>XXX.txt</b> file there. if it already exists, then i hav to wait until that <b>xxx.txt</b> file gets deleted.
In the receiver file adapter v hav an option <b>file construction mode = <u><i>create</i></u></b> which does the same thing. but the problem here is it is taking too long (<b>more than 5 min</b>) which is not at all acceptable in my case (it is ok <b>if it takes 1 min</b>).
Is there any way to <b>reduce the time interval</b> using the same option?
Or do we hav any <b>work around solution</b> for acheiving the same scenario?
any help wud b appreciated.
Thnx in Adv.
AnilAnil
As far as my knowledge goes I think it is not possible because we are not going to do anything from our end. XI is doing processing and creating a file for you. But you might be sending a large file at a time. So you have to improve the performance in your scenario. You check this urls on how to improve performance in XI:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/70ada5ef-0201-0010-1f8b-c935e444b0ad
Improving performence in XI
Maximum Permitted File Size in XI
---Satish -
Rdbms table to flat file: error at creation of flat file
hi
i created a mapping in which , i want to transfer data from a rdbms table to a flat file.I created the flat file using owb and gave the location of the flat file as E:/........./folder.When i try to deploy the mapping. The flat file isnt getting created .validation and scripts are ok, but deployment is failed with the below,error.
ORA-01031: insufficient privileges.
Create failed.With 11gR2 of OWB you will need to either grant CREATE ANY DIRECTORY privileges to the target user so that when the directory is created when the OWB connector is deployed will work. Or the other option which is more secure is to have the dba create a directory and grant read/write privs on this directory (and when creating the connector in OWB, reference this SQL directory in the database). The CREATE ANY DIRECTORY option is ok above to get up and running and understand what is going on.
Cheers
David -
Adapter Module for Sender File Adapter to access a Flat file
Hi,
We have a scenario where the source is a flat file.I want to develop an Adapter Module to make a small change to every line in the Flat file.
Now how do we read a flat file in the Adapter Module?Coz the flat file will be converted to XML file by the Standard Adapter Module of the File adapter.
Please help me out with this.
Thank you,
Anu.Hi Anu,
If you are not using Content Conversion option Standard Adapter Module does not convert the Flat file to XML .
You can directly access the payload as it is in flat file in the Adapter Module and make changes.
Use the Standard classes ModuleData & moduleContext to fetch the Payload.
chk this :
Customized Sender Adapter Module
XI: Read data from PDF file in Sender Adapter
regards
Ganga -
Proxy to File scenario - IDOC as an flat file
Hi,
I am working on ABAP Sender Proxy to File scenario. The target structure in the message mapping is SHPMNT05 IDOC and the output of the file needs to be in the text format and then the file will be send to an EDI subsystem.
Currently, EDI subsystem gets the IDOC from ERP system as a flat file and expects the similar kind of file from XI system
The requirement is to have all the fields of the IDOC in the target file. If data does not exist for a particular field, then there should be a space for that field in the text file.
I would like to know if there is any other standard way of executing this scenario apart from using File Content conversion. In case if we have to use FCC, how difficult it would to be implementing the scenario. Please note that the output file needs all the fields of IDOC in it.
Regards,
Sakthi
Edited by: Sakthi on Sep 26, 2008 11:24 AMHello Sakthi,
By coding in proxy populate the idoc structure if it is difficult to handle thru Content conversion parameters then create an intermediate structure and populate that structure by concatenating the fields from idoc segments. If the fields are not having the values then add blank spaces as per length of the field.
You can configure the file channel and content converison parameters for the intermediate structure.
Hope it will helps to you.
Cheers
Veera -
SSIS Compare 2 flat files and create a third flat file
Hey all,
I have two flat files structured as:
Flat File A:
3213,214,14,21421,354,325
Flat File B:
3213,214,14, 55,89, 21421,354,325
I am trying to create an ETL Package that compares Flat File A, to Flat File B, finds an anomaly, in this case
55,89, then outputs the anomalies to Flat File C, separated by commas.
How would I go about doing this? Everything I have looked at shows comparisons between SQL DB's.
Any suggestions?
Thank youHi, I'm looking for a no code solution for my clients. They're happy with drag and drop, but would prefer a no-code solution. Is this possible?
sorry what do you mean by drag and drop? what will client drag and drop? From what interface?
If you can give bigger picture then it would help
In SSIS you've to implement using SSIS tasks only
And in the above case you need to write code in any case be it script task which is in C#,VB .NET or be it execute sql task which is sql.
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page
Maybe you are looking for
-
I'm saddly disappointed with my new Lenovo performance and don't know what might be the cause. I just got a new T510 with Core i5 processor, 4GB RAM and Windows 7 64. When I run a couple of programs, like Photoshop, a Virtualbox (850 MB of RAM alloc
-
** BPM Error - Msg has error status on oubound side
Hi Friends, I am doing BPM scenario. (Receive Step --> Transformation Step --> In Block (For each) Synchronous Send Step ). That's all BPM design. We have created Server prox (inbound Proxy) in ABAP, it receives PO details and return Sales order no.
-
Missing Method getColumnIndex(String columnName) in ResultSetMetaData?
Hi, I'm looking for some Methods in the ResultSertMetaData-Interface, can't find them and ask me why. First: there is a method "getColumnName(int columnIndex)" but the Method "getColumnIndex(String columnName)" is'nt. Second: the Method "getTableName
-
Converting Number into words while Display
Hello Sir, I am working on Project System. I am getting Field MAT_PSPNR(Valuated Sales Order Stock WBS Element) in MSEG Table. In table the Corresponding field stored in Numbers while Display its converted into Some other Content Please Explain Me
-
Does the only way to have a form field to insert an image is by using LiveCycle Designer or is there a way to do it with some kind of hack using javascript or else? Something that would be possible to use using Adobe free Reader.