cancel
Showing results for 
Search instead for 
Did you mean: 

UDF Req: urgent

Former Member
0 Kudos

Hi All

i am begineer in the XI kindly help me with this UDF.

i am checking the value of the field1 = ### then target root node should be created.

if field1 == ###

i dont want to map to the target root node

else

i want to send the value to the root node

this is mu UDF

//write your code here

for(int i=0;i< field.length;i++)

{

if(field<i>.equalsIgnoreCase("###"))

{

result.addValue(ResultList.SUPPRESS);

}

else

{

result.addValue("true");

}

}

this is not working, only else part is working for all inputs

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Check this,

UDF type is Context. Input is field , output map with target node.

for(int i=0;i< field.length;i++)

{

if (field<i>.equals("###") )

{

}

else

{

result.addValue(""field<i>"");

}

}

-Rohit

Former Member
0 Kudos

For this case you dont required a java code..you can do iy by using the defined...

Funcations in the Message Mapping...

Thanks

Farooq.

Former Member
0 Kudos

i am doing with the create if but it is not working properly......

Source: target:

Root1 Root 0-un

IDOC Field1

Subroot1 Field2

SubRoot2

Field1ofSubroot2

if field1ofSubroot Exists and if value is 04501 then target root node should create

if i use createif to tagret root node

if my input values to field are

0000

0450

then no Output is genereated because 1st value is failed (context of Field1OfSubroot2 is

Subroot2)

if i change the context of Field1OfSubroot2 is to IDOC then only row is created for the values of 000, on the root node if i check the queue (1st is supressed and 2nd is true)

instead of sending the details of 0450 it is sending the details of 000....

kindly help

Former Member
0 Kudos

Hi,

Provide details of source and target structure precisely and also the requirement that you have.

From what you have mentioned, it seems that root node is getting created for 450 value and is suppressed for 000. However, the value fields under root node is not accepting value against 450 but against 000.

Bhavish

former_member192892
Active Contributor
0 Kudos

Can you please give the source and target structure with occurence of nodes

Former Member
0 Kudos

Source:

Root1

Subroot1

SubRoot2

Field1ofSubroot2

target:

Root 0-un

Field1

Field2

if value in field 1 is ### then target root should not be created else it should be created

Message was edited by:

Khan Khan

Former Member
0 Kudos

Hi,

I dont think you need an UDF for this. You can achieve this using CreateIf inside node functions and Text related functions.

Regards,

Sudheer.

justin_santhanam
Active Contributor
0 Kudos

Khan,

Please refer the thread with same scenario

raj,

former_member192892
Active Contributor
0 Kudos

if(field.equalsIgnoreCase("###"))

{

result.addValue(ResultList.SUPPRESS);

}

it should be (field<i>.equalsIgnoreCase("###"))

former_member192892
Active Contributor
0 Kudos

I'm sorry for the previos post i intended to give the field array index but it's not getting printed...