on 07-23-2010 5:47 AM
Hi Experts,
I have a scenario where JMs adapter is my source and is sending data which is of Fixed length.
My problem is when JMS is sending the data in any of the incoming fields its passing a carriage return(0D- Hexadecimal character).
When this character is coming the record is getting breaked into two or failing in my channel.
Please guide me in handling this issue and to remove this character from the record.
Hi,
U can handle this issue by ant of these...
1. U can ask the third party sending messages in JMS to replace the carriage return character by none or empty.. when they are sending it to the messaging system.
But i dont think so they are ready to do it....
2.No problem. U can handle this in the mapping itself.
When the record is breaking because of carriage return, u will receive a new record.
In UDF check the length of each record. If it is less than the Fixed Length we are expecting then combine these 2 records into one.
Still less than the Fixed length append 3rd one also.. so on.
U can go for one extra graphical mapping for this.
And then other mapping which u will use noramally.
in Operation Mapping specify them in sequence.
Babu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I handled one case using an UDF to identify a newline character and throwing an exception.
public void NewLine_Char(String[] inputData,ResultList result,Container container){
char []strTemp = new char[<Give a number as per length of your inputData>];
i,j;
int count=inputData.length;
int length[] = new int[<Give a number as number of occurrences of inputData>];
String str= "Error: Carriage return found in long description";
for (i=0;i<count;i++){
length[i] = inputData[i].length();
strTemp= inputData[i].toCharArray();
for(j=0;j<length[i];j++){
if(strTemp[j]=='\n'){
throw new RuntimeException(str);
}
}
result.addValue(inputData[i]);
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> I have a scenario where JMs adapter is my source and is sending data which is of Fixed length.
> My problem is when JMS is sending the data in any of the incoming fields its passing a carriage return(0D- Hexadecimal character).
Why does the sender adds the 0D to the line?
If you have no chance to change the sender application, then you could write an adapter module which deletes the 0D.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can easily remove carriage returns with xsl function
normalize-space()
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the solution Babu.
But one more issue i am facing is that the value coming in the next field after carriage return is missing from the xml received in PI.
Any suggestions could be of great help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
u also have one more option...
ConvertCRLFfromToLF bean used for the converting CRLF pf windows to LF of unix and vice versa.
Please go through following link...
http://help.sap.com/saphelp_nw04/helpdata/en/96/f04142099eb76be10000000a155106/content.htm
Babu
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.