<?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: unpack command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524051#M571569</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan,&lt;/P&gt;&lt;P&gt; Let me share some p[oints with you.&lt;/P&gt;&lt;P&gt;Unpacks the packed field f and places it in the field g with leading zeros. If g is too short, it is truncated on the left. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is the example forUNPACK command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UNPACK report_tab1-vbeln TO report_tab1-vbeln.&lt;/P&gt;&lt;P&gt;Hope this helps you. Reply for queries, shall post the updates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.  &lt;/P&gt;&lt;P&gt;Kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jul 2007 03:15:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-10T03:15:58Z</dc:date>
    <item>
      <title>unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524047#M571565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai guru's....&lt;/P&gt;&lt;P&gt;can u send me some material on unpack command ...and also can send me the definition and where we actulally use it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnaks&lt;/P&gt;&lt;P&gt;PAvan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 02:53:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524047#M571565</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T02:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524048#M571566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt; UNPACK&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Converts type P variables to type C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Syntax&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UNPACK &amp;lt;f&amp;gt; TO &amp;lt;g&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unpacks the packed field &amp;lt;f&amp;gt; and places it in the string &amp;lt;g&amp;gt; with leading zeros. This can be reversed with the PACK statement.(The opposite of PACK).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what is PACK :&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;PACK&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Converts type C variables into type P. &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;Syntax&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PACK &amp;lt;f&amp;gt; TO &amp;lt;g&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Packs the string &amp;lt;f&amp;gt; and places it in the field &amp;lt;g&amp;gt;. This can be reversed with the UNPACK statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;UNPACK&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unpacks the packed field f and places it in the field g with leading zeros. If g is too short, it is truncated on the left. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;DATA: P_FIELD(2) TYPE P VALUE 103, &lt;/P&gt;&lt;P&gt;C_FIELD(4) TYPE C. &lt;/P&gt;&lt;P&gt;UNPACK P_FIELD TO C_FIELD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE: / C_FIELD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  unpack command is used to remove the sign from a packed variable and appends zeroes in the left.like unpack p1(-2.5) to c1(length 6)..c1 will be 000025.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward pts if found usefull :)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 03:01:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524048#M571566</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T03:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524049#M571567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;UNPACK source TO destination.&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;This statement converts the content of the data object source according to a specific rule and assigns the converted content to data object destination. For source, the data type p of length 16 without decimal places is expected. The data type of destination must be character-type and flat.&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;The conversion is performed according to the following rules:&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the data type of source is not of the type p with length 16 and without decimal places, then the content of source is converted to this data type. Contrary to the rules described in conversion rules for elementary data types, any decimal separator in source is completely ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The digits of the interim result are assigned to data object destination right-aligned and without &amp;lt;b&amp;gt;+/-&amp;lt;/b&amp;gt; sign. Any additional places in destination are filled with leading zeros. If the length of destination is not sufficient, the assigned variable is truncated from the left. &lt;/P&gt;&lt;P&gt;&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: pack  TYPE p LENGTH 8 DECIMALS 3 VALUE '123.456', 
      char1 TYPE c LENGTH 10, 
      char2 TYPE c LENGTH 10. 

MOVE   pack TO char1. 
UNPACK pack TO char2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;output  will be :&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;char1  -&amp;gt;   "123.456" &lt;/P&gt;&lt;P&gt; char2  -&amp;gt; "0000123456&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward  points if it is usefull ....&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 03:10:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524049#M571567</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T03:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524050#M571568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan,&lt;/P&gt;&lt;P&gt; Let me share some p[oints with you.&lt;/P&gt;&lt;P&gt;Unpacks the packed field f and places it in the field g with leading zeros. If g is too short, it is truncated on the left. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is the example forUNPACK command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UNPACK report_tab1-vbeln TO report_tab1-vbeln.&lt;/P&gt;&lt;P&gt;Hope this helps you. Reply for queries, shall post the updates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.  &lt;/P&gt;&lt;P&gt;Kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 03:15:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524050#M571568</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T03:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524051#M571569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pavan,&lt;/P&gt;&lt;P&gt; Let me share some p[oints with you.&lt;/P&gt;&lt;P&gt;Unpacks the packed field f and places it in the field g with leading zeros. If g is too short, it is truncated on the left. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is the example forUNPACK command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UNPACK report_tab1-vbeln TO report_tab1-vbeln.&lt;/P&gt;&lt;P&gt;Hope this helps you. Reply for queries, shall post the updates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.  &lt;/P&gt;&lt;P&gt;Kumar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 03:15:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524051#M571569</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T03:15:58Z</dc:date>
    </item>
  </channel>
</rss>

