<?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: BAPI_GOODSMVT_CREATE problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063237#M92508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For those who experience this issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I solve this problem by using BDC method for transaction MB0A to GR inbound delivery order, I think it is not possible to use BAPI_GOODSMVT_CREATE to do GR inbound delivery.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 May 2010 01:09:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-05-14T01:09:28Z</dc:date>
    <item>
      <title>BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063221#M92492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I try to use BAPI_GOODSMVT_CREATE to post GR with D/O no, I use the following parameters for calling BAPI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gm_code = 01&lt;/P&gt;&lt;P&gt;mvt_ind = 'B'&lt;/P&gt;&lt;P&gt;goodsmvt_header&lt;/P&gt;&lt;P&gt;goodsmvt_item-deliv_num = '80760728'&lt;/P&gt;&lt;P&gt;goodsmvt_item-deliv_item = '00010'&lt;/P&gt;&lt;P&gt;goodsmvt_item-move_type = '101'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to SAP documentation, I only need to put fill in delivery, delivery number and movement type for GR for PO unknown: Shipping notification known.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I run the BAPI, the return code show error:&lt;/P&gt;&lt;P&gt;E:           EM7                  018Enter Purchase order          &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anybody know what parameters need to put in for GR for PO unknown: Shipping notification known ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2005 04:03:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063221#M92492</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-10T04:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063222#M92493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope the docu ment which you gave is inbound delivery. So for that you may require the PO#.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2005 04:09:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063222#M92493</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-10T04:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063223#M92494</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 for sample code.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm" target="test_blank"&gt;http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly reward points by clicking the star on the left of reply,if it helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2005 04:11:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063223#M92494</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-11-10T04:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063224#M92495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE I_BAPI_GM_ITEM LINES L_ITEM_LINES.&lt;/P&gt;&lt;P&gt;      IF L_ITEM_LINES GT 0.&lt;/P&gt;&lt;P&gt;        L_BAPI_GM_HEAD-PSTNG_DATE  = SY-DATUM.&lt;/P&gt;&lt;P&gt;        L_BAPI_GM_HEAD-DOC_DATE    = SY-DATUM.&lt;/P&gt;&lt;P&gt;        L_BAPI_GM_HEAD-REF_DOC_NO  = IMP_VBELN.&lt;/P&gt;&lt;P&gt;        L_BAPI_GM_CODE-GM_CODE     = '06'.   "Goods Issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'&lt;/P&gt;&lt;P&gt;             EXPORTING&lt;/P&gt;&lt;P&gt;                  GOODSMVT_HEADER  = L_BAPI_GM_HEAD&lt;/P&gt;&lt;P&gt;                  GOODSMVT_CODE    = L_BAPI_GM_CODE&lt;/P&gt;&lt;P&gt;             IMPORTING&lt;/P&gt;&lt;P&gt;                  GOODSMVT_HEADRET = L_WA_GOODS_RECEIPT_NBR&lt;/P&gt;&lt;P&gt;             TABLES&lt;/P&gt;&lt;P&gt;                  GOODSMVT_ITEM    = I_BAPI_GM_ITEM&lt;/P&gt;&lt;P&gt;                  RETURN           = I_BAPI_GM_RET.&lt;/P&gt;&lt;P&gt;        IF L_WA_GOODS_RECEIPT_NBR IS INITIAL.             "Error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2005 04:18:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063224#M92495</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-10T04:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063225#M92496</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;If you process the inbound delivery,you can decide the PO#.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO# is selected the table LIPS-vgbel.&lt;/P&gt;&lt;P&gt;ex.&lt;/P&gt;&lt;P&gt;  SELECT SINGLE vgbel&lt;/P&gt;&lt;P&gt;    INTO po_num&lt;/P&gt;&lt;P&gt;    FROM LIPS&lt;/P&gt;&lt;P&gt;   WHERE vbeln = '80760728'&lt;/P&gt;&lt;P&gt;     AND posnr = '00010'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck.&lt;/P&gt;&lt;P&gt;Regards MSLee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2005 04:23:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063225#M92496</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-10T04:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063226#M92497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;For creating goods receipt for inbound delivery this bapi BAPI_GOODSMVT_CREATE will not support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here in this bapi you are giving GM code 01 that is for MB01 transaction and that is goodsrecipt with respect to purchase order only.But you have to do post goods receipt for inbound delivery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try for another function module which can do this post goods recipt for inbound delivery.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards &lt;/P&gt;&lt;P&gt;rajkumar abbu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Nov 2005 08:55:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063226#M92497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-10T08:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063227#M92498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to do GR for outbound delivery, can BAPI_GOODSMVT_CREATE do the job? If can't, is there any ways to do it? or I have to use BDC?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2005 04:57:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063227#M92498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-12T04:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063228#M92499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For outbound deliveries, you will do a GI at the source destination, not a GR. Are you doing a GR in your system for the target destination?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, give delivery number in internal format, i.e with leading zeros. You will give a 'B' only if you are supplying the PO, if not don't give that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If these changes do not help you, post your entire code where you fill the BAPI structures so that we can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Nov 2005 17:05:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063228#M92499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-12T17:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063229#M92500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In MIGO, I choose A01-Goods Receipt, then choose R05-Outbound Delivery, then key in the D/O. I can actually do a GR for outbound delivery in MIGO, but I can't do it in BAPI_GOODSMVT_CREATE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The D/O is from another internal company. Any advice?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 01:26:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063229#M92500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T01:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063230#M92501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that case, as I mentioned, can you remove the 'B' that you are passing and send the D/O in the internal format, with leading zeros.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 02:37:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063230#M92501</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T02:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063231#M92502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is how your code should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gm_code = 01&lt;/P&gt;&lt;P&gt;goodsmvt_header&lt;/P&gt;&lt;P&gt;goodsmvt_item-deliv_num = '0080760728'&lt;/P&gt;&lt;P&gt;goodsmvt_item-deliv_item = '00010'&lt;/P&gt;&lt;P&gt;goodsmvt_item-move_type = '101'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2005 02:38:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063231#M92502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-14T02:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063232#M92503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I put in the following parameters:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gm_code = 01&lt;/P&gt;&lt;P&gt;goodsmvt_header&lt;/P&gt;&lt;P&gt;goodsmvt_item-deliv_num  = '0080740728'&lt;/P&gt;&lt;P&gt;goodsmvt_item-deliv_item = '90001'&lt;/P&gt;&lt;P&gt;goodsmvt_item-move_type  = '101'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the return table shows me error:&lt;/P&gt;&lt;P&gt;E   |M7                  |264   |Qty and / or "delivery completed" ind. or "delivery completed" ind. or final issue ind. are missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after I put in goodsmvt_item-entry_ant = 2, return table shows error:&lt;/P&gt;&lt;P&gt;E   |M7                  |018   |Enter Plant                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I put in goodmvt_item-plant = '0110', return table shows error:&lt;/P&gt;&lt;P&gt;E   |M7                  |097   |No stock posting possible for this material&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice on this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2005 02:14:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063232#M92503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-15T02:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063233#M92504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Earlier you had item 00001, now you put 90001. Is that correct? The error message tells me that your delivery item cannot be received, may be because of its item category or may be it is already delivered or the delivery complete indicator set or may be the final issue indicator is set... it could be anything. Go to VL03N, enter the delivery number and see the document flow at the item level. See if it says completed or something like that. Try to do a MIGO manually for it and see if the system gives you the same message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2005 02:54:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063233#M92504</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-15T02:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063234#M92505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yean,&lt;/P&gt;&lt;P&gt;        I realize this posting was quite some time ago, but I am facing the exact scenario you described.  If you cared to, and can remember, would you mind to share with me your outcome?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dennis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 16:19:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063234#M92505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T16:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063235#M92506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bapi BAPI_GOODSMVT_CREATE could be used to post goods receipt against inbound delivery but in consequence no Delivery document flow is updated. This is official SAP explaination. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there is solution to accomplish it. After posting goods movements you should update Inbound Delivery using fm SD_DELIVERY_UPDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check following coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; *&amp;amp;---------------------------------------------------------------------*
form process_0112.

  clear post_status.
  post_status-delivery = wa_likp-vbeln.

* posting
  perform post_goodsreceipt     changing post_status.
  perform post_delivery_hist    changing post_status.
  perform post_transferorder    changing post_status.

* reversal posting if necessary
  perform reverse_goodsreceipt  changing post_status.
  perform reverse_delivery_hist changing post_status.

* display message in case of error
  perform issue_message         changing post_status.

* leave transaction
  leave to transaction sy-tcode.

endform.                    " process_0112


*&amp;amp;---------------------------------------------------------------------*
form post_goodsreceipt changing post_status structure post_status.

*-----------------------------------------
* DATA DECLARATION
*-----------------------------------------
* material document header
  data: begin of it_head.
          include structure bapi2017_gm_head_01.
  data: end of it_head.
* T158G special code
  data: begin of it_code.
          include structure bapi2017_gm_code.
  data: end of it_code.
* material document returned data
  data: begin of it_rthead.
          include structure bapi2017_gm_head_ret.
  data: end of it_rthead.
* material document items
  data: begin of it_pos occurs 100.
          include structure bapi2017_gm_item_create.
  data: end of it_pos.
* error table
  data: begin of it_errmsg occurs 10.
          include structure bapiret2.
  data: end of it_errmsg.

* return data
  data: post_mat_doc  type bapi2017_gm_head_ret-mat_doc,
        post_doc_year type bapi2017_gm_head_ret-doc_year.


*-----------------------------------------
* FILL DATA
*-----------------------------------------
* material document header
  it_head-pstng_date  = sy-datum.            
  it_head-doc_date    = sy-datum.            
  it_head-header_txt  = 'RF'.                
  it_head-pr_uname    = sy-uname.
* T158G code
  it_code-gm_code     = '01'.
* material document items
  loop at it_lips into wa_lips where posnr &amp;lt;&amp;gt; space.
    it_pos-mvt_ind              = 'B'.
    it_pos-deliv_numb_to_search = wa_lips-vbeln.
    it_pos-deliv_item_to_search = wa_lips-posnr.
    it_pos-po_number            = wa_lips-vgbel.
    it_pos-po_item              = wa_lips-vgpos.
    it_pos-move_type            = '985'.
    it_pos-entry_qnt            = wa_lips-rv_lfimg.
    append it_pos.
  endloop.


*-----------------------------------------
* CALL BAPI
*-----------------------------------------
  refresh: it_errmsg.
  call function 'BAPI_GOODSMVT_CREATE'
    exporting
      goodsmvt_header             = it_head
      goodsmvt_code               = it_code
    importing
      materialdocument            = post_mat_doc
      matdocumentyear             = post_doc_year
    tables
      goodsmvt_item               = it_pos
      return                      = it_errmsg.
* check result
  if post_mat_doc is initial.
    post_status-post_mat_doc  = space.
    post_status-post_doc_year = space.
    rollback work.
  else.
    post_status-post_mat_doc  = post_mat_doc.
    post_status-post_doc_year = post_doc_year.
    commit work and wait.
  endif.

endform.                    " post_goodsreceipt


*&amp;amp;---------------------------------------------------------------------*
form post_delivery_hist changing post_status structure post_status.


*-----------------------------------------
* DATA DECLARATION
*-----------------------------------------
  data: it_vbfa    like vbfa occurs 0,
        wa_vbfa    like vbfa.


*-----------------------------------------
* CHECK IF UPDATE DELIVERY IS ESSENTIAL
*-----------------------------------------
  check not post_status-post_mat_doc  is initial
  and   not post_status-post_doc_year is initial.


*-----------------------------------------
* POPULATE TABLE
*-----------------------------------------
  loop at it_lips into wa_lips where posnr &amp;lt;&amp;gt; space.
    clear wa_vbfa.
    wa_vbfa-vbelv = wa_lips-vbeln.
    wa_vbfa-posnv = wa_lips-posnr.
    wa_vbfa-vbeln = post_status-post_mat_doc.
    wa_vbfa-vbtyp_n = 'R'.
    wa_vbfa-vbtyp_v = '7'.
    wa_vbfa-plmin   = '+'.
    select single zeile waers menge dmbtr meins matnr bwart
      from mseg
        into (wa_vbfa-posnn, wa_vbfa-waers,
              wa_vbfa-rfmng, wa_vbfa-rfwrt,
              wa_vbfa-meins, wa_vbfa-matnr,
              wa_vbfa-bwart)
          where mblnr = post_status-post_mat_doc
            and mjahr = post_status-post_doc_year
            and ebeln = wa_lips-vgbel
            and ebelp = wa_lips-vgpos.
    append wa_vbfa to it_vbfa.
  endloop.


*-----------------------------------------
* UPDATE DELIVERY
*-----------------------------------------
  data:    begin of yvbfa occurs 0.
             include structure vbfavb.
  data:    end of yvbfa.
  data:    begin of xvbfa occurs 0.
             include structure vbfavb.
  data:    end of xvbfa.
  data:    begin of xvttk occurs 0.
             include structure vttkvb.
  data:    end of xvttk.

  sort it_vbfa by mandt vbelv posnv vbeln posnn vbtyp_n.

  loop at it_vbfa into xvbfa.
    xvbfa-rfmng_flt = xvbfa-rfmng.
    xvbfa-updkz = 'I'.
    append xvbfa.
    at end of vbelv.
      call function 'SD_DELIVERY_UPDATE'
           exporting
                i_vbtyp          = '7'
                nicht_sperren    = 'Y'
                no_imseg_refresh = 'X'
           tables
                zxvbfa        = xvbfa
                zyvbfa        = yvbfa
                zxvttk        = xvttk
           exceptions
                others        = 1.
      if sy-subrc &amp;lt;&amp;gt; 0.
        exit.
      endif.
      refresh xvbfa.
    endat.
  endloop.

* check result
  if sy-subrc &amp;lt;&amp;gt; 0.
    post_status-post_deli_hist  = 'R'.
    rollback work.
  else.
    post_status-post_deli_hist  = 'C'.
    commit work and wait.
  endif.

endform.                    " post_delivery_hist
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 20:26:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063235#M92506</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T20:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063236#M92507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Srinivas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see that you had a solution for my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to post GR against inbound delivery in MIGO transaction for movement type 101. i am using bapi_goodsmvt_create for this. now i want to know what are the parameters, i need to pass to that bapi. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GMCODE&lt;/P&gt;&lt;P&gt;KZBEW - Movement Indicator&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i see there in table T158G there is no code avialable for MIGO transaction. And parallely i  want to know what parameters i need to pass to header and item segemnts etc. please help me in this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got stuck up and it is very priority issue for me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 May 2010 12:18:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063236#M92507</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-13T12:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063237#M92508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For those who experience this issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I solve this problem by using BDC method for transaction MB0A to GR inbound delivery order, I think it is not possible to use BAPI_GOODSMVT_CREATE to do GR inbound delivery.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 May 2010 01:09:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063237#M92508</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-14T01:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063238#M92509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yean Nean Yong ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I have Created a Goods Movement Against the Inbound delivery through FM BAPI_GOODSMVT_CREATE and it is working Fine for me.&lt;/P&gt;&lt;P&gt;  It is updating the Docflow and PO History. My code is :&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_macro_name="Code"&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;  TESTRUN                       = ' '&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;  GOODSMVT_REF_EWM              =&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;IMPORTING&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;  GOODSMVT_HEADRET              =&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;  MATERIALDOCUMENT              =&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;  MATDOCUMENTYEAR               =&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;  GOODSMVT_SERIALNUMBER         =&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;  GOODSMVT_SERV_PART_DATA       =&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;  EXTENSIONIN                   =&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;  GOODSMVT_ITEM_CWM             =&lt;/LI&gt;&lt;/UL&gt;
DATA  : ls_header TYPE bapi2017_gm_head_01,
          ls_mvt_code TYPE bapi2017_gm_code,
          ls_return TYPE bapiret2,
          ls_item TYPE bapi2017_gm_item_create.
  DATA : lt_item TYPE STANDARD TABLE OF bapi2017_gm_item_create,
         lt_return TYPE STANDARD TABLE OF bapiret2.

  ls_mvt_code-gm_code  = '01'. " through Tcode MB01
  ls_header-pstng_date = sy-datum.

  ls_item-material = &amp;lt;Materail Number&amp;gt;.
  ls_item-plant = &amp;lt;Plant&amp;gt;
  ls_item-stge_loc = &amp;lt;Storage Location&amp;gt;'.
  ls_item-move_type = '101'.
  ls_item-entry_qnt =&amp;lt;Quantity&amp;gt;.
  ls_item-entry_uom = &amp;lt;PIcking Quantity Unit&amp;gt;.
  ls_item-mvt_ind = 'B'.  " Goods Movement Against PO
  ls_item-deliv_numb_to_search = &amp;lt;Delivery Number&amp;gt;.
  ls_item-deliv_item_to_search =&amp;lt;Delivery Number Item&amp;gt;.
  APPEND ls_item TO lt_item.


  CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
    EXPORTING
      goodsmvt_header               =  ls_header
      goodsmvt_code                 = ls_mvt_code






    TABLES
      goodsmvt_item                 = lt_item

      return                        = lt_return



            .
  IF lt_return IS INITIAL.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait   = 'X'
      IMPORTING
        return = ls_return.
  ENDIF.
&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 May 2011 12:36:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063238#M92509</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-05-06T12:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063239#M92510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know it's an old thread, but update it anyway, since it might help to others in the future &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1200/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems for inbound delivery/shipping notification you have to pass these fields in the item table:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;deliv_numb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;deliv_item&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;deliv_numb_to_search&lt;/LI&gt;&lt;LI&gt;deliv_item_to_search&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According my tests (in ECC 6.05 system) you need to pass the "to_search" fields also, otherwise it dumps. &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1200/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Also customizing from this OSS note is also necessary, then it works fine:&lt;/P&gt;&lt;P&gt;1993787 - MESSAGE_TYPE_X with error VL143 during goods receipt against inbound delivery in MIGO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 14:12:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063239#M92510</guid>
      <dc:creator>Peter_Inotai</dc:creator>
      <dc:date>2015-02-06T14:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063240#M92511</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 am getting same Enter plant M7 018 error can anyone help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2016 07:04:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/1063240#M92511</guid>
      <dc:creator>Tisha_Haria</dc:creator>
      <dc:date>2016-03-03T07:04:01Z</dc:date>
    </item>
  </channel>
</rss>

