on 12-15-2009 7:49 AM
Dear All
I have to implement a scenario using Java Mapping SAX parsing.
The need is such that I have to skip a few records from the incoming file based on the content.
Say if content of a particular field in a record is "PES" I should not map the entire record and should move to process the next record.
When I am trying to skip a record I am getting an error
"XML document structure must start and end within the same entity"
Please let me know how to implement it.
Sourabh
Hi ,
I think we can achieve this requirement using Graphical Mapping,you can check the condition at mapping level to check the value of field.
If you want to implement using JAVA Mapping,then you need to familiar with SAP Parcers steps.Pate the code what you have written.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
My source structure is
<root>
<IsValid>Y</IsValid>
<Data><Header>"A000",123,"AR"</Header>
<Body>
"N68",PSE,2102175432
"N68","MAM",2102175431
"N68","MAM",2102175430</Body>
<Footer>sadf,sadf</Footer>
</Data>
</root>
</ns0:FileIn_MT>
Here records are in Body tag. If in any record we find "PSE" then we should skip that record and process the next one to be mapped to the following record structure.
<HeaderName> </HeaderName>
<HeaderField></HeaderField>
<HeaderNumber></HeaderNumber>
<CustomerName></CustomerName>
<CustomerNo></CustomerNo>
<MeterNo></MeterNo>
<FooterName><FooterName>
<FooterNo></FooterNo>
</ns0:FileIn_MT>
I am using following code in Java Mapping
if(!(CustomerNo.equals("PSE")))
{
write("<CustomerName>"CustomerName"</CustomerName>");
write(lineEnd);
write("<CustomerNo>"CustomerNo"</CustomerNo>");
write(lineEnd);
write("<MeterNo>"MeterNo"</MeterNo>");
write(lineEnd);
}
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.