cancel
Showing results for 
Search instead for 
Did you mean: 

udf error

vijay_kumar133
Active Participant
0 Kudos

Hi friends,

I am using simple udf function.when i am testing i am getting this error. plz any one aware of this...

/usr/sap/XD1/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map795d7670202511dd9cc700144fad690b/source/com/sap/xi/tf/_MM_ClaimPaid_XI_SAP_.java:1580: <identifier> expected

plz explain..

and need some basic difference in udf function which differe depend on cache parameter that is value,context and queue..

Thanks and Regards

vijay

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Hi,

Please provide your UDF code as it is in your mapping program.

Thanks,

Gujjeti

vijay_kumar133
Active Participant
0 Kudos

//write your code here

String a;

char[] chr = a.toCharArray();

String result = "";

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

if(Character.isLetter(chr<i>)){

result = result + Character.toString(chr<i>);

}

}

//System.out.println(res);

return result.

the purpose of this function is to eliminate special charecters from the string to get a clean string.....

GabrielSagaya
Active Contributor
0 Kudos

modify the code

if(Character.isLetter(chr <i> )){

result = result + Character.toString(chr [<i>] );

change chr[<i>] instead of chr

prateek
Active Contributor
0 Kudos

Use this

//write your code here

char[] chr = a.toCharArray();

String result = "";

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

if(Character.isLetter(chr<i>)){

result = result + Character.toString(chr<i>);

}

}

//System.out.println(res);

return result;

Regards,

Prateek

Answers (5)

Answers (5)

GabrielSagaya
Active Contributor
0 Kudos

function myudf(String a, Container container)

{

char[] chr = a.toCharArray();

String result = "";

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

if(Character.isLetter(chr<i>))

result = result + Character.toString(chr<i>);

}

return result;

}

modify the code as chr<i> instead of chr

Former Member
0 Kudos

i met this kind of error before

in my case, the disk is full no free space

if yours is not like this, you can try to restart the XI.

GabrielSagaya
Active Contributor
0 Kudos

Line n: Identifier expected

*******************************

for eg->

public void tryIt(int a, b URL c)

This type of error will give rise to error messages of the form:

Line n: Identifier expected

bcos type is missing for b.

Simple UDF

**************

Value: expects the individual/multiple values as input parameters

return single output.

Advanced UDF

*****************

2 modes

**********

Context: expects the context as input parameter

Queue: expects the entire queue as input parameter for function.

returns ResultList contains list of values.

no return statement.

Former Member
0 Kudos

Hey

if its ok can you please post the code of UDF as well as the java classes you are importing(if any)

Thanx

Aamir

Edited by: Aamir Suhail on May 12, 2008 8:43 AM

Former Member
0 Kudos

Hi Vijay,

/usr/sap/XD1/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map795d7670202511dd9cc700144fad690b/source/com/sap/xi/tf/_MM_ClaimPaid_XI_SAP_.java:1580: <identifier> expected

Please provide the code, so that we can understand where it is expecting identifier.

need some basic difference in udf function which differe depend on cache parameter that is value,context and queue..

Value: expects the individual/multiple values as input parameters

Context: expects the context as input parameter

Queue: expects the entire queue as input parameter for function.

please refer below links to understand what is Context and Queue:

[Introduction to Context Handling in Message Mapping|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3537] [original link is broken] [original link is broken] [original link is broken];

[Introduction to queues in message mapping|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1832] [original link is broken] [original link is broken] [original link is broken];

Regards

Bhanu

Intelligroup.

Edited by: Bhanu Tiruveedula on May 12, 2008 7:17 PM