<?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: Function Module for Unpacking a shipment in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-unpacking-a-shipment/m-p/5308846#M1224137</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 link &lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6319412"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Qamar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Mar 2009 12:48:31 GMT</pubDate>
    <dc:creator>qamar_javed</dc:creator>
    <dc:date>2009-03-19T12:48:31Z</dc:date>
    <item>
      <title>Function Module for Unpacking a shipment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-unpacking-a-shipment/m-p/5308845#M1224136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I have to pack an HU for a material.&lt;/P&gt;&lt;P&gt;Follow the code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ls_huid = '00000000001000102236'.
APPEND ls_huid TO lt_huid.
ls_venum = '00000000001000102236'.
APPEND ls_venum TO lt_venum.

CALL FUNCTION 'HU_GET_HUS'
 EXPORTING
*   IF_OBJECT                =
*   IF_NO_DB_SELECT          = ' '
   if_lock_hus              = 'X'
*   IF_WITH_TEXT             = ' '
*   IF_NO_LOOP               = 'X'
   if_more_hus              = 'X'
*   IS_OBJECTS               =
*   IT_OBJECTS               =
   it_hus                   = lt_huid
   it_venum                 = lt_venum
*   IT_HANDLE                =
*   IF_MARA_PACKMITTEL       = ' '
 IMPORTING
   et_header                = lt_header
   et_items                 = lt_items
*   ET_ITEM_SERIALNO         =
*   ET_HISTORY               =
*   ET_HIGHEST_LEVELS        =
*   ET_MESSAGES              =
 EXCEPTIONS
   hus_locked               = 1
   no_hu_found              = 2
   fatal_error              = 3
   OTHERS                   = 4          .

IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ls_p_req-venum = '0000101938'.
ls_p_req-exidv = '00000000001000102236'.
ls_p_req-belnr = '1050000440'.
ls_p_req-posnr = '000020'.
ls_p_req-quantity = '1.000'.
ls_p_req-altme    = 'ST'.
ls_p_req-meins    = 'ST'.
ls_p_req-werks    = 'DE20'.
ls_p_req-velin    = '1'.
ls_p_req-matnr = 'LD0000000100000095'.
ls_p_req-gewei = 'KG'.
ls_p_req-magrv = 'PM'.

CALL FUNCTION 'HU_PACKING_AND_UNPACKING'
  EXPORTING
*   if_repack                = 'X'
    is_packing_request       = ls_p_req
 IMPORTING
   ef_rcode                 = lf_subrc
   es_p_request             = ls_p_req
*   ES_ITEM                  =
* CHANGING
*   CS_HEADER                = ls_p_req
 EXCEPTIONS
   missing_data             = 1
   hu_not_changeable        = 2
   not_possible             = 3
   customizing              = 4
   weight                   = 5
   volume                   = 6
   serial_nr                = 7
   fatal_error              = 8
   OTHERS                   = 9          .

IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

CALL FUNCTION 'HU_POST'
 EXPORTING
   if_synchron          = 'X'
   if_commit            = 'X'
*   IF_NO_RENAME         = ' '
*   IF_NO_MESSAGES       = ' '
*   IF_NO_REFRESH        = ' '
*   IF_WM_TA_CONF        = ' '
*   IS_OBJECT            =
*   IS_VBUK              =
*   IT_VBPA              =
 IMPORTING
   ef_number            = lv_number
*   ES_EMKPF             =
*   ET_EMSEG             =
*   ET_MESSAGES          =
*   ET_HEADER            =
*   ET_ITEMS             =
          .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The result of last FM is &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; sy-subrc = 8 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; FATAL ERROR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm follow the standard code and I didn't understand because the FM fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, how can I resolve this critical error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Stefania&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 11:51:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-unpacking-a-shipment/m-p/5308845#M1224136</guid>
      <dc:creator>umberto_panico</dc:creator>
      <dc:date>2009-03-19T11:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module for Unpacking a shipment</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-unpacking-a-shipment/m-p/5308846#M1224137</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 link &lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6319412"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Qamar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2009 12:48:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-for-unpacking-a-shipment/m-p/5308846#M1224137</guid>
      <dc:creator>qamar_javed</dc:creator>
      <dc:date>2009-03-19T12:48:31Z</dc:date>
    </item>
  </channel>
</rss>

