cancel
Showing results for 
Search instead for 
Did you mean: 

UDF java syntax error illegal start of expression

former_member214137
Participant
0 Kudos

Hi,

I found this post with solution for UDF for converting source node to target single node array http://scn.sap.com/message/9129375#9129375

I am new to Java and have not been able to determine the cause and resolution for this error. Can anybody suggest a solution?

The code is:

public void calculate1(String[] var1, ResultList result, Container container) throws StreamTransformationException{

StringBuffer sb = new StringBuffer();

for(int i = 0; i<var1.length;i++){
sb.append(var1 <i>);
}
result.addValue(sb.toString());

}

When i run a check on it I get the following error messages:

"Function calculate1, Line 4:

illegal start of expression

sb.append(var1 <i>);

                   ^

Function calculate1, Line 4:

')' expected

sb.append(var1 <i>);

                    ^

2 errors"

regards

Julian

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Use as below... Don't use angle brackets.  Use [  ] as below...

sb.append(var1 [i]);

former_member214137
Participant
0 Kudos

Hi Baskar,

Thanks for the quick response and the solution.

regards

Julian

Answers (0)