<?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 Separating Data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/separating-data/m-p/927683#M60232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am a new to ABAP. I will really appreciate if someone can help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: A1 like I_ALLOCATION_TAB-OBJEK.&lt;/P&gt;&lt;P&gt;WRITE:/ A1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the value of A1 is 00000000000000079720100000000147&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually there are three datas in this one value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value One: 797&lt;/P&gt;&lt;P&gt;Vlaue Two: 2010&lt;/P&gt;&lt;P&gt;Value Three:147&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to separate these three data in three different variables.&lt;/P&gt;&lt;P&gt;How do I do it ? Is there some offset concept I have to use ?&lt;/P&gt;&lt;P&gt;If yes then how do we do it ?&lt;/P&gt;&lt;P&gt;Please help me out.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tushar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jun 2005 19:00:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-06-13T19:00:24Z</dc:date>
    <item>
      <title>Separating Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/separating-data/m-p/927683#M60232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am a new to ABAP. I will really appreciate if someone can help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: A1 like I_ALLOCATION_TAB-OBJEK.&lt;/P&gt;&lt;P&gt;WRITE:/ A1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the value of A1 is 00000000000000079720100000000147&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually there are three datas in this one value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Value One: 797&lt;/P&gt;&lt;P&gt;Vlaue Two: 2010&lt;/P&gt;&lt;P&gt;Value Three:147&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to separate these three data in three different variables.&lt;/P&gt;&lt;P&gt;How do I do it ? Is there some offset concept I have to use ?&lt;/P&gt;&lt;P&gt;If yes then how do we do it ?&lt;/P&gt;&lt;P&gt;Please help me out.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tushar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2005 19:00:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/separating-data/m-p/927683#M60232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-13T19:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Separating Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/separating-data/m-p/927684#M60233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are biforcating based on the positions, then it is real easy. Define a structure with three fields - assign A1 to that and you can write the structure fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of a2,&lt;/P&gt;&lt;P&gt;       v1(18), &lt;/P&gt;&lt;P&gt;       v2(04), &lt;/P&gt;&lt;P&gt;       v3(10),&lt;/P&gt;&lt;P&gt;      end  of a2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  a2 = A1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write: a2-v1, &lt;/P&gt;&lt;P&gt;       a2-v2, &lt;/P&gt;&lt;P&gt;       a2-v3. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Got the idea &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2005 19:06:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/separating-data/m-p/927684#M60233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-13T19:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Separating Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/separating-data/m-p/927685#M60234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tushar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use offset and length options as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA lv_str TYPE string .
 
lv_str = 'hello, how are you today' .
write:/ lv_str+7 ,
      / lv_str+7(3) ,
      / lv_str(7) .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how are you today&lt;/P&gt;&lt;P&gt;how&lt;/P&gt;&lt;P&gt;hello,&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;*--Serdar &amp;lt;a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d"&amp;gt;[ BC ]&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2005 20:39:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/separating-data/m-p/927685#M60234</guid>
      <dc:creator>ssimsekler</dc:creator>
      <dc:date>2005-06-13T20:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Separating Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/separating-data/m-p/927686#M60235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tushar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is an offset concpet in ABAP. And Serdar's example explains it. But generally, it is not a very generic approach to follow. The reason is simple that you are hardcoding the length and offset values. When somebody looks at the code, they might not have a clue as to why these offsets are being used with these values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, you have not mentioned what table you are getting the data from. But it appears that this OBJEK is some kind of an Object Key. In most case, according to the context of your application we would know beforehand what are all the values that this Object Key will give us. With this knowledge, it is best to have a field string (as suggested by Pramod) which would tell you what values we have for what fields. Consider the following example - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let us say I'm fetching data from a database table XYZ, which has this field OBJEK. Now in my contaxt, this OBJEK should give me the values of the customers' sales areas. I would have a field string which would be defined something like this -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data : begin of objek,
         kunnr type kunnr,
         vkorg type vkorg,
         vtweg type vtweg,
         spart type spart,
       end of objek.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My SELECT query would look something like this  - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT OBJEK
  INTO OBJEK
  FROM XYZ.
  WRITE : / OBJEK-KUNNR,
            OBJEK-VKORG,
            OBJEK-VTWEG,
            OBJEK-SPART.
ENDSELECT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if you look at OBJEK as a whole, it would smply be a string of 18 characters. The fact that the first 10 characters are actually the customer number, the next 4 are the sales organization, the next tow are the distribution channel and the last two are the division, is not really apparent without the definition of the field string (or a &amp;lt;i&amp;gt;structure&amp;lt;/i&amp;gt; as somw would prefer to call it).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope I have been able to make some sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2005 04:26:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/separating-data/m-p/927686#M60235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-06-14T04:26:46Z</dc:date>
    </item>
  </channel>
</rss>

