<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to build a Java Array in ABAP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013867#M411351</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok got it, do one thing take a temp variable of char 1 ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then pass the charecters of the string one by one to that temp value and append the value to an internal table.clear the temp variable.and do it again,use some do staement for this now how to split the string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp = string+0(1). gives first char&lt;/P&gt;&lt;P&gt;temp = string+1(1). second&lt;/P&gt;&lt;P&gt;temp = string+2(1). third &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc etc for further details read this stuff&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Character Strings in Release 6.10 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Release 6.10 the following new functions are available for character strings: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Establishing the length and number of characters &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. New instructions FIND and REPLACE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Faster access to strings &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Support for strings in the database &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Defining string constants &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. Introduction of string literals &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 1 &lt;/P&gt;&lt;P&gt;Establishing the length and number of characters &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function CHARLEN provides the length of the first character of a string or of a character-type field. &lt;/P&gt;&lt;P&gt;You can use NUMOFCHAR to obtain the number of characters in a string or a character-type field. &lt;/P&gt;&lt;P&gt;DBMAXLEN provides the maximum length of the string as stored in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 2 &lt;/P&gt;&lt;P&gt;New instructions FIND and REPLACE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a new statement,FIND, for searching in character strings. This replaces the SEARCH command. For replacing characters in character strings the statement REPLACE has been enhanced to include position-based replacement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 3 &lt;/P&gt;&lt;P&gt;Faster access to strings &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Offset/length access is now the fastest way to process a string character by character. This technique is also faster than searching in a field of type C that is assigned to a field symbol. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 4 &lt;/P&gt;&lt;P&gt;Support for strings in the database &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As from Release 6.10, character strings and binary data can be stored in database columns of types STRING or RAWSTRING. The system differentiates between short and long strings: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short strings consist of a maximum of 256 characters, do not have trailing spaces and can be compared on the database. &lt;/P&gt;&lt;P&gt;Long strings can be of any length and do have trailing spaces; however they cannot be compared on the database. &lt;/P&gt;&lt;P&gt;When working with strings some restrictions have to be observed. Further details are available here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 5 &lt;/P&gt;&lt;P&gt;Defining string constants &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Strings can now also be defined as constants and can be given an initial value using the keyword VALUE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants: STR1 type string value 'ABC'. &lt;/P&gt;&lt;P&gt;data:      STR2 type string value 'XYZ'. &lt;/P&gt;&lt;P&gt;STR2 = STR1. &lt;/P&gt;&lt;P&gt;STR1 = STR2.              "Syntax error &lt;/P&gt;&lt;P&gt;write: / STR1, STR2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 6 &lt;/P&gt;&lt;P&gt;Introduction of string literals &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String literals are enclosed by grave accents (`)of the form str = `ABC`. String literals are of data type STRING and trailing spaces are taken into account, as opposed to text literals. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: STR1 type string value 'ABC  ', &lt;/P&gt;&lt;P&gt;      STR2 type string value `ABC  `, &lt;/P&gt;&lt;P&gt;      CNT1 type i, &lt;/P&gt;&lt;P&gt;      CNT2 type i. &lt;/P&gt;&lt;P&gt;CNT1 = strlen( STR1 ). &lt;/P&gt;&lt;P&gt;CNT2 = strlen( STR2 ). &lt;/P&gt;&lt;P&gt;write: / CNT1, CNT2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The length for the string STR1 will be CNT1 = 3 and for the string STR2 it will be CNT2 = 5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Mar 2007 10:29:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-09T10:29:52Z</dc:date>
    <item>
      <title>How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013863#M411347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this bit of Java-code ( a function that calculates a distance table to determine the differences between two strings ) and my question is on &amp;lt;b&amp;gt;how this generally&amp;lt;/b&amp;gt; would look or &amp;lt;b&amp;gt;be done in abap&amp;lt;/b&amp;gt; or &amp;lt;b&amp;gt;more specifically&amp;lt;/b&amp;gt;, how can I do the &amp;lt;b&amp;gt;array in abap&amp;lt;/b&amp;gt; for this specific need ( as I do not really know the dimensions when defining it ). Is there a simpler approach or function to implement this in abap ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;public static int BuildDistanceTable (String s, String t) {
		int d[][]; // matrix
		int n; // length of s
		int m; // length of t
		int i; // iterates through s
		int j; // iterates through t
		char s_i; // ith character of s
		char t_j; // jth character of t
		int cost; // cost
		
		// Step 1
		
		n = s.length ();
		m = t.length ();
		if (n == 0) {
			return m;
		}
		if (m == 0) {
			return n;
		}
		d = new int[n+1][m+1];
		
		// Step 2
		
		for (i = 0; i &amp;lt;= n; i++) {
			d&amp;lt;i&amp;gt;[0] = i;
		}
		
		for (j = 0; j &amp;lt;= m; j++) {
			d[0][j] = j;
		}
		
		// Step 3
		
		for (i = 1; i &amp;lt;= n; i++) {
			
			s_i = s.charAt (i - 1);
			
			// Step 4
			
			for (j = 1; j &amp;lt;= m; j++) {
				
				t_j = t.charAt (j - 1);
				
				// Step 5
				
				if (s_i == t_j) {
					cost = 0;
				}
				else {
					cost = 1;
				}
				
				// Step 6
				
				d&amp;lt;i&amp;gt;[j] = Minimum (d[i-1][j]+1, d&amp;lt;i&amp;gt;[j-1]+1, d[i-1][j-1] + cost);
				
			}
			
		}
		
		// Step 7
		
		return d[n][m];
		}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 09:32:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013863#M411347</guid>
      <dc:creator>former_member5350</dc:creator>
      <dc:date>2007-03-09T09:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013864#M411348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;itabs solve the perpose of arrays  as in java or cpp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please give me the thing you require to do as i cannot understand the java code as such,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks waiting for you reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 09:53:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013864#M411348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T09:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013865#M411349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think u can use the concept of internal table in abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sruthi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 09:56:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013865#M411349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T09:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013866#M411350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi vikaas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i basically want to do is take two strings and compare them regarding the chars they differ from each other for implementing a simple duplicates check, so this goes further than simple s1 = s2 and check wheter theyre equal or not. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"simon mayer" and "simeon meier" -&amp;gt; 5 differences .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in java, i therefor split the strings in single chars and do fill an 2-dimensional array, at the end i can calculate the number of chars that differ. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now, how could i achieve the same thing in abap - maybe easier ? any idea for that ?&lt;/P&gt;&lt;P&gt;thank you !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 10:20:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013866#M411350</guid>
      <dc:creator>former_member5350</dc:creator>
      <dc:date>2007-03-09T10:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013867#M411351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok got it, do one thing take a temp variable of char 1 ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then pass the charecters of the string one by one to that temp value and append the value to an internal table.clear the temp variable.and do it again,use some do staement for this now how to split the string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp = string+0(1). gives first char&lt;/P&gt;&lt;P&gt;temp = string+1(1). second&lt;/P&gt;&lt;P&gt;temp = string+2(1). third &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc etc for further details read this stuff&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Character Strings in Release 6.10 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Release 6.10 the following new functions are available for character strings: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Establishing the length and number of characters &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. New instructions FIND and REPLACE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Faster access to strings &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Support for strings in the database &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Defining string constants &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. Introduction of string literals &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 1 &lt;/P&gt;&lt;P&gt;Establishing the length and number of characters &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function CHARLEN provides the length of the first character of a string or of a character-type field. &lt;/P&gt;&lt;P&gt;You can use NUMOFCHAR to obtain the number of characters in a string or a character-type field. &lt;/P&gt;&lt;P&gt;DBMAXLEN provides the maximum length of the string as stored in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 2 &lt;/P&gt;&lt;P&gt;New instructions FIND and REPLACE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a new statement,FIND, for searching in character strings. This replaces the SEARCH command. For replacing characters in character strings the statement REPLACE has been enhanced to include position-based replacement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 3 &lt;/P&gt;&lt;P&gt;Faster access to strings &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Offset/length access is now the fastest way to process a string character by character. This technique is also faster than searching in a field of type C that is assigned to a field symbol. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 4 &lt;/P&gt;&lt;P&gt;Support for strings in the database &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As from Release 6.10, character strings and binary data can be stored in database columns of types STRING or RAWSTRING. The system differentiates between short and long strings: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short strings consist of a maximum of 256 characters, do not have trailing spaces and can be compared on the database. &lt;/P&gt;&lt;P&gt;Long strings can be of any length and do have trailing spaces; however they cannot be compared on the database. &lt;/P&gt;&lt;P&gt;When working with strings some restrictions have to be observed. Further details are available here. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 5 &lt;/P&gt;&lt;P&gt;Defining string constants &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Strings can now also be defined as constants and can be given an initial value using the keyword VALUE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants: STR1 type string value 'ABC'. &lt;/P&gt;&lt;P&gt;data:      STR2 type string value 'XYZ'. &lt;/P&gt;&lt;P&gt;STR2 = STR1. &lt;/P&gt;&lt;P&gt;STR1 = STR2.              "Syntax error &lt;/P&gt;&lt;P&gt;write: / STR1, STR2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modification 6 &lt;/P&gt;&lt;P&gt;Introduction of string literals &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;String literals are enclosed by grave accents (`)of the form str = `ABC`. String literals are of data type STRING and trailing spaces are taken into account, as opposed to text literals. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: STR1 type string value 'ABC  ', &lt;/P&gt;&lt;P&gt;      STR2 type string value `ABC  `, &lt;/P&gt;&lt;P&gt;      CNT1 type i, &lt;/P&gt;&lt;P&gt;      CNT2 type i. &lt;/P&gt;&lt;P&gt;CNT1 = strlen( STR1 ). &lt;/P&gt;&lt;P&gt;CNT2 = strlen( STR2 ). &lt;/P&gt;&lt;P&gt;write: / CNT1, CNT2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The length for the string STR1 will be CNT1 = 3 and for the string STR2 it will be CNT2 = 5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 10:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013867#M411351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T10:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013868#M411352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Vikaas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the enligthenment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just tried this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA:
    s type string value ` abc `,
    l type i,
  l = NUMOFCHAR( s ). "=&amp;gt; 4
  l = STRLEN( s ).    "=&amp;gt; 5 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not understand the NUMOFCHAR function. Does it not count trailing blanks?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I'm happy text processing in ABAP finally is going to be fun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 10:55:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013868#M411352</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-03-09T10:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013869#M411353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ABAP_KEY&amp;amp;NUMOFCHAR &lt;/P&gt;&lt;P&gt;Returns the number of characters of a character-type field. In Unicode systems and non-Unicode systems with single-byte codepages, this function behaves like STRLEN. In non-Unicode systems with double-byte codepages, characters that take up more than one byte are counted with length 1, while STRLEN returns length 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and reward point if of any use&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 10:58:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013869#M411353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T10:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013870#M411354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The string has 3 non-blank characters and 2 spaces. I'd expect results as 3 or 5. Whre does the 4 come from?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Copying the online help does not help if it does not explain this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 11:05:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013870#M411354</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-03-09T11:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013871#M411355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clemens,&lt;/P&gt;&lt;P&gt;   I think the result would be 4 in both cases.&lt;/P&gt;&lt;P&gt;Both strlen and numofchar don't count the trailing spaces. (Counts the leading space though).&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 11:12:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013871#M411355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-09T11:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013872#M411356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you may have noticed, I used back hyphens (`, french accent grâve) to enclose the string value. I know that this will not remove the leading and trailing spaces i.e. using concatenate. So I expected the result as 5 in both cases. Still the difference between NUMOFCHAR and STRLEN is not clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2007 12:08:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013872#M411356</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-03-09T12:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to build a Java Array in ABAP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013873#M411357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi to all, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the solution that i found:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PERFORM dist USING string1 string2.

FORM dist USING p1 p2 TYPE string.


  TYPES:
  Begin OF str_array,
        str1 TYPE string,
        str2 TYPE string,
        END OF str_array.

  DATA: l_str_array TYPE str_array.

  DATA: l_tab_array TYPE STANDARD TABLE OF str_array.


  data: temp1(1) TYPE c,
        temp2(1) TYPE c,
        flag TYPE i,
        string_temp TYPE string,
        s1 TYPE string,
        s2 TYPE string,
        s1_length TYPE i,
        s2_length TYPE i,
        n1 TYPE i,
        n2 TYPE i,
        s1_i TYPE c,
        s2_i TYPE c,
        count TYPE i,
        dupl TYPE p DECIMALS 2.

  s1 = p1.
  s2 = p2.

  s1_length = strlen( s1 ).
  s2_length = strlen( s2 ).


  IF s1_length lt s2_length.

       string_temp = s1.
       s1 = s2.
       s2 = string_temp.

       s1_length = strlen( s1 ).
       s2_length = strlen( s2 ).
       flag = 1.

  ENDIF.


  IF s1_length ge s2_length.
    
       

    WHILE n1 ne s1_length.


      temp1 = s1+n1(1).


      IF n1 lt s2_length.
        temp2 = s2+n1(1).

      ELSE.
        temp2 = ''.
       count = count - 1.
      ENDIF.

      IF temp1 ne temp2.
        count = count + 1.
      ENDIF.


      IF flag = 0.
      l_str_array-str1 = temp1.
      l_str_array-str2 = temp2.
      ELSE.
      l_str_array-str1 = temp2.
      l_str_array-str2 = temp1.
      ENDIF.

      APPEND l_str_array TO l_tab_array .


      n1 = n1 + 1.

    ENDWHILE.


    LOOP AT l_tab_array INTO l_str_array.

      WRITE: l_str_array-str1.

    ENDLOOP.

    ULINE.

    LOOP AT l_tab_array INTO l_str_array.
      WRITE: l_str_array-str2.
    ENDLOOP.

    dupl = 100 - ( count * 100 ) / s1_length.
    WRITE: (20)dupl,' %'.

ENDIF.

ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 14:03:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-build-a-java-array-in-abap/m-p/2013873#M411357</guid>
      <dc:creator>former_member5350</dc:creator>
      <dc:date>2007-03-12T14:03:31Z</dc:date>
    </item>
  </channel>
</rss>

