<?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/2524100#M571602</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;UNPACK &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basic form &lt;/P&gt;&lt;P&gt;UNPACK f TO g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &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;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;P_FIELD: P'103C' --&amp;gt; C_FIELD: C'0103' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;If f is not type P, it is converted to type P (see MOVE). &lt;/P&gt;&lt;P&gt;g should always be type C. Otherwise, unwanted side effects may occur. &lt;/P&gt;&lt;P&gt;The sign in the packed number is ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions &lt;/P&gt;&lt;P&gt;Catchable Exceptions &lt;/P&gt;&lt;P&gt;CX_SY_ASSIGN_OUT_OF_RANGE &lt;/P&gt;&lt;P&gt;Cause: Overflow during conversion (type P) &lt;/P&gt;&lt;P&gt;Runtime Error: BCD_FIELD_OVERFLOW (catchable) &lt;/P&gt;&lt;P&gt;CX_SY_CODEPAGE_CONVERTER_INIT &lt;/P&gt;&lt;P&gt;Cause: Source field cannot be interpreted as a number &lt;/P&gt;&lt;P&gt;Runtime Error: CONVT_NO_NUMBER (catchable) &lt;/P&gt;&lt;P&gt;CX_SY_CONVERSION_NO_NUMBER &lt;/P&gt;&lt;P&gt;Cause: Overflow during conversion (all types except type P) &lt;/P&gt;&lt;P&gt;Runtime Error: CONVT_OVERFLOW (catchable) &lt;/P&gt;&lt;P&gt;CX_SY_CONVERSION_OVERFLOW &lt;/P&gt;&lt;P&gt;Cause: Overflow during conversion (type P) &lt;/P&gt;&lt;P&gt;Runtime Error: BCD_OVERFLOW (catchable) &lt;/P&gt;&lt;P&gt;Non-Catchable Exceptions &lt;/P&gt;&lt;P&gt;Cause: Source field (type P) does not contain a valid BCD format &lt;/P&gt;&lt;P&gt;Runtime Error: BCD_BADDATA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jul 2007 02:58:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-10T02:58:17Z</dc:date>
    <item>
      <title>unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524099#M571601</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:54:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524099#M571601</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T02:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524100#M571602</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;UNPACK &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basic form &lt;/P&gt;&lt;P&gt;UNPACK f TO g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &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;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;P_FIELD: P'103C' --&amp;gt; C_FIELD: C'0103' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;If f is not type P, it is converted to type P (see MOVE). &lt;/P&gt;&lt;P&gt;g should always be type C. Otherwise, unwanted side effects may occur. &lt;/P&gt;&lt;P&gt;The sign in the packed number is ignored. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions &lt;/P&gt;&lt;P&gt;Catchable Exceptions &lt;/P&gt;&lt;P&gt;CX_SY_ASSIGN_OUT_OF_RANGE &lt;/P&gt;&lt;P&gt;Cause: Overflow during conversion (type P) &lt;/P&gt;&lt;P&gt;Runtime Error: BCD_FIELD_OVERFLOW (catchable) &lt;/P&gt;&lt;P&gt;CX_SY_CODEPAGE_CONVERTER_INIT &lt;/P&gt;&lt;P&gt;Cause: Source field cannot be interpreted as a number &lt;/P&gt;&lt;P&gt;Runtime Error: CONVT_NO_NUMBER (catchable) &lt;/P&gt;&lt;P&gt;CX_SY_CONVERSION_NO_NUMBER &lt;/P&gt;&lt;P&gt;Cause: Overflow during conversion (all types except type P) &lt;/P&gt;&lt;P&gt;Runtime Error: CONVT_OVERFLOW (catchable) &lt;/P&gt;&lt;P&gt;CX_SY_CONVERSION_OVERFLOW &lt;/P&gt;&lt;P&gt;Cause: Overflow during conversion (type P) &lt;/P&gt;&lt;P&gt;Runtime Error: BCD_OVERFLOW (catchable) &lt;/P&gt;&lt;P&gt;Non-Catchable Exceptions &lt;/P&gt;&lt;P&gt;Cause: Source field (type P) does not contain a valid BCD format &lt;/P&gt;&lt;P&gt;Runtime Error: BCD_BADDATA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 02:58:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524100#M571602</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T02:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524101#M571603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pavan,&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;Don't forget to reward if useful...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 03:05:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524101#M571603</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T03:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524102#M571604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check these out..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="161072"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/horst.keller/blog/2004/10/18/abap-geek-1--abap-program-attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="67060"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="30837"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 03:06:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524102#M571604</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T03:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: unpack command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524103#M571605</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;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&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 +/- 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;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;&amp;lt;b&amp;gt;output will be : &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&amp;lt;/b&amp;gt;&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:14:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unpack-command/m-p/2524103#M571605</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T03:14:39Z</dc:date>
    </item>
  </channel>
</rss>

