on 10-31-2007 2:25 PM
Hi
I have a input file with header record, item records, and trailer record. In the item records if the field poisiton (99-101) comes to be 05 I got to remove the entire item record and meanwhile got to edit to the trailer record also( As we have one field in the trailer which tells abt the no of item records and if we delete any item record we got to make the count lessen by one). Is there ny logic through which we can achieve this without BPM ??
Thanks
Kumar
Hey
use Java mapping for this,it might be possible to do this with UDF's too but i guess Java mapping is a better option
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nilesh,
The file has fields in hundreds and it is in MB's. I will give the idea how it look like.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Header
field1
field2
.....
Items
Record1
Record2
......
Trailder
field1
field2
field3(Record count)
...........
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
So In Record1, in which field position(99-101) comes to be of value 05 I have to delete the entire record. And the same to be reflected in Record Count which is present in Trailer.
Thanks
Kumar
Hi Kumar,
Basically you need to pass all item records to one UDF ( By setting context level at top element) while generating Line Item field.
Loop at all line item data..and if line item do not hold value "05" at given location add that line item back to result..So overall your UDF will look like this..
for(int i=0; i<a.length;i++){
{
if ( !a.substring(99,2).equals("05") )
result.addValue(a<i>);
}
//where are a--> LineItem
This will filter line item with "05" values. You can used same logic for Record count. Declare a integer variable where you need to +1 for every valid record as follows..
int counter = 0;
for(int i=0; i<a.length;i++){
{
counter = counter + 1;
}
result.addValue(new Integer(counter).toString());
//where are a--> LineItem
Hope this will help.
Nilesh
Req is complex...it is not necessary to do it in XI only..
.you push the information to other side where better logic can be applied...Like any information needs to go to R3 through XI you can pass the data and then trigger the RFC th e logic inside RFC can handle the data better then XI before posting.
hope you got my point..
regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.