cancel
Showing results for 
Search instead for 
Did you mean: 

functional rek

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Aamir !

Do you think we can handle this with FCC ?? (at least deleting of item records ??)

thanks

kumar

Former Member
0 Kudos

Hey

in FCC you can't skip any records,if the values exist in the file they need to be in FCC,you can skip them and move to next record

Thanx

Aamir

Former Member
0 Kudos

Hi Kumar,

Using FCC you cannot delete any lineitems base on condition....

You can handle this situation using Graphical mapping(UDF)...I have worked on this kind of interfaces...let me know if you need more details or any help.

Nilesh

Former Member
0 Kudos

Hi Nilesh !

Really intrested to know.......Could you plz give me the logic and if possible snippet of code ?? It is highly appreciated.

Thanks in advance

kumar

Former Member
0 Kudos

Hi Kumar,

Can you please provide me input pyaload and expected output payload.

Nilesh

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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,