cancel
Showing results for 
Search instead for 
Did you mean: 

UDF required.

Former Member
0 Kudos

Hi all,

find my UDF.

if( !(inValue[0].equals("") || inValue[0].equals("O") || inValue[0].equals("0") )) {

result.addValue(inValue[0]);

}else{

result.addValue(" ");

}

My requirement is if the input is 0 or O or "" then these records must be filtered at XI level.

the problem is even if the inputvalue is O or 0 or "" it is sent to receiver.

Thanks,

Srinivasa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Srinivasa,

I understand you are using Adavanced UDF.

1. Change the counter to the "Loop Counter". Now, it is set to 0!

2 .For checking "", add trim

3. Don't send space in else

The updated UDF us below

if( !(inValue[ <CounterVariable> ].trim().equals("") || inValue[ <CounterVariable> ].equals("O") || inValue[ <CounterVariable> ].equals("0") ))

{

result.addValue(inValue[ <CounterVariable> ]);

}

Regards,

Swapna.

Answers (2)

Answers (2)

VijayKonam
Active Contributor
0 Kudos

As per me you can not just supress the complete reciord by putting an If at one element.You need to use this UDF at each and every element of the source record. You need to take care of the context changes in this process. Provding your source and targets would be helpful to understand it better.

VJ

prateek
Active Contributor
0 Kudos

What do you mean by filtered? The udf you have shown just pass the value as it is and in the else part it passes a space. You may use "createIf" function and then use the condition.

Regards,

Prateek

Former Member
0 Kudos

Filtering means I dont want to send these records to the receiver.I dont want even space to be sent it must be null.

Former Member
0 Kudos

Hi Srini

In Mapping you have written the UDF from source to target and in receiver determiniation condition you have specified this field in XPATH to send message based on this Mapping result. Am i correct. Tell me if I am wrong.

Former Member
0 Kudos

in Receiver determinnation i dint put any condition.

do i need to use this in order to supress these field content ?

Former Member
0 Kudos

Hi,

Can u provide the source structure and explain which node you have to suppress?

This would be helpful so that I can provide you the code.

Regards,

Zabi

Former Member
0 Kudos

my source is database table structure is sap_data->

zzoms_number

zzmodifieddate

....

...

...

zzstatus we have various statusses z,o,p,s,0.i need to supress those recs with status = o or 0

zzloc