How to handle space in incoming file during fcc
Hi all,
I have a scenario of file to proxy. In this case the incomming file is space delimited and it begins with space too i.e. every new line item has a space in the begining I have to remove that space. How can i handle it...please help.
The fcc I am using is mentioned below:
Record.fieldSeparator '0x32'
Record.fieldNames a,b,c,d
Record.endSeparator 'nl'
Record.additionalLastFields ignore
ignoreRecordsetName true.
Thanks
Shivangi
This is my input payload
<?xml version="1.0" encoding="utf-8" ?>
- <ns:BRItemPrice_MT xmlns:ns="urn:test">
- <Record>
<VendNum>888700 0611593 0046.0800 00000838081 00014</VendNum>
<CCITEM>0033861</CCITEM>
</Record>
- <Record>
<VendNum>888700 0611597 0048.0000 00000838084 00014</VendNum>
<CCITEM>0033869</CCITEM>
</Record>
- <Record>
<VendNum>888700 0611599 0046.0800 00000838085 00014</VendNum>
<CCITEM>0033887</CCITEM>
</Record>
</nstest_MT>
And the fcc iI'm using is as below:
Record.fieldSeparator '0x32'
Record.fieldNames VendNum,CCITEM,CCCOST,HSITM,UPC
Record.beginSeparator '0x32'
Record.endSeparator 'nl'
Record.additionalLastFields ignore
ignoreRecordsetName true
Please help.
Thanks
Similar Messages
-
How to handle spaces in Sender File
I have sender file and it is reading wrongly as it is not reading spaces. It is fixed file lengthe with no seperator.
Following r the parameters I am using but still it is not picking up spaces.
ignoreRecordsetName true
Record.fieldSeparator nl
Record.endSeparator nl
Record.additionalLastFields ignore
Record.missingLastfields ignore
Record.fieldContentFormatting nothing
Record.fixedLengthTooShortHandling ignore
Record.fieldFixedLengths 15,25,9,1,15,20,15,1,3,15,1,3,9,50,100,50,100,100,15
Record.fieldNames 15,25,9,1,15,20,15,1,3,15,1,3,9,50,100,50,100,100,15
Record.keepIncompleteFields YES
My file format looks like as follows....there r 2 recods and u see psaces after each line they r part of particular field. Please help how to handle this..
GLPRMS Other 20-MAR-09A 30800845237527018000000000000000000.000000000000011241.34020-MAR-09260IN0103-616714 260IN0103-616714 REFR1 - 000000 / REFR2 - 000000 / REFR3 - SUMRY / TRANSFERS FROM
GLPRMS Other 20-MAR-09A 30800845237527018000000000000000000.000000000000000305.60020-MAR-09260IN0103-616714 260IN0103-616714 REFR1 - 000000 / REFR2 - 549944 / REFR3 - 7691 / TRANSFERS FROM
Thanks in advance
Ria
Edited by: ria sen on Mar 25, 2009 4:00 AMHi Ria,
Use the parameter Record.fieldContentFormatting = nothing
If you dont specify this parameter trim is taken as a default value hence you are not gettign the spaces.
This parameter should help you .
Regards,
Rajesh -
How to handle errors in a file at sender side?
Hi
I have done a file to proxy scenario.
I know how to handle errors on proxy.
But on sender side when picking the file if one the record have worng fomat its throwing mapping error and its not processing any record..
I wanted to process the records which have right format and data and all remaining recrods which have wromg format should be send back to the sender as file.
How to do this.
How to handle error in sender file.
Regards
SowmyaHello Sowmya,
In your scenario Three ways you can validate the data.
1) Before the data reaches into SAP system ie in XI system during Mapping or before mapping i,e in Adapter Module in the Sender side
2) this option, is in the receiver applications side. ie. Validations will be taken care in the SAP system i.e in ABAP server proxy code.
3)Through BPM, If Mapping Exception Occures then through exception Branch you can send bad formate file to sender again.
Generally, it is prefer to more business critical validations in the Application System ie Receiver Application System (ABAP Server Proxy)
In this, you can have more flexibility of the validations as you are validating some of the SAP payroll informations as Personal ID etc.
Based on the complexity and flexibility of the requirement, you can either do this in the XI (if XI, ie Sender Adapter Module or Mapping) or in the ABAP proxy
Thanks'
Sunil Singh -
How to handle the java.policy file ?
Can somebody tell me how to handle the java.policy file?
I always get java.net.SocketExceptions and java.security.AccessControlExceptions while connecting to an appserver from an applet.
What do I have to write in the java.policy file, where do I have to place it and do I have to call it in some way form my applet?
Thanks in advance.
don callThe java.policy file goes in your jre installation directory in .../jre/lib/security (there should be one there already).
I used it to allow otherwise restricted permissions for an applet using javax.comm. Add something like the following to the file:
grant codeBase "URL:http://yourDomainName/rootDirectoryOfYourApp/*" {
permission java.security.AllPermission;
This will give the applet downloaded from your site all permissions. You might want to give only certain permissions, I don't know.
Teri -
How can I back up my files during a Kernel Panic?
Hello, I am new to these forums.
Okay, so last week I updated my Macbook Pro like I normally do (I'm assuming it was 10.5.7), but then when I restarted my macbook I saw the apple logo and then the screen turned grey and a bunch of numbers and letters filled the screen (which I now know is a Kernel Panic or something).
I am unable to login at all or even see the log-in screen, all I can get to is the apple logo when I first turn on the computer. I plan on making an appointment at my local apple store, but they told me to back up any files I didn't want to lose.
So my question is...
How can i back up my files during a Kernel Panic if I can't even log in?
I have my original disks from when I got my macbook pro if that's any help?
Should I just tell my local apple store that I need help backing up my files?
or am I screwed?
Thanks for any helpWell, when I turn it on a box appears over the apple logo and says something like "please restart your machine or hold the power button for 7 seconds".
and the numbers and letters appear random to someone like me but I'm sure it says something to someone who knows about it. At the very beginning of the "random" numbers and letter it says something about kernel and panic and I googled some of the message and it kept leading me to other people who said it was a kernel panic.
Also I tried to start it while holding shift and it never goes to single user mode it just does the same thing as if I never pushed or held shift. I'll try the whole firewire thing if I can figure it out, but I don't have another mac so I'd have to do it with a PC.
Edit: Also I did one of those hardware tests using the osx dvd and the short test said i have an error (and when i googled that error it brought me to people with kernel panics) but when I did the extended test that took about an hour and a half it came back saying everything was fine.
Message was edited by: kennethalan -
How to handle a comma in a field in CSV file during FCC ?
Hi,
I am having a requirement where we have to convert a CSV file into XML using File Content Conversion . The issue is one of the field in the file is having a comma inside. So the XML parser is taking it as a field separator and throwing an error.
The contents of the file are as follows:
"02975859","New Key","9","Failed, rejected by RTI server"
How to handle a comma inside field "Failed, rejected by RTI server".
Any help would be appreciated.
Regards
PraveshHi ,
You have to write an java mapping programm to perdromance this task , in a estandar way i think is not possible , because the fiel adapter have just one option for the delimiter character.
Here's some code that could help you
Supouse a file in this way:
1,rahul,siemens,mumbai
2,consultant,12032005
1,viswanath,sisl,hyderabad
2,systemeng,23052005
package TXTMapping;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Map;
import com.sap.aii.mapping.api.StreamTransformation;
public class TMapping implements StreamTransformation {
private Map map;
public void setParameter (Map param){
map = param;
public void execute (InputStream in, OutputStream out){
try{
out.write("<?xml version ='1.0' encoding='UTF-8'?>".getBytes());
out.write("<ns0:Output_Data xmlns:ns0=\"urn:javamapping_test\">".getBytes());
String line = null;
BufferedReader bin = new BufferedReader(new InputStreamReader(in));
StringBuffer buffer = new StringBuffer();
while((line = bin.readLine())!= null){
String Company = null;
String Name = null;
String Place = null;
String Desgn = null;
String Since = null;
char[] str= new char[100];
str = line.toCharArray();
String[] Data = new String[10];
int S1 = 0;
int s2 = 2;
for (int i=2; i<line.length(); i++)
if (str<i>==',' && str[0]=='1')
Data[S1]= line.substring(s2,i);
S1=S1+1;
s2 = i+1;
if (i == line.length()-1 && str[0] == '1')
Data[S1]= line.substring(s2,i+1);
Name = Data[0];
Company = Data[1];
Place = Data[2];
out.write ("<Data>".getBytes());
out.write ("<Header>".getBytes());
out.write (("<Name>"Name"</Name>").getBytes());
out.write (("<Company>"Company"</Company>").getBytes());
out.write (("<Place>"Place"</Place>").getBytes());
out.write ("</Header>".getBytes());
if (str<i>==',' && str[0]=='2')
Data[S1]= line.substring(s2,i);
S1=S1+1;
s2 = i+1;
if (i == line.length()-1 && str[0] == '2')
Data[S1]= line.substring(s2,i+1);
Desgn = Data[0];
Since = Data[1];
out.write ("<Item>".getBytes());
out.write (("<Designation>"Desgn"</Designation>").getBytes());
out.write (("<Since>"Since"</Since>").getBytes());
out.write ("</Item>".getBytes());
out.write ("</Data>".getBytes());
out.write("</ns0:Output_Data>".getBytes());
catch(Throwable t){
t.printStackTrace(); -
How to handle a fixed length file without newline?
Hi Experts,
I'd like to handle a fixed length file without newline by sender file adapter.
A file like following.
It contains three recores."AAXBBBXCCCCX" is one record.
AA1BBB1CCCC1AA2BBB2CCCC2AA3BBB3CCCC3
I tried that following two parameters set. But only first recored was read.
fieldFixedLengths
fieldFixedLengthType
Please tell me how to handle.
Thanks
Shinya Kawagoe.For this case we wrote a simple Adapter Module inserting an end of line character after an offset.
This way it can be reused in many interfaces.
And reading the whole file may not be an option in case of large source files. May cause performance / memory issues.
eolbean.offset = <recordLlen>
XMLPayload xmlpayload = msg.getDocument();
byte[] content = xmlpayload.getContent();
byte crlf = 0x0A;
int current = 0;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int lines = content.length / recordLen;
do
lines--;
baos.write(content, current, recordLen);
if (lines > 0) // if other lines, eol required
baos.write(crlf);
current += recordLen;
} while (lines > 0);
xmlpayload.setContent(baos.toByteArray());
baos.close();
Audit.addAuditLogEntry(key, AuditLogStatus.SUCCESS, MODULE + " Done EOLing."); -
How to handle blank line in File adapter
Hi,
I am using a file adapter with CSV as input file. If I have a blank line in CSV file, BPEL is failing read it, no instance is created and file is archieved.
Please let me know how to handle this issue.
ThanksHi Yatan,
I am already using rejectedMessageHandlers, I am on 10.1.3.3.
Here's my bpel.xml
============
<?xml version = '1.0' encoding = 'UTF-8'?>
<BPELSuitcase>
<BPELProcess id="EmpAddressUpdABCSImpl" src="EmpAddressUpdABCSImpl.bpel">
<partnerLinkBindings>
<partnerLinkBinding name="ReadFile">
<property name="wsdlLocation">ReadFile.wsdl</property>
<property name="rejectedMessageHandlers">file://E:/HRARCHIVE/BadData</property>
</partnerLinkBinding>
<partnerLinkBinding name="InsertAddressUpd">
<property name="wsdlLocation">InsertAddressUpd.wsdl</property>
<property name="retryInterval">60</property>
</partnerLinkBinding>
</partnerLinkBindings>
<configurations>
<property name="sensorLocation">sensor.xml</property>
<property name="sensorActionLocation">sensorAction.xml</property>
</configurations>
<activationAgents>
<activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent" partnerLink="ReadFile">
<property name="portType">Read_ptt</property>
<property name="rejectedMessageHandlers">file://E:/HRARCHIVE/BadData</property>
</activationAgent>
</activationAgents>
</BPELProcess>
</BPELSuitcase>
Someone told me that this can be achieved by changing the native schema, I tried many options but no result. Please suggest me.
-- Shirish -
How to handle the layout of file in OWB?
Hi all,
I am facing one problem..that is
If my file is coming monthly
i need to load into datamart.
But the problem is the layout is not same.
At the end of the file one field may add or one field may delete..
The procedure I am following to load data into datamart is "First I am creating External table and then from Eaternal table to Table."
How can I handle this type of file in OWB
Pls give me some inputs
Thanks in advance
Srinivashi,
Define the extenal table in the followin way,
CREATE TABLE sample_extbl
2 ( col1 NUMBER
3 , col2 NUMBER
4 , col3 NUMBER
5 )
6 ORGANIZATION EXTERNAL
7 (
8 TYPE ORACLE_LOADER
9 DEFAULT DIRECTORY LOG_DIR
10 ACCESS PARAMETERS
11 (
12 RECORDS DELIMITED BY NEWLINE
13 nobadfile
14 nologfile
15 FIELDS TERMINATED BY ',' LDRTRIM
16 MISSING FIELD VALUES ARE NULL
17 )
18 LOCATION (LOG_DIR:'a.csv')
19 )
20 REJECT LIMIT UNLIMITED;
case 1:
Now, for example if the file a.csv contains the data as follows.
col1,col2,col3,col4,col5
abc,28,xyz,mno,1000
abc2,38,xyz,mno,2000
abc3,28,xyz,mno,3000
Then, if we query the external table "sample_extbl"
select * from sample_extbl
Then you get the data as follows
col1 col2 col3
abc 28 xyz
abc2 38 xyz
abc3 28 xyz
Case 2:
Now, for example if the file a.csv contains the data as follows.
col1,col2,col3,col4,col5
abc,28,xyz,mno,1000
abc2,38
abc3,28,xyz,mno
Then, if we query the external table "sample_extbl"
select * from sample_extbl
Then you get the data as follows
col1 col2 col3
abc 28 xyz
abc2 38
abc3 28 xyz
Regards,
Gowtham Sen. -
How to handle error for a file to file transform in ODI
I am doing a lab for file to file transformation where source = CSV file and target = Flat file.
1) When I am changing the datatype in source two files are getting created where one having the errored out data and the other having the errored message, how how to handle the errored data?
2) If the target path is changed the session in ODI is showing as completed, it should error out. Here no files are created in source as earlier. Hoe to handle this type of error?Hi,
I have used the following KMs in my transformation with the following options:
IKM SQL Incremental Update
INSERT <Default>:true
UPDATE <Default>:true
COMMIT <Default>:true
SYNC_JRN_DELETE <Default>:true
FLOW_CONTROL <Default>:true
RECYCLE_ERRORS <Default>:false
STATIC_CONTROL <Default>:false
TRUNCATE <Default>:false
DELETE_ALL <Default>:false
CREATE_TARG_TABLE <Default>:false
DELETE_TEMPORARY_OBJECTS <Default>:true
LKM SQL to SQL
DELETE_TEMPORARY_OBJECTS <Default>:true
CKM Oracle
DROP_ERROR_TABLE <Default>:false
DROP_CHECK_TABLE <Default>:false
CREATE_ERROR_INDEX <Default>:true
COMPATIBLE <Default>:9
VALIDATE <Default>:false
ENABLE_EDITION_SUPPORT <Default>:false
UPGRADE_ERROR_TABLE true -
How to handle WinRaR and Winzip Files?
This maybe the wrong forum to ask this, but how or can winzip or winrar files be unzipped and the result be loaded on a usb memory stick using osx? or what would it take to do this, as I'm totally ignorant on this one. Hope someone can help.
Thank You!
EZ
iMacs G5 & G3 Mac OS X (10.4.6) 10.3.9 on G3, Direcway 6k cnsmr sat. cnct., netgear ethernet swtch to 2 cmptrs.If you search Google or VersionTracker you'll find many answers to your problem.
I think the best is to download the well-established and reliable Stuffit Expander from SmithMicro. It opens more cross-platform files than I've ever had a chance to use.
Hope this helps! bill
1 GHz Powerbook G4 Mac OS X (10.4.8) -
How to Handle Too Many js Files?
I making a website and i want to know how to handle too many js in one page.
And i want to add news ticker but js is conflict with someone
<script src="js/ticker/1.8.jquery.min.js"></script>
<script src="js/ticker/all.js"></script>
<script src="js/ticker/jquery.li-scroller.1.0.js"></script>
<script src="js/jquery.slicknav.js"></script>
<script type="text/javascript" src="js/modernizr.custom.js"></script>
<script type='text/javascript' src='js/scrollIt.min.js'></script>
<script type="text/javascript" src="js/jquery.simple-text-rotator.js"></script>
<script type="text/javascript" src="js/jquery.nicescroll.min.js"></script>
<script type="text/javascript" src="js/jquery.appear.js"></script>
<script type="text/javascript" src="js/jquery.bxslider.min.js"></script>
<script type="text/javascript" src="js/jquery.fitvids.js"></script>
<script type="text/javascript" src="js/owl.carousel.min.js"></script>
<script type="text/javascript" src="js/jquery.colorbox.js"></script>
<script type="text/javascript" src="js/jquery.parallax-1.1.3.js"></script>
<script type="text/javascript" src="js/jquery.localscroll-1.2.7-min.js"></script>
<script type="text/javascript" src="js/jquery.scrollTo-1.4.2-min.js"></script>
<script type="text/javascript" src="js/classie.js"></script>
<script type="text/javascript" src="js/cbpAnimatedHeader.min.js"></script>
<script type="text/javascript" src="js/template.js"></script>I trying ti use your code but that's not working,
i want to add one news ticker but that's not work
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type='text/javascript' src='js/scrollIt.min.js'></script>
<script type="text/javascript" src="js/jquery.simple-text-rotator.js"></script>
<script type="text/javascript" src="js/jquery.nicescroll.min.js"></script>
<script type="text/javascript" src="js/jquery.appear.js"></script>
<script type="text/javascript" src="js/jquery.fitvids.js"></script>
<script type="text/javascript" src="js/owl.carousel.min.js"></script>
<script type="text/javascript" src="js/template.js"></script> -
How to handler 200MB - 600MB XML file
I came into a problem to handle very big XML files using DOM or SAX. Is there any method I can build XMLDocument for such big files?
You cannot use DOM to load such a large file unless you can free up 1 to 3 gigabytes of heap memory. You could write special-purpose programs that used SAX to parse it as long as you were careful not to accumulate data in memory. You may want to seriously consider storing the data in some other format.
-
How to handling Binary data and File operation?
Hello Everyone,
I think this question might have been asked a lot of time but I was unable to find one solution so, please help needed in this from all you guys..
I am creating a byte[] of the media files of mp4, and jpg, using the below code,,
File ff = new File(filename);
fos = new FileOutputStream(ff);
int b;
byte[] f = this.getMediaFile();
for (b = 0; b < f.length; b++) {
if (f[b] != -1) {
fos.write(f);
fos.flush();
fos.close();
After i convert it i have to store it in the MySql Database as BLOB object, for retrieving byte[] from the database is simple i can do that also successfully with this code.java.sq.Blob obj = (java.sql.Blob) rs.getBlob("file");
InputStream is = null;
ByteArrayOutputStream bc = null;
is = obj.getBinaryStream();
bc = new ByteArrayOutputStream();
int b;
while ((b = is.read()) != -1) {
System.out.print(b + " ");
bc.write(b);
Now the real problem is that when i want to recreate a mp4 audio or video file i am unable to do so, the file created is smaller in size and also it doesn't get played in windows default player nor VLC. I am able to get the image file of jpg format using the BufferedImage & ImageIO.writer();
How do i do for mp4 file, have no clue for that.
Pleases help out with this.
Thanks..if (f[b] != -1) {I don't get that line. What if you try to output the data without that condition, like this:
fos = new FileOutputStream(ff);
byte[] f = this.getMediaFile();
for (int b = 0; b < f.length; b++) {
fos.write(f);
fos.close(); -
How to handle spaces in using path to the file
Hi Friends,
I am getting error "file not found" if I give path of the file that contains spaces in it. (eg. C:\Users\Sample Project\file.txt)
If I give path that doesn't contain spaces (eg. C:\Users\Sample\file.txt) then it works fine without any error.
Basically I am invoking one command at runtime (using "exec") in my java program that excepts path of the file as one parameter.
I can't remove space by manipulating path - othewise that path will be different.
How can I solve this issue?
ThanksWorks for me:
import java.io.*;
public class ProcessExample {
public static void main(String[] args) throws IOException {
if (args.length == 0) {
Runtime r = Runtime.getRuntime();
dump(r.exec("java ProcessExample foo \"bar baz\""));
} else {
for(String s : args) {
System.out.println(s);
static void dump(Process p) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
for(String s; (s = r.readLine()) != null; ) {
System.out.println("[" + s + "]");
}But ejp's advice is even better.
Maybe you are looking for
-
Selectively displaying certain items in a list // logic tag in adf
Hi, I have a tree the children of which can be of two types based on a child property. I want to be able to display only one type of children in a for loop. I could not find an <af: if > kind of tag that will let me check a child property in that i c
-
Moving iTunes Library with two users on the iMac
We have our iTunes library on my husband's login for our iMac. I am the most frequent user of this computer. We have home sharing turned on so that I can listen to the library while on my user account. What is annoying is that all of our iPods are sy
-
This program is used to convert NON open item mangaed accounts to open item managed accounts. While executing this program I am getting message "please do not use this program". Can some one helpme on this
-
I am having problems with measures based on different levels of a dimension. The situation is: I have a product dimension with 2 levels (category and detail) and a client dimension. I want a measure with the number of distinct clients wich buys each
-
I am using Berkeley DB 5.1.19 with replication manager. I am seeing big differences between the size of the db files between the master and the client, is that expected and if so what is the reason. This has impact on the size of the backup too. On t