<?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: problem in logic of the Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587605#M1273973</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;Try using regular expression.&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:l_text TYPE string,&lt;/P&gt;&lt;P&gt;     l_result type string.&lt;/P&gt;&lt;P&gt;DATA: moff TYPE i,&lt;/P&gt;&lt;P&gt;      mlen TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_text = 'test 1234  4567'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND REGEX ' .*' IN l_text&lt;/P&gt;&lt;P&gt;     MATCH OFFSET moff&lt;/P&gt;&lt;P&gt;     MATCH LENGTH mlen.&lt;/P&gt;&lt;P&gt;l_result = l_text+moff(mlen).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note that ' .*' means  one space follow by any character 0 or more times.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 10 May 2009 04:18:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-10T04:18:50Z</dc:date>
    <item>
      <title>problem in logic of the Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587604#M1273972</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 am working on FM in which i have to pass the value as string and it gives value that if there is a space in the string it will pick the rest of the string in the next value starting from the spcae. here's d code:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

IF TEXT1+20(1) EQ ' '.
          text2 = text1.
          text1 = text1+21(19).
          text3 = text1.

        ELSEIF TEXT1+19(1) EQ ' '.
          text2 = text1.
          text1 = text1+22(18).
          text3 = text1.
        elseif TEXT1+18(1) EQ ' '.
          text2 = text1.
          text1 = text1+23(17).
          text3 = text1.
        elseif TEXT1+17(1) EQ ' '.
          text2 = text1.
          text1 = text1+24(16).
          text3 = text1.
        elseif TEXT1+16(1) EQ ' '.
          text2 = text1.
          text1 = text1+25(15).
          text3 = text1.
        elseif TEXT1+15(1) EQ ' '.
          text2 = text1.
          text1 = text1+26(14).
          text3 = text1.
        elseif TEXT1+14(1) EQ ' '.
          text2 = text1.
          text1 = text1+27(13).
          text3 = text1.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here text1,text2 and text3 are TYPE QAMR--PRUEFBEMKT with length of 40 characters.&lt;/P&gt;&lt;P&gt;plzz provide me guidlines if there is any thing needed to rectified.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 May 2009 03:14:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587604#M1273972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-10T03:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: problem in logic of the Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587605#M1273973</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;Try using regular expression.&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:l_text TYPE string,&lt;/P&gt;&lt;P&gt;     l_result type string.&lt;/P&gt;&lt;P&gt;DATA: moff TYPE i,&lt;/P&gt;&lt;P&gt;      mlen TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_text = 'test 1234  4567'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND REGEX ' .*' IN l_text&lt;/P&gt;&lt;P&gt;     MATCH OFFSET moff&lt;/P&gt;&lt;P&gt;     MATCH LENGTH mlen.&lt;/P&gt;&lt;P&gt;l_result = l_text+moff(mlen).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;note that ' .*' means  one space follow by any character 0 or more times.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 May 2009 04:18:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587605#M1273973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-10T04:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: problem in logic of the Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587606#M1273974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ricx,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use FIND Construct provided in ABAP.&lt;/P&gt;&lt;P&gt;Here is the syntax:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FIND
IN [SECTION OFFSET LENGTH OF]
[IGNORING CASE|RESPECTING CASE]
[IN BYTE MODE|IN CHARACTER MODE]
[MATCH OFFSET ] [MATCH LENGTH ].
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can write something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: str(40) TYPE c,
           ctr TYPE i.

str = 'General ABAP'.

FIND FIRST OCCURRENCE OF REGEX ` ` IN str MATCH OFFSET ctr.
write ctr.
*Here 'SPACE exists at index 7 hence *ctr* will have value 7.*
*Now you can get rest string after SPACE by ctr+7[40]*
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shital&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 May 2009 04:28:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587606#M1273974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-10T04:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: problem in logic of the Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587607#M1273975</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;Now i had changing the logic of the code. is there any function module which count the characters of the string? bcoz i have to make the code globally as what ever the string pass it should be divided a value i.e. 20 and it should count spaces and display the text before a spcae is present.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plzzz provide me guidelines to solve this problem..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 May 2009 06:15:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587607#M1273975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-10T06:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: problem in logic of the Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587608#M1273976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get the lenght of string....we can use function &lt;STRONG&gt;STRLEN&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : L_LENGTH TYPE I,&lt;/P&gt;&lt;P&gt;           L_TEXT TYPE STRING.&lt;/P&gt;&lt;P&gt;L_TEXT = 'XYZ1234'.&lt;/P&gt;&lt;P&gt;L_LENGTH =  STRLEN ( L_TEXT ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESULT WILL BE :- &lt;/P&gt;&lt;P&gt;WRITE : 'LENGHT --&amp;gt;'  l_lenght.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANS:- 7&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 May 2009 07:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587608#M1273976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-10T07:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: problem in logic of the Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587609#M1273977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ricx ,&lt;/P&gt;&lt;P&gt;Please do not except SAP will provide Function module for all the simple things that programmer might require. There is rare possibility of something like that exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if you need to write Custom Function module to get String Length it will not be recommended, Somebody will used STRLEN rather than using your Function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clarifies.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shital&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 May 2009 08:07:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-logic-of-the-function-module/m-p/5587609#M1273977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-10T08:07:48Z</dc:date>
    </item>
  </channel>
</rss>

