cancel
Showing results for 
Search instead for 
Did you mean: 

What does these codees mean?

Former Member
0 Kudos

Pls help me with the meaning of the following codes,

1. int count;

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

{

count = Integer.parseInt(COUNT);

2. if(POINT.compareTo("R") != 0)

3.if (COUNT_02.compareTo("0") != 0)

4.result.addValue(EAN_04count_EAN+3);

5.result.addValue(EAN_04count_EAN+3);

6.result.addValue(Quantitycount_qty);

Also can u suggest some urls where some documaents can be available to enhance Java skills to develop UDFs.

Points will be awarded. Pls help. I hav been assigned huge responsibilities in XI, though I am an Abaper!

PS: Can u suggest any PDF where I can come to know about the different syntax, commands as used above, so that I can develop my own java codes....

Arnab .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1. int count;

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

{

count = Integer.parseInt(count);

}

Ans: Here Count is a variable and all the count variables should be changed to an Object.

2. if(POINT.compareTo("R") != 0)

Ans: Here POINT should be a String Constant

public int compareTo(String anotherString)

Compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence represented by the argument string. The result is a negative integer if this String object lexicographically precedes the argument string. The result is a positive integer if this String object lexicographically follows the argument string. The result is zero if the strings are equal; compareTo returns 0 exactly when the equals(Object) method would return true.

3. if (COUNT_02.compareTo("0") != 0)

Ans : Same as (2)

4. result.addValue(EAN_04count_EAN+3);

Ans: Here what is result ? Check for result.addValue method in Java API @ http://java.sun.com/j2se/1.5.0/docs/api/

5.result.addValue(EAN_04count_EAN+3);

Ans: Same as 4

6.result.addValue(Quantitycount_qty);

Ans: Same as 4

Regards,

Ramana Kumar. A

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

In the context of a user defined function (UDF) you find these kind of codes very often.

Let us assume that COUNT, POINT, COUNT_02 and EAN_04count_EAN or method parametres (in ABAP known as using parameters):

> 1. int count;

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

> {

> count = Integer.parseInt(COUNT);

COUNT.length gives the number of elements COUNT in the XML source.

I think the real code should be:

count = Integer.parseInt(COUNT<i>);

That means: For any XML element COUNT there is a transformation from a string value to an integer value in a loop.

> 2. if(POINT.compareTo("R") != 0)

If POINT ne 'R'

> 4.result.addValue(EAN_04count_EAN+3);

Concatenate EAN_04count_EAN and "3", and add to output list

> Also can u suggest some urls where some documents can be available to enhance Java skills to develop UDFs.

Here is a blog with some UDFs:

/people/harrison.holland5/blog/2006/12/08/mapping-context-changes-in-xi

Regards

Stefan

former_member859847
Active Contributor
0 Kudos

Hi,

Please refer the following ur's, which will help us to enahance java skill set.

http://java.sun.com/javase/6/docs/technotes/guides/javadoc/index.html - java doc technology

http://java.sun.com/docs/books/tutorial/- java tutorials

http://java.sun.com/docs/white/langenv/

warm regards

mahesh.