<?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_ACC_GL_POSTING_POST  multiple line items in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-gl-posting-post-multiple-line-items/m-p/4869234#M1138400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read the documentation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FU BAPI_GOODSMVT_CREATE&lt;/P&gt;&lt;P&gt;____________________________________________________&lt;/P&gt;&lt;P&gt;Short text&lt;/P&gt;&lt;P&gt;Post goods movements with MB_CREATE_GOODS_MOVEMENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functionality&lt;/P&gt;&lt;P&gt;You can use this method to create a material document for a goods movement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can only create one material document each time you call up the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use a simulation function before posting the goods movement to check how the data is updated in the database. The standard system is configured so that the goods movement is posted immediately without simulating beforehand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;The following authorization object is checked when this method is used:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M_MSEG_WMB Material documents: plant&lt;/P&gt;&lt;P&gt;M_MSEG_BMB Material documents: movement type&lt;/P&gt;&lt;P&gt;M_MSEG_WWA Goods movements: plant&lt;/P&gt;&lt;P&gt;M_MSEG_BWA Goods movements: movement type&lt;/P&gt;&lt;P&gt;Transfer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following information about the material document that is to be created is transferred to the method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a structure with header data&lt;/P&gt;&lt;P&gt;a structure with the code for the movement&lt;/P&gt;&lt;P&gt;a table with the item data&lt;/P&gt;&lt;P&gt;a table with the serial numbers&lt;/P&gt;&lt;P&gt;The posting is carried out in the R/3 System via the MB_CREATE_GOODS_MOVEMENT function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Confirmations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Messages are returned in the parameter return. The parameter documentation shows the return codes and their meanings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further Information&lt;/P&gt;&lt;P&gt;The method can only carry out your function if no error messages were generated in the "Return" table. This is the case if the header data and all the items were processed successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transaction control is not implemented. The calling program therefore has to execute the 'Commit Work' itself after this method has been successfully invoked (i.e. if no errors were reported in the Return parameter).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which fields have to be filled during the various transactions/ events?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following sample scenarios demonstrate which fields have to be filled for which business transactions/events (code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are the following types of transactions/events:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. GM_Code 01: Goods receipt for purchase order&lt;/P&gt;&lt;P&gt;2. GM_Code 02: Goods receipt for production order&lt;/P&gt;&lt;P&gt;3. GM_Code 03: Goods issue&lt;/P&gt;&lt;P&gt;4. GM_Code 04: Transfer posting&lt;/P&gt;&lt;P&gt;5. GM_Code 05: Other goods receipts&lt;/P&gt;&lt;P&gt;6. GM_Code 06: Reversal of goods movements&lt;/P&gt;&lt;P&gt;Entering the movement indicator&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the transaction, you must enter the following in the movement indicator:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GM_Code 01 (Goods receipt for purchase order): B&lt;/P&gt;&lt;P&gt;GM_Code 02 (Goods receipt for production order): F&lt;/P&gt;&lt;P&gt;For all other transactions, you leave the field blank.&lt;/P&gt;&lt;P&gt;For 1: GM_Code 01: Goods receipt for purchase order&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Purchase order known&lt;/P&gt;&lt;P&gt;The following fields have to be filled:&lt;/P&gt;&lt;P&gt;Purchase order&lt;/P&gt;&lt;P&gt;Purchase order item&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry or&lt;/P&gt;&lt;P&gt;quantity proposal&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if it has been configured like this in the system)&lt;/P&gt;&lt;P&gt;Reason for movement (if it has been configured like this in the system)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and batch numbers are not assigned automatically)&lt;/P&gt;&lt;P&gt;Storage location (if a storage location has not been specified in the purchase order item)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Stock type&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;Delivery completed indicator&lt;/P&gt;&lt;P&gt;You cannot fill the following fields (incomplete listing):&lt;/P&gt;&lt;P&gt;Account assignment fields (account assignment is adopted from the purchase order)&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;In the case of a purchase order item with the "subcontracting" item category, only the GR item in the interface is to be transferred. The system automatically determines GI items.&lt;/P&gt;&lt;P&gt;Purchase order unknown: shipping notification known&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Delivery&lt;/P&gt;&lt;P&gt;Delivery item&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Other fields, such as those under "Purchase order known". The system determines the relevant purchase order item via the delivery/delivery item.&lt;/P&gt;&lt;P&gt;Purchase order known: purchase order should be created automatically&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Material number&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Storage location&lt;/P&gt;&lt;P&gt;vendor&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if it has been configured like this in the system)&lt;/P&gt;&lt;P&gt;Reason for movement (if it has been configured like this in the system)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and batches are not assigned automatically)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Stock type&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;You cannot fill the following fields (incomplete listing):&lt;/P&gt;&lt;P&gt;Account assignment fields (automatic creation of purchase order items with account assignment is not supported)&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;Purchase order unknown: a purchase order should not be created&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Material number&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Storage location&lt;/P&gt;&lt;P&gt;Vendor&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if it has been configured like this)&lt;/P&gt;&lt;P&gt;Reason for movement (if it has been configured like this)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic assignment of batch numbers is not set)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Special stock indicator&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;Goods recipient&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Account assignment (automatic creation of purchase order items with account assignment is not supported)&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;Receiving/issuing batch&lt;/P&gt;&lt;P&gt;The input combinations listed above for the GM_CODE 01 can be combined within an input table so that they can be posted in a material document. Items can also be posted for different purchase orders, provided that all the purchase orders reference the same vendor.&lt;/P&gt;&lt;P&gt;For 2 GM_Code 02: Goods receipt for production order&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Order&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry or&lt;/P&gt;&lt;P&gt;quantity proposal&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if the system has been configured like this)&lt;/P&gt;&lt;P&gt;Reason for movement (if the system has been configured like this)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic batch number assignment is set)&lt;/P&gt;&lt;P&gt;Storage location (if storage location has not been specified)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Order item (co-product)&lt;/P&gt;&lt;P&gt;Stock type&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;"Delivery completed" indicator&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Account assignment fields (the account assignments are adopted from the purchase order&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;Receiving/issuing batch&lt;/P&gt;&lt;P&gt;For 3 GM_Code 03: Goods issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Goods issue without reference to a reservation&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Material number&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Storage location&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Special stock (e.g. sales order, project, vendor etc.)&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if the system is configured like this)&lt;/P&gt;&lt;P&gt;Reason for movement (if the system has been configured like this)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic batch number assignment is set)&lt;/P&gt;&lt;P&gt;Account assignment fields&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Special stock indicator&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;Goods recipient&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;Receiving/issuing batch&lt;/P&gt;&lt;P&gt;Goods issue with reference to a reservation&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Reservation number&lt;/P&gt;&lt;P&gt;Reservation item&lt;/P&gt;&lt;P&gt;Record type of the reservation&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete list):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if this has been configured in the system)&lt;/P&gt;&lt;P&gt;Reason for movement (if this has been configured in the system)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic batch number assignment is not set)&lt;/P&gt;&lt;P&gt;Storage location (if not planned in the reservation)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete count):&lt;/P&gt;&lt;P&gt;Special stock indicator&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;Goods recipient&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete count):&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Material&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Account assignment fields&lt;/P&gt;&lt;P&gt;For 4 GM_Code 04: Transfer posting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transfer posting without reference to a reservation&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Material number&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Storage location&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Receiving material&lt;/P&gt;&lt;P&gt;Receiving plant&lt;/P&gt;&lt;P&gt;Receiving storage location&lt;/P&gt;&lt;P&gt;Receiving batch (if material is handled in batches and you want to change batches)&lt;/P&gt;&lt;P&gt;Receiving/issuing special stock (e.g. sales order, project, vendor etc.)&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if this has been configured in the system)&lt;/P&gt;&lt;P&gt;Reason for movement (if this has been configured in the system)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic batch number assignment is not set)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Special stock indicator&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Account assignment fields (for automatic posting lines: Expense/income from stock transfer)&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Transfer posting with reference to a reservation&lt;/P&gt;&lt;P&gt;See goods issue with reference to a reservation&lt;/P&gt;&lt;P&gt;For 5 GM_Code 05: Other goods receipts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other goods receipt with reference to a reservation&lt;/P&gt;&lt;P&gt;See goods issue without reference to a reservation&lt;/P&gt;&lt;P&gt;Other goods receipt with reference to a reservation&lt;/P&gt;&lt;P&gt;See goods issue with reference to a reservation&lt;/P&gt;&lt;P&gt;For 6 GM_Code 06: Reversal of goods movements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the Cancel method to reverse goods movements. But you may also want to cancel a goods movement without referencing a material document (see the Cancel method).&lt;/P&gt;&lt;P&gt;If you want to work without referencing the document, you have to fill the field BAPI_GM_ITEM_CREATE-XSTOB in the interface. In this case, the system converts the movement type assigned in the interface to the reversal movement type. Alternatively you can set the reversal movement type in the interface. In this case, the BAPI_GM_ITEM_CREATE_XSTOB field must be transferred blank.&lt;/P&gt;&lt;P&gt;If you want to cancel a goods movement with reference to a reservation (without using the Cancel method) you can only transfer the field BAPI_GM_ITEM_CREATE_XSTOB if it is filled. Movement types are not transferred when you post with reference to a reservation, as the movement type is contained in the reservation item.&lt;/P&gt;&lt;P&gt;Parameter&lt;/P&gt;&lt;P&gt;GOODSMVT_HEADER&lt;/P&gt;&lt;P&gt;GOODSMVT_CODE&lt;/P&gt;&lt;P&gt;TESTRUN&lt;/P&gt;&lt;P&gt;GOODSMVT_HEADRET&lt;/P&gt;&lt;P&gt;MATERIALDOCUMENT&lt;/P&gt;&lt;P&gt;MATDOCUMENTYEAR&lt;/P&gt;&lt;P&gt;GOODSMVT_ITEM&lt;/P&gt;&lt;P&gt;GOODSMVT_SERIALNUMBER&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions&lt;/P&gt;&lt;P&gt;Function group&lt;/P&gt;&lt;P&gt;MB_BUS2017&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Nov 2008 15:33:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-26T15:33:42Z</dc:date>
    <item>
      <title>BAPI_ACC_GL_POSTING_POST  multiple line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-gl-posting-post-multiple-line-items/m-p/4869233#M1138399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;have to use BAPI_ACC_GL_POSTING_POST for gl account posting. &lt;/P&gt;&lt;P&gt;I have a flat file with multiple Headers and each header will have multiple line items. &lt;/P&gt;&lt;P&gt;1.How to post these type of flat file using Bapi?(i have to pass 998 line items as one set,and 999th set shound be balancing entry). &lt;/P&gt;&lt;P&gt;2.After posting through bapi_acc_gl_posting_post, i have to generate a report showing Detail of line item in which error has occured.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;MMV&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 15:22:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-gl-posting-post-multiple-line-items/m-p/4869233#M1138399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T15:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_ACC_GL_POSTING_POST  multiple line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-gl-posting-post-multiple-line-items/m-p/4869234#M1138400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read the documentation &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FU BAPI_GOODSMVT_CREATE&lt;/P&gt;&lt;P&gt;____________________________________________________&lt;/P&gt;&lt;P&gt;Short text&lt;/P&gt;&lt;P&gt;Post goods movements with MB_CREATE_GOODS_MOVEMENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Functionality&lt;/P&gt;&lt;P&gt;You can use this method to create a material document for a goods movement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can only create one material document each time you call up the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use a simulation function before posting the goods movement to check how the data is updated in the database. The standard system is configured so that the goods movement is posted immediately without simulating beforehand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;The following authorization object is checked when this method is used:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;M_MSEG_WMB Material documents: plant&lt;/P&gt;&lt;P&gt;M_MSEG_BMB Material documents: movement type&lt;/P&gt;&lt;P&gt;M_MSEG_WWA Goods movements: plant&lt;/P&gt;&lt;P&gt;M_MSEG_BWA Goods movements: movement type&lt;/P&gt;&lt;P&gt;Transfer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following information about the material document that is to be created is transferred to the method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a structure with header data&lt;/P&gt;&lt;P&gt;a structure with the code for the movement&lt;/P&gt;&lt;P&gt;a table with the item data&lt;/P&gt;&lt;P&gt;a table with the serial numbers&lt;/P&gt;&lt;P&gt;The posting is carried out in the R/3 System via the MB_CREATE_GOODS_MOVEMENT function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Confirmations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Messages are returned in the parameter return. The parameter documentation shows the return codes and their meanings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further Information&lt;/P&gt;&lt;P&gt;The method can only carry out your function if no error messages were generated in the "Return" table. This is the case if the header data and all the items were processed successfully.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transaction control is not implemented. The calling program therefore has to execute the 'Commit Work' itself after this method has been successfully invoked (i.e. if no errors were reported in the Return parameter).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which fields have to be filled during the various transactions/ events?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following sample scenarios demonstrate which fields have to be filled for which business transactions/events (code).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are the following types of transactions/events:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. GM_Code 01: Goods receipt for purchase order&lt;/P&gt;&lt;P&gt;2. GM_Code 02: Goods receipt for production order&lt;/P&gt;&lt;P&gt;3. GM_Code 03: Goods issue&lt;/P&gt;&lt;P&gt;4. GM_Code 04: Transfer posting&lt;/P&gt;&lt;P&gt;5. GM_Code 05: Other goods receipts&lt;/P&gt;&lt;P&gt;6. GM_Code 06: Reversal of goods movements&lt;/P&gt;&lt;P&gt;Entering the movement indicator&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the transaction, you must enter the following in the movement indicator:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GM_Code 01 (Goods receipt for purchase order): B&lt;/P&gt;&lt;P&gt;GM_Code 02 (Goods receipt for production order): F&lt;/P&gt;&lt;P&gt;For all other transactions, you leave the field blank.&lt;/P&gt;&lt;P&gt;For 1: GM_Code 01: Goods receipt for purchase order&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Purchase order known&lt;/P&gt;&lt;P&gt;The following fields have to be filled:&lt;/P&gt;&lt;P&gt;Purchase order&lt;/P&gt;&lt;P&gt;Purchase order item&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry or&lt;/P&gt;&lt;P&gt;quantity proposal&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if it has been configured like this in the system)&lt;/P&gt;&lt;P&gt;Reason for movement (if it has been configured like this in the system)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and batch numbers are not assigned automatically)&lt;/P&gt;&lt;P&gt;Storage location (if a storage location has not been specified in the purchase order item)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Stock type&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;Delivery completed indicator&lt;/P&gt;&lt;P&gt;You cannot fill the following fields (incomplete listing):&lt;/P&gt;&lt;P&gt;Account assignment fields (account assignment is adopted from the purchase order)&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;In the case of a purchase order item with the "subcontracting" item category, only the GR item in the interface is to be transferred. The system automatically determines GI items.&lt;/P&gt;&lt;P&gt;Purchase order unknown: shipping notification known&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Delivery&lt;/P&gt;&lt;P&gt;Delivery item&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Other fields, such as those under "Purchase order known". The system determines the relevant purchase order item via the delivery/delivery item.&lt;/P&gt;&lt;P&gt;Purchase order known: purchase order should be created automatically&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Material number&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Storage location&lt;/P&gt;&lt;P&gt;vendor&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if it has been configured like this in the system)&lt;/P&gt;&lt;P&gt;Reason for movement (if it has been configured like this in the system)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and batches are not assigned automatically)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Stock type&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;You cannot fill the following fields (incomplete listing):&lt;/P&gt;&lt;P&gt;Account assignment fields (automatic creation of purchase order items with account assignment is not supported)&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;Purchase order unknown: a purchase order should not be created&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Material number&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Storage location&lt;/P&gt;&lt;P&gt;Vendor&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if it has been configured like this)&lt;/P&gt;&lt;P&gt;Reason for movement (if it has been configured like this)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic assignment of batch numbers is not set)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Special stock indicator&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;Goods recipient&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Account assignment (automatic creation of purchase order items with account assignment is not supported)&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;Receiving/issuing batch&lt;/P&gt;&lt;P&gt;The input combinations listed above for the GM_CODE 01 can be combined within an input table so that they can be posted in a material document. Items can also be posted for different purchase orders, provided that all the purchase orders reference the same vendor.&lt;/P&gt;&lt;P&gt;For 2 GM_Code 02: Goods receipt for production order&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Order&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry or&lt;/P&gt;&lt;P&gt;quantity proposal&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if the system has been configured like this)&lt;/P&gt;&lt;P&gt;Reason for movement (if the system has been configured like this)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic batch number assignment is set)&lt;/P&gt;&lt;P&gt;Storage location (if storage location has not been specified)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Order item (co-product)&lt;/P&gt;&lt;P&gt;Stock type&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;"Delivery completed" indicator&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Account assignment fields (the account assignments are adopted from the purchase order&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;Receiving/issuing batch&lt;/P&gt;&lt;P&gt;For 3 GM_Code 03: Goods issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Goods issue without reference to a reservation&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Material number&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Storage location&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Special stock (e.g. sales order, project, vendor etc.)&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if the system is configured like this)&lt;/P&gt;&lt;P&gt;Reason for movement (if the system has been configured like this)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic batch number assignment is set)&lt;/P&gt;&lt;P&gt;Account assignment fields&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Special stock indicator&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;Goods recipient&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Receiving/issuing material&lt;/P&gt;&lt;P&gt;Receiving/issuing plant&lt;/P&gt;&lt;P&gt;Receiving/issuing storage location&lt;/P&gt;&lt;P&gt;Receiving/issuing batch&lt;/P&gt;&lt;P&gt;Goods issue with reference to a reservation&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Reservation number&lt;/P&gt;&lt;P&gt;Reservation item&lt;/P&gt;&lt;P&gt;Record type of the reservation&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete list):&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if this has been configured in the system)&lt;/P&gt;&lt;P&gt;Reason for movement (if this has been configured in the system)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic batch number assignment is not set)&lt;/P&gt;&lt;P&gt;Storage location (if not planned in the reservation)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete count):&lt;/P&gt;&lt;P&gt;Special stock indicator&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Unloading point&lt;/P&gt;&lt;P&gt;Goods recipient&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete count):&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Material&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Account assignment fields&lt;/P&gt;&lt;P&gt;For 4 GM_Code 04: Transfer posting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Transfer posting without reference to a reservation&lt;/P&gt;&lt;P&gt;The following fields must be filled:&lt;/P&gt;&lt;P&gt;Material number&lt;/P&gt;&lt;P&gt;Plant&lt;/P&gt;&lt;P&gt;Storage location&lt;/P&gt;&lt;P&gt;Movement type&lt;/P&gt;&lt;P&gt;Movement indicator&lt;/P&gt;&lt;P&gt;Quantity in unit of entry&lt;/P&gt;&lt;P&gt;ISO code unit of measurement for unit of entry&lt;/P&gt;&lt;P&gt;The following fields may have to be filled in some cases (incomplete listing):&lt;/P&gt;&lt;P&gt;Receiving material&lt;/P&gt;&lt;P&gt;Receiving plant&lt;/P&gt;&lt;P&gt;Receiving storage location&lt;/P&gt;&lt;P&gt;Receiving batch (if material is handled in batches and you want to change batches)&lt;/P&gt;&lt;P&gt;Receiving/issuing special stock (e.g. sales order, project, vendor etc.)&lt;/P&gt;&lt;P&gt;Shelf life expiration date (if this has been configured in the system)&lt;/P&gt;&lt;P&gt;Reason for movement (if this has been configured in the system)&lt;/P&gt;&lt;P&gt;Batch (if the material is handled in batches and automatic batch number assignment is not set)&lt;/P&gt;&lt;P&gt;The following fields can be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Special stock indicator&lt;/P&gt;&lt;P&gt;Item text&lt;/P&gt;&lt;P&gt;Account assignment fields (for automatic posting lines: Expense/income from stock transfer)&lt;/P&gt;&lt;P&gt;The following fields cannot be filled (incomplete listing):&lt;/P&gt;&lt;P&gt;Reservation&lt;/P&gt;&lt;P&gt;Transfer posting with reference to a reservation&lt;/P&gt;&lt;P&gt;See goods issue with reference to a reservation&lt;/P&gt;&lt;P&gt;For 5 GM_Code 05: Other goods receipts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other goods receipt with reference to a reservation&lt;/P&gt;&lt;P&gt;See goods issue without reference to a reservation&lt;/P&gt;&lt;P&gt;Other goods receipt with reference to a reservation&lt;/P&gt;&lt;P&gt;See goods issue with reference to a reservation&lt;/P&gt;&lt;P&gt;For 6 GM_Code 06: Reversal of goods movements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the Cancel method to reverse goods movements. But you may also want to cancel a goods movement without referencing a material document (see the Cancel method).&lt;/P&gt;&lt;P&gt;If you want to work without referencing the document, you have to fill the field BAPI_GM_ITEM_CREATE-XSTOB in the interface. In this case, the system converts the movement type assigned in the interface to the reversal movement type. Alternatively you can set the reversal movement type in the interface. In this case, the BAPI_GM_ITEM_CREATE_XSTOB field must be transferred blank.&lt;/P&gt;&lt;P&gt;If you want to cancel a goods movement with reference to a reservation (without using the Cancel method) you can only transfer the field BAPI_GM_ITEM_CREATE_XSTOB if it is filled. Movement types are not transferred when you post with reference to a reservation, as the movement type is contained in the reservation item.&lt;/P&gt;&lt;P&gt;Parameter&lt;/P&gt;&lt;P&gt;GOODSMVT_HEADER&lt;/P&gt;&lt;P&gt;GOODSMVT_CODE&lt;/P&gt;&lt;P&gt;TESTRUN&lt;/P&gt;&lt;P&gt;GOODSMVT_HEADRET&lt;/P&gt;&lt;P&gt;MATERIALDOCUMENT&lt;/P&gt;&lt;P&gt;MATDOCUMENTYEAR&lt;/P&gt;&lt;P&gt;GOODSMVT_ITEM&lt;/P&gt;&lt;P&gt;GOODSMVT_SERIALNUMBER&lt;/P&gt;&lt;P&gt;RETURN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions&lt;/P&gt;&lt;P&gt;Function group&lt;/P&gt;&lt;P&gt;MB_BUS2017&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 15:33:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-acc-gl-posting-post-multiple-line-items/m-p/4869234#M1138400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T15:33:42Z</dc:date>
    </item>
  </channel>
</rss>

