<?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: Search Command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453535#M550011</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI check these examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA string7(30) TYPE c VALUE 'This is a little sentence.'.&lt;/P&gt;&lt;P&gt;WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEARCH string7 FOR 'X'.&lt;/P&gt;&lt;P&gt;WRITE: / 'X', sy-subrc UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;               sy-fdpos UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;SEARCH string7 FOR 'itt   '.&lt;/P&gt;&lt;P&gt;WRITE: / 'itt   ', sy-subrc UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;                   sy-fdpos UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;SEARCH string7 FOR '.e .'.&lt;/P&gt;&lt;P&gt;WRITE: / '.e .', sy-subrc UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;                  sy-fdpos UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;SEARCH string7 FOR '*e'.&lt;/P&gt;&lt;P&gt;WRITE: / '*e ', sy-subrc UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;                sy-fdpos UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2007 15:38:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-20T15:38:02Z</dc:date>
    <item>
      <title>Search Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453528#M550004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I have an XML file and need to grab a couple of fields from that. Iam passing each record of the XML file into the internal table and below is what I see. I need to pull AUFNR, AUART, TIDNR and STTXT from the code.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam thinking of this logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. search for &amp;lt;AUFNR&amp;gt; in the string.&lt;/P&gt;&lt;P&gt;2. Pick 12 characters from &amp;lt;AUFNR&amp;gt; &lt;/P&gt;&lt;P&gt;3. Pass that value into another internal table for further processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similar with the other fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I need some help with the code. It would be really great if someone can help me with this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks much ~V&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="iso-8859-1"?&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"&amp;gt;&amp;lt;asx:values&amp;gt;&amp;lt;OUTPUT&amp;gt;&amp;lt;item&amp;gt;&amp;lt;AUFNR&amp;gt;000005000292&amp;lt;/AUFNR&amp;gt;&amp;lt;AUART&amp;gt;PM01&amp;lt;/AUART&amp;gt;&amp;lt;TIDNR/&amp;gt;&amp;lt;STTXT&amp;gt;REL  NMAT PRC  SETC&amp;lt;/STTXT&amp;gt;&amp;lt;/item&amp;gt;&amp;lt;/OUTPUT&amp;gt;&amp;lt;/asx:values&amp;gt;&amp;lt;/asx:abap&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:13:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453528#M550004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T15:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453529#M550005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;search for aufnr field and check sy-subrc and then use offset concept and pass that value to itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:18:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453529#M550005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T15:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453530#M550006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Find the ending position of &amp;lt;AUFNR&amp;gt; and the start position of &amp;lt;/AUFNR&amp;gt;. Use offsets to take everything between.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be careful if this can cross line breaks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:19:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453530#M550006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T15:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453531#M550007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What release of SAP are you using.  If in a new release, you can use the built in XML handling using the CALL TRANSFORMATIONs statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:21:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453531#M550007</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-06-20T15:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453532#M550008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/a8/824c3c66177414e10000000a114084/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/a8/824c3c66177414e10000000a114084/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:22:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453532#M550008</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-06-20T15:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453533#M550009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/e3/7d4719ca581441b6841f1054ff1326/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/e3/7d4719ca581441b6841f1054ff1326/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:24:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453533#M550009</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-06-20T15:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453534#M550010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou all  for the replies. We are on SAP Enterprise..I looked at the links I tried using the cal transformation unsucessfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, Iam new to the concept of offset, can anyone provide me a sample code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:30:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453534#M550010</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T15:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453535#M550011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI check these examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA string7(30) TYPE c VALUE 'This is a little sentence.'.&lt;/P&gt;&lt;P&gt;WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEARCH string7 FOR 'X'.&lt;/P&gt;&lt;P&gt;WRITE: / 'X', sy-subrc UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;               sy-fdpos UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;SEARCH string7 FOR 'itt   '.&lt;/P&gt;&lt;P&gt;WRITE: / 'itt   ', sy-subrc UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;                   sy-fdpos UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;SEARCH string7 FOR '.e .'.&lt;/P&gt;&lt;P&gt;WRITE: / '.e .', sy-subrc UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;                  sy-fdpos UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;SEARCH string7 FOR '*e'.&lt;/P&gt;&lt;P&gt;WRITE: / '*e ', sy-subrc UNDER 'SY-SUBRC',&lt;/P&gt;&lt;P&gt;                sy-fdpos UNDER 'SY-FDPOS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 15:38:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453535#M550011</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T15:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Search Command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453536#M550012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'll probably be better off pursuing the CALL TRANSFORMATION, but if you still decide to go the other way, you can try something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ztest MESSAGE-ID 00.

DATA: itab TYPE TABLE OF string WITH HEADER LINE,
      wa   TYPE string,
      order(12).

CONCATENATE: '&amp;lt;?xml version="1.0" encoding="iso-8859-1"?&amp;gt;'
'&amp;lt;asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"&amp;gt;'
'&amp;lt;asx:values&amp;gt;&amp;lt;OUTPUT&amp;gt;&amp;lt;item&amp;gt;&amp;lt;AUFNR&amp;gt;000005000292&amp;lt;/AUFNR&amp;gt;'
'&amp;lt;AUART&amp;gt;PM01&amp;lt;/AUART&amp;gt;&amp;lt;TIDNR/&amp;gt;'
'&amp;lt;STTXT&amp;gt;REL NMAT PRC SETC&amp;lt;/STTXT&amp;gt;'
'&amp;lt;/item&amp;gt;&amp;lt;/OUTPUT&amp;gt;&amp;lt;/asx:values&amp;gt;&amp;lt;/asx:abap&amp;gt; '
INTO wa.

SPLIT wa AT 'AUFNR&amp;gt;' INTO TABLE itab.

IF sy-subrc = 0.
  READ TABLE itab INDEX 2.
  REPLACE '&amp;lt;/' IN itab WITH space.
  order = itab.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the split instead of offsets to avoid problems with new lines. An I assume there is no more than one order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's not pretty but you can use it as a start.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2007 16:11:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/search-command/m-p/2453536#M550012</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-20T16:11:46Z</dc:date>
    </item>
  </channel>
</rss>

