<?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: String operations on error messages in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395054#M1924710</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;what you can do is getting the last 8 chars of your string.&lt;/P&gt;&lt;P&gt;data(lv_offset) = strlen(message_v1)&lt;/P&gt;&lt;P&gt;lv_offset = lv_offset - 8.&lt;/P&gt;&lt;P&gt;move message_v1+(lv_offset)&amp;nbsp; to lv_user_id &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Nov 2015 13:27:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-11-10T13:27:38Z</dc:date>
    <item>
      <title>String operations on error messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395053#M1924709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; i would to get only the SAP user id in the error message which would be 8 characters .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me in getting the below output. I would require only the last 8 characters of the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL style="list-style-type: upper-roman;"&gt;&lt;LI&gt;InputàMaterial 000000692122&amp;nbsp; is lock y PRESTOGE&amp;nbsp;&amp;nbsp; (string having any number of characters)&lt;/LI&gt;&lt;LI&gt;Outputà PRESTOGE&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/828269" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ranjith.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 13:18:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395053#M1924709</guid>
      <dc:creator>Ranjith_D_Reddy</dc:creator>
      <dc:date>2015-11-10T13:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: String operations on error messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395054#M1924710</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;what you can do is getting the last 8 chars of your string.&lt;/P&gt;&lt;P&gt;data(lv_offset) = strlen(message_v1)&lt;/P&gt;&lt;P&gt;lv_offset = lv_offset - 8.&lt;/P&gt;&lt;P&gt;move message_v1+(lv_offset)&amp;nbsp; to lv_user_id &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 13:27:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395054#M1924710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-11-10T13:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: String operations on error messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395055#M1924711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ranjith,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pass X_MSG_TAB data to FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'FORMAT_MESSAGE' "&lt;/P&gt;&lt;P&gt;* EXPORTING&lt;/P&gt;&lt;P&gt;* id = SY-MSGID " Application Area&lt;/P&gt;&lt;P&gt;* lang = '-D' "&lt;/P&gt;&lt;P&gt;* no = SY-MSGNO "&lt;/P&gt;&lt;P&gt;* v1 = SY-MSGV1 " 1st parameter&lt;/P&gt;&lt;P&gt;* v2 = SY-MSGV2 " 2nd parameter&lt;/P&gt;&lt;P&gt;* v3 = SY-MSGV3 " 3rd parameter&lt;/P&gt;&lt;P&gt;* v4 = SY-MSGV4 " 4th Parameter&lt;/P&gt;&lt;P&gt;&amp;nbsp; IMPORTING&lt;/P&gt;&lt;P&gt;&amp;nbsp; msg =&amp;nbsp; &lt;STRONG&gt;MESSAGE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; EXCEPTIONS&lt;/P&gt;&lt;P&gt;&amp;nbsp; NOT_FOUND = 1 "&lt;/P&gt;&lt;P&gt;&amp;nbsp; . " FORMAT_MESSAGE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so you will get complete message "&lt;SPAN style="color: #333333; font-size: 12px;"&gt;Input Material 000000692122&amp;nbsp; is locked by PRESTOGE" in Message variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that Use Split command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: text type string,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; username type sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT MESSAGE AT 'by' into text username.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Username variable you will get PRESTOGE.&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;Regards,&lt;/P&gt;&lt;P&gt;Ashish Desai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 13:35:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395055#M1924711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-11-10T13:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: String operations on error messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395056#M1924712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your assumption is wrong. The user ID maynot be always 8 characters ( It can be upto 12 characters )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also looking at the message M3 023 - "The group data for the material &amp;amp; is locked by &amp;amp;" your population of MESSAGE_V1 and MESSAGE_V2 is not right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would not go for offset as I explained in the first paragraph.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would use&lt;/P&gt;&lt;P&gt;1.concatenate &lt;SPAN style="font-size: 13.3333px;"&gt;MESSAGE_V1 and MESSAGE_V2 into a &amp;lt;string&amp;gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Split string at space into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Will read the last line of Itab and get the user ID.&lt;/P&gt;&lt;P&gt;data(lv_lines) = LINES(itab).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab index lv_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 13:37:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395056#M1924712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-11-10T13:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: String operations on error messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395057#M1924713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My 2 cents ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The message M3(022) is defined as - &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;The group data for the material &amp;amp; is locked by &amp;amp;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So basically the fields should be mapped as: &lt;SPAN style="font-size: 13.3333px;"&gt;MESSAGE_V1 = &amp;lt;material no.&amp;gt; &amp;amp; &lt;SPAN style="font-size: 13.3333px;"&gt;MESSAGE_V2 = &amp;lt;user name&amp;gt;. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I would suggest you to correct the source table X_MSG_TAB, because &lt;SPAN style="font-size: 13.3333px;"&gt;IMHO &lt;/SPAN&gt;the content is false. The message text should be mapped to the field MESSAGE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;BR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Suhas&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 14:20:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395057#M1924713</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2015-11-10T14:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: String operations on error messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395058#M1924714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, looking at the structure, it seems to be a custom development - No standard message structure would have just MESSAGE_V1 &amp;amp; V2 fields. Standard structures for messages will always have V1, V2, V3 and V4 fields. So, please fix the custom code, to pass back the values correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you just need the name of the person who locked the object, you can also call the function module&amp;nbsp; ENQUEUE_READ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Juwin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 17:14:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395058#M1924714</guid>
      <dc:creator>Juwin</dc:creator>
      <dc:date>2015-11-10T17:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: String operations on error messages</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395059#M1924715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What transaction code are you running?&lt;/P&gt;&lt;P&gt;When does this error message occur in the program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is a standard message, you can read the message class and number and go to the message table T100, read the message into a string variable and read the last 8 characters using the offset function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 18:05:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-operations-on-error-messages/m-p/11395059#M1924715</guid>
      <dc:creator>former_member182805</dc:creator>
      <dc:date>2015-11-10T18:05:04Z</dc:date>
    </item>
  </channel>
</rss>

