<?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 with string length manipulation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105944#M104780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I resolved this issue. In the below FIND statement I've replaced c_len with -1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;old code&lt;/P&gt;&lt;P&gt;find '\RMR' in section offset i_pos length c_len of long_text_str match offset i_pos.&lt;/P&gt;&lt;P&gt;New code&lt;/P&gt;&lt;P&gt;find '\RMR' in section offset i_pos length -1 of long_text_str match offset i_pos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it will search for that string '\RMR' starting from i_pos and it'll find till the end of the staring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for all your suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Nov 2005 15:11:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-11-08T15:11:15Z</dc:date>
    <item>
      <title>problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105936#M104772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is one requirement where I've to take a string with variable length. But this program is using 'Find String Offset off length len of var_string' syntax to find out a substring within this string. &lt;/P&gt;&lt;P&gt;What is happening right now is when I use this syntax , program is giving short dump which I'm attaching here - \&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for the exception is:                                              &lt;/P&gt;&lt;P&gt;The running program, "SAPLXFOR", tried to access the field "LONG_TEXT_STR", which has a &lt;/P&gt;&lt;P&gt;length of 65535, using "SECTION OFFSET 409 LENGTH 65535". The SECTION addition is only correct if the substring specified in the offset/length  lies entirely within the field "LONG_TEXT_STR".                              &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody suggest me how I can prevent this dump.&lt;/P&gt;&lt;P&gt;What I believe that I've to increase the length of the variable of the string just before 'Find ' statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2005 04:06:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105936#M104772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-06T04:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105937#M104773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you paste your code.  If you declare a string, SAP will handle the length and you dont have to mention the length.  Try declaring the variable as string and see if the program still dumps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sunil Achyut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2005 04:21:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105937#M104773</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-06T04:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105938#M104774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the extract of the code. I've already yried by taking the data  type as string but when we call find with offset and length , the sum of offset and length becomes bigger than string length and because of this it's giving dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls suggest me if there is any other way -&lt;/P&gt;&lt;P&gt;*Data Declaration&lt;/P&gt;&lt;P&gt;data : ak_len3 type i,&lt;/P&gt;&lt;P&gt;       ak_len2 type i,&lt;/P&gt;&lt;P&gt;       ak_len4 type i,&lt;/P&gt;&lt;P&gt;       ak_len1 type i,&lt;/P&gt;&lt;P&gt;       ak_len type i,&lt;/P&gt;&lt;P&gt;       c_len1 type i,&lt;/P&gt;&lt;P&gt;       text_str(500).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : textstr(80),&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      long_text_str(65535),&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       long_text_str type string,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      long_text_str1(65535),&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       long_text_str type string,&lt;/P&gt;&lt;P&gt;       long_txt_str(80),&lt;/P&gt;&lt;P&gt;       i_len type i,&lt;/P&gt;&lt;P&gt;       c_len type i,&lt;/P&gt;&lt;P&gt;       c_i type i,&lt;/P&gt;&lt;P&gt;       c_i1 type i,&lt;/P&gt;&lt;P&gt;       i_pos type i,&lt;/P&gt;&lt;P&gt;       c_pos type i,&lt;/P&gt;&lt;P&gt;       CNT_820_SEG          TYPE P,    "sum 820 records tx set (ST-SE)&lt;/P&gt;&lt;P&gt;       cnt_count type i,&lt;/P&gt;&lt;P&gt;       cnt_count1(6),&lt;/P&gt;&lt;P&gt;       cnt_text(10),&lt;/P&gt;&lt;P&gt;       c_txt,&lt;/P&gt;&lt;P&gt;       c_text1,&lt;/P&gt;&lt;P&gt;       i_lifnr like t_regup-lifnr, " Vendor No&lt;/P&gt;&lt;P&gt;       i_ebeln like t_regup-ebeln, " PO No (for LIV Invoices only)&lt;/P&gt;&lt;P&gt;       i_xblnr like t_regup-xblnr, " Reference #(Vendor's Invoice no)&lt;/P&gt;&lt;P&gt;       i_budat like t_regup-budat, " Document Date&lt;/P&gt;&lt;P&gt;       i_sgtxt like bseg-sgtxt,    " Vendor Line Item Text&lt;/P&gt;&lt;P&gt;       i_belnr like t_regup-belnr,  " SAP Document No&lt;/P&gt;&lt;P&gt;*002 ++ BEGIN&lt;/P&gt;&lt;P&gt;       i_pos1 type i,&lt;/P&gt;&lt;P&gt;       i_pos2 type i.&lt;/P&gt;&lt;P&gt;*002 ++ END&lt;/P&gt;&lt;P&gt;clear long_text_str.&lt;/P&gt;&lt;P&gt;ak_len1 = strlen( long_text_str ).&lt;/P&gt;&lt;P&gt;*Move all the data from internal table T_DTAMUSADD into a string&lt;/P&gt;&lt;P&gt;loop at T_DTAMUSADD .&lt;/P&gt;&lt;P&gt;if sy-tabix = 1.&lt;/P&gt;&lt;P&gt;move T_DTAMUSADD-add3 to long_text_str.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;move T_DTAMUSADD-add3 to long_txt_str.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate long_text_str long_txt_str into long_text_str.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Search for '\SE' to get the position&lt;/P&gt;&lt;P&gt;search long_text_str for '\SE'.&lt;/P&gt;&lt;P&gt;*002 ++ BEGIN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_pos = sy-fdpos.&lt;/P&gt;&lt;P&gt;i_pos = i_pos + 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move long_text_str+i_pos(2) to cnt_count1.&lt;/P&gt;&lt;P&gt;if cnt_count1 cs '*'.&lt;/P&gt;&lt;P&gt;replace '*' in cnt_count1 with ' '.&lt;/P&gt;&lt;P&gt;condense cnt_count1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move cnt_count1 to cnt_count.&lt;/P&gt;&lt;P&gt;search long_text_str for '\ENT*1\'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i_pos = sy-fdpos.&lt;/P&gt;&lt;P&gt;i_lifnr = t_regup-lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Insert new Segment 'REF&lt;/STRONG&gt;VR' here.&lt;/P&gt;&lt;P&gt;concatenate long_text_str(i_pos) '\' 'REF&lt;STRONG&gt;VR&lt;/STRONG&gt;' i_lifnr&lt;/P&gt;&lt;P&gt;                        long_text_str+i_pos into long_text_str.&lt;/P&gt;&lt;P&gt;cnt_count = cnt_count + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Added for multiple invoices&lt;/P&gt;&lt;P&gt;*Search for '\RMR to get the multiple invoices&lt;/P&gt;&lt;P&gt;c_len = strlen( long_text_str ).&lt;/P&gt;&lt;P&gt;clear i_pos.&lt;/P&gt;&lt;P&gt;search long_text_str for '\RMR'.&lt;/P&gt;&lt;P&gt;i_pos = sy-fdpos.&lt;/P&gt;&lt;P&gt;i_pos = i_pos + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;find '\RMR' in section offset i_pos length c_len of long_text_str match offset i_pos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Alok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2005 04:51:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105938#M104774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-06T04:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105939#M104775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With all the offset operations, you have to make sure that the offset you are using is valid. So you have always check your offset length against the total length of the field before you do the offset.&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;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2005 17:20:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105939#M104775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-06T17:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105940#M104776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alok,&lt;/P&gt;&lt;P&gt;maybe splitting the long string into a table with smaller chunks removes the need to search with offset at all. This might also help to make the code more readable.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2005 23:30:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105940#M104776</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2005-11-06T23:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105941#M104777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also remember, strlen function will return you zero if the string has no content.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2005 00:33:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105941#M104777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-07T00:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105942#M104778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are not looking for sy-subrc value after your SEARCH statements. It is very important because you are using SY-FDPOS after that which may be zero and cause the dump. Debug it and you will know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2005 00:34:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105942#M104778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-07T00:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105943#M104779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Srinivas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working in MRKO transaction, which is to create accounting document using vendor and material documet. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem is EXCHANGE RATE. I have to create accounting document as per Vendor suggested exchange rate, Not per system caliculated exchange rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what i thought was, We have some exits in MRKO transaction. For each vendor we will ask user to get Vendor exchange rate and proceed with that rate. But system is taking exchange rate maintenained in system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Challange is: I have to create accounting document as per Vendor suggested exchange rate, Not per system caliculated exchange rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any body help me on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Rays&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2005 02:15:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105943#M104779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-07T02:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105944#M104780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I resolved this issue. In the below FIND statement I've replaced c_len with -1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;old code&lt;/P&gt;&lt;P&gt;find '\RMR' in section offset i_pos length c_len of long_text_str match offset i_pos.&lt;/P&gt;&lt;P&gt;New code&lt;/P&gt;&lt;P&gt;find '\RMR' in section offset i_pos length -1 of long_text_str match offset i_pos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it will search for that string '\RMR' starting from i_pos and it'll find till the end of the staring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for all your suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 15:11:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105944#M104780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-08T15:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: problem with string length manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105945#M104781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please close the post if it is resolved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2005 16:04:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-string-length-manipulation/m-p/1105945#M104781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-08T16:04:59Z</dc:date>
    </item>
  </channel>
</rss>

