<?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 Processing with Pipe Separators==&amp;gt;  '|' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515798#M237428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;split mystring at '|' into var1 var2... varx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Aug 2006 20:04:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-31T20:04:09Z</dc:date>
    <item>
      <title>String Processing with Pipe Separators==&gt;  '|'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515796#M237426</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 have a String of variable lenght but with a separator '|'. I have to pick the values between the separator and put into different variables for further processing. Can any one please help me a good solutionfor this requirement? If there is no value between separator, it has to be considered as the "BLANK" value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1|6 915912       |00S|||||KE| |HALB|M|00801A||EA|  ||||PRMS|||||||||||||||||||0001||15||0||||||||0|0|0|||||||||||||||||||||||KE||P ||20060701||||||||||||||00|||||NORM||||||||||||||||||||&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Kannan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kannan SA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kannan SA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 20:01:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515796#M237426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T20:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: String Processing with Pipe Separators==&gt;  '|'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515797#M237427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use SpLIT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT lstr AT '|' into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--you can define you table or structure itab with the apprioriate field names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anurag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Please check the syntax)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 20:03:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515797#M237427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T20:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: String Processing with Pipe Separators==&gt;  '|'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515798#M237428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;split mystring at '|' into var1 var2... varx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 20:04:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515798#M237428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T20:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: String Processing with Pipe Separators==&gt;  '|'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515799#M237429</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;Check this sample code , check how split statement is used to process the strings with pipe symbols: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of i_tab1 occurs o,
       fld(100) type c.
       end of i_tab1.


DATA: BEGIN OF i_DATA occurs 0,
MATNR(18), 
CHARG LIKE MCHA-CHARG, 
werks like mcha-werks, 
sdate(8) type c,
stats(1) type c, 
lifnr like mcha-lifnr,
licha like mcha-licha, 
lwedt like mcha-lwedt, 
END OF i_DATA.


use Itab1 for read data statement to get the data from file.

then loop itab1 like below:


loop at i_tab1.

&amp;lt;b&amp;gt;split itab1-fld at '|' into T_DATA-MATNR  
T_DATA-CHARG
T_DATA-werks 
T_DATA-sdate
T_DATA-stats
T_DATA-lifnr 
T_DATA-licha 
T_DATA-lwedt .&amp;lt;/b&amp;gt;
move T_DATA-MATNR  to i_DATA-MATNR  .
T_DATA-CHARG  to i_DATA--CHARG  .
....

append i_data.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally i_data will contains correct values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Laxman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Reward the points for helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 20:41:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515799#M237429</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-08-31T20:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: String Processing with Pipe Separators==&gt;  '|'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515800#M237430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anurag,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. Please have a look at the code below. It throws syntax error. I need to put the values into an internal table after spliting the string as i am not sure of the length of the Original String.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : begin of t_string,&lt;/P&gt;&lt;P&gt;       record type string,&lt;/P&gt;&lt;P&gt;       end of t_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lt_string type table of t_string with header line.&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;split lv_string at '|' into table lt_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Kannan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 21:11:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515800#M237430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T21:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: String Processing with Pipe Separators==&gt;  '|'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515801#M237431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is the definition of lt_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its structure should be the one as you require after the splitting of record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example if you first field is company code followed by plant etc..than the structure of lt_string should &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of lt_string occurs 0,&lt;/P&gt;&lt;P&gt;  company(4),&lt;/P&gt;&lt;P&gt;  plant(4),&lt;/P&gt;&lt;P&gt;end of lt_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Dont forget to give points for useful answers --&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Anurag Bankley&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 21:17:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515801#M237431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T21:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: String Processing with Pipe Separators==&gt;  '|'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515802#M237432</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;  Declare the internal table like this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lt_string type table of string with header line.&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;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Aug 2006 21:17:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-processing-with-pipe-separators-gt/m-p/1515802#M237432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-31T21:17:56Z</dc:date>
    </item>
  </channel>
</rss>

