<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144693#M115798</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay! Thanks for your help!&lt;/P&gt;&lt;P&gt;I am creating the material document via BAPI but the BAPI doesn´t creates the document number (docnum). However the MIGO creates a material document (mblnr) and a document number(docnum). This is a brazilian configuration, but the BAPI doesn´t obey this configuration... &lt;/P&gt;&lt;P&gt;I´m using  gm_code = '07' . "Subsequent adjustment to a&lt;/P&gt;&lt;P&gt;subcontract order.&lt;/P&gt;&lt;P&gt;Any help will be welcome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Feb 2006 18:52:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-24T18:52:16Z</dc:date>
    <item>
      <title>BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144691#M115796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks!&lt;/P&gt;&lt;P&gt;I´m from Brazil, and I´m trying to use the BAPI_GOODSMVT_CREATE for create a Subsbsequent Adjustment Purchase Order as in MIGO. In Brazil, when the R/3 system creates a document material, the document number (docnum) is created too. But the BAPI doesn´t create this document number...Can anyone help me? Is this a configuration error? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry my english...&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Éder.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 17:53:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144691#M115796</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-24T17:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144692#M115797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  Z_BAPI_GM                                  .
*
* BAPI TO Upload Inventory Data
*
* GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order
*                      02 - MB31 - Goods Receipts for Prod Order
*                      03 - MB1A - Goods Issue
*                      04 - MB1B - Transfer Posting
*                      05 - MB1C - Enter Other Goods Receipt
*                      06 - MB11
*
* Domain: KZBEW - Movement Indicator
*      Goods movement w/o reference
*  B - Goods movement for purchase order
*  F - Goods movement for production order
*  L - Goods movement for delivery note
*  K - Goods movement for kanban requirement (WM - internal only)
*  O - Subsequent adjustment of "material-provided" consumption
*  W - Subsequent adjustment of proportion/product unit material


parameters: p-file like rlgrap-filename default
                         'c:Norandex-ReynoldsIbcstrans_demo3.txt'.
parameters: xpost like sy-datum default sy-datum.

TABLES : EKKO, EKPO.

data: begin of gmhead.
        include structure bapi2017_gm_head_01.
data: end of gmhead.

data: begin of gmcode.
        include structure bapi2017_gm_code.
data: end of gmcode.

data: begin of mthead.
        include structure bapi2017_gm_head_ret.
data: end of mthead.

data: begin of itab occurs 100.
        include structure bapi2017_gm_item_create.
data: end of itab.

data: begin of errmsg occurs 10.
        include structure bapiret2.
data: end of errmsg.

data: wmenge like iseg-menge,
      errflag.

data: begin of pcitab occurs 100,
        code(10),              "I code
        branch(3),             "Branch #
        pur_doc(6),            "Purchase Document No
        po_item(3),            "Purchase Document Item No
        material(10),          "Material Number
        qty(7),               "Quantity
        post_date(6),          "Posting Date
        date_rec(6),           "Receiving date
        vendor(6),             "Vendor Number
        filler(1),              "Filler
        prog_code(1),          "Program Code
        action_cd(1),          "Action code
        unit_cost(6),          "Cost
        descr(20),             "Descr
        filler3(5),              "Filler
        invoice(5),            "Invoice Number
        codis_part(10),        "Codis Part
        flag(1),               "Flag
        filler1(54),            "Filler
        region(3),             "region
        branch1(3),             "Branch
        filler2(10),            "Filler
        end of pcitab.

call function 'WS_UPLOAD'
  exporting
    filename                      = p-file
    filetype                      = 'DAT'
* IMPORTING
*   FILELENGTH                    =
  tables
    data_tab                      = pcitab
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   OTHERS                        = 6
          .
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.
  exit.
endif.

gmhead-pstng_date = xpost.
gmhead-doc_date = xpost.
gmhead-pr_uname = sy-uname.
gmcode-gm_code = '01'.   "01 - MB01 - Goods Receipts for Purchase Order

loop at pcitab.
  select single ekko~ebeln ekpo~ebelp ekpo~matnr ekpo~werks
  INTO (itab-po_number,itab-po_item,itab-material,itab-plant)
    from ekko inner join ekpo on  ekko~ebeln = ekpo~ebeln
     where IHREZ EQ pcitab+1(9).
CHECK SY-SUBRC  EQ 0.
  itab-move_type  = '101'.
  itab-mvt_ind    = 'B'.
  itab-entry_qnt  = '1.000'.
  itab-stge_loc   = '0001'.
  append itab.

 call function 'BAPI_GOODSMVT_CREATE'
  exporting
    goodsmvt_header             = gmhead
    goodsmvt_code               = gmcode
*    TESTRUN                     = 'X'
  IMPORTING
    goodsmvt_headret            = mthead
*   MATERIALDOCUMENT            =
*   MATDOCUMENTYEAR             =
  tables
    goodsmvt_item               = itab
*   GOODSMVT_SERIALNUMBER       =
    return                      = errmsg
          .
clear errflag.
loop at errmsg.
  if errmsg-type eq 'E'.
    write:/'Error in function', errmsg-message.
    errflag = 'X'.
  else.
    write:/ errmsg-message.
  endif.
endloop.
if errflag is initial.
  commit work and wait.
  if sy-subrc ne 0.
    write:/ 'Error in updating'.
    exit.
  else.
    write:/ mthead-mat_doc, mthead-doc_year.
*    perform upd_sta.
  endif.
endif.
refresh ITAB.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 18:21:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144692#M115797</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-24T18:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144693#M115798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vijay! Thanks for your help!&lt;/P&gt;&lt;P&gt;I am creating the material document via BAPI but the BAPI doesn´t creates the document number (docnum). However the MIGO creates a material document (mblnr) and a document number(docnum). This is a brazilian configuration, but the BAPI doesn´t obey this configuration... &lt;/P&gt;&lt;P&gt;I´m using  gm_code = '07' . "Subsequent adjustment to a&lt;/P&gt;&lt;P&gt;subcontract order.&lt;/P&gt;&lt;P&gt;Any help will be welcome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 18:52:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144693#M115798</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-24T18:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144694#M115799</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;you can try with LSMW , with the following attribute..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  Object               0110   Goods movement       
  Method               0000                        
  Program Name         RM07MMBL                    
  Program Type         B   Batch Input            &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or else you can run the program directly with the input file &amp;lt;b&amp;gt;RM07MMBL&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for LSMW help check this..&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc" target="test_blank"&gt;http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 19:08:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144694#M115799</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-24T19:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144695#M115800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; We have used 'BAPI_GOODSMVT_CREATE' for few applications. It does work well and creates Material documents just like MIGO. In order to accomplishment the movements, you need to have Material Documents created. What does the BAPI return in the RETURN parameter? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Venu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 19:14:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144695#M115800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-24T19:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144696#M115801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Venu, &lt;/P&gt;&lt;P&gt;The BAPI creates the material document, the RETURN table returns empty, but the document material (docnum) isn´t created. I go to try to execute the Vijay´s solution, but if you have an idea of what is the problem...&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 19:41:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144696#M115801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-24T19:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_GOODSMVT_CREATE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144697#M115802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Do you use BAPI_TRANSACTION_COMMIT or 'commit work and wait' after the BAPI call?&lt;/P&gt;&lt;P&gt;I think the material document is not getting saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Venu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2006 23:39:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create/m-p/1144697#M115802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-24T23:39:43Z</dc:date>
    </item>
  </channel>
</rss>

