<?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 or Functional Module !! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553325#M250869</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the example program.  This does a movement from sl to sl for a certain material.&lt;/P&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;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

* Structures for BAPI
data: gm_header  type bapi2017_gm_head_01.
data: gm_code    type bapi2017_gm_code.
data: gm_headret type bapi2017_gm_head_ret.
data: gm_item    type table of
                 bapi2017_gm_item_create with header line.
data: gm_return  type bapiret2 occurs 0 with header line.
data: gm_retmtd  type bapi2017_gm_head_ret-mat_doc.

clear: gm_return, gm_retmtd. refresh gm_return.

* Setup BAPI header data.
gm_header-pstng_date = sy-datum.
gm_header-doc_date   = sy-datum.
gm_code-gm_code      = '04'.

* Write 311 movement to table
clear gm_item.
move '311'                 to gm_item-move_type     .
move '000000000040000100'  to gm_item-material.
move '1'     to gm_item-entry_qnt.
move 'EA'    to gm_item-entry_uom.
move '0004'  to gm_item-plant.
move '4000'  to gm_item-stge_loc.
move '4999'  to gm_item-move_stloc.

append gm_item.

* Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
     exporting
          goodsmvt_header  = gm_header
          goodsmvt_code    = gm_code
     importing
          goodsmvt_headret = gm_headret
          materialdocument = gm_retmtd
     tables
          goodsmvt_item    = gm_item
          return           = gm_return.

if not gm_retmtd is initial.
  commit work and wait.
  call function 'DEQUEUE_ALL'.
else.
  commit work and wait.
  call function 'DEQUEUE_ALL'.
endif.

write:/ gm_retmtd.

loop at gm_return.
  write:/ gm_return.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Aug 2006 19:47:05 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-08-10T19:47:05Z</dc:date>
    <item>
      <title>Bapi or Functional Module !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553322#M250866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anybody tell me a BAPI or Function Module for storage location to storage location transfer?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Drew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 19:34:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553322#M250866</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-10T19:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: Bapi or Functional Module !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553323#M250867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Will this work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_GOODSMVT_CREATE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 19:42:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553323#M250867</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-10T19:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Bapi or Functional Module !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553324#M250868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, use BAPI BAPI_GOODSMVT_CREATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 19:43:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553324#M250868</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-10T19:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Bapi or Functional Module !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553325#M250869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the example program.  This does a movement from sl to sl for a certain material.&lt;/P&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;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

* Structures for BAPI
data: gm_header  type bapi2017_gm_head_01.
data: gm_code    type bapi2017_gm_code.
data: gm_headret type bapi2017_gm_head_ret.
data: gm_item    type table of
                 bapi2017_gm_item_create with header line.
data: gm_return  type bapiret2 occurs 0 with header line.
data: gm_retmtd  type bapi2017_gm_head_ret-mat_doc.

clear: gm_return, gm_retmtd. refresh gm_return.

* Setup BAPI header data.
gm_header-pstng_date = sy-datum.
gm_header-doc_date   = sy-datum.
gm_code-gm_code      = '04'.

* Write 311 movement to table
clear gm_item.
move '311'                 to gm_item-move_type     .
move '000000000040000100'  to gm_item-material.
move '1'     to gm_item-entry_qnt.
move 'EA'    to gm_item-entry_uom.
move '0004'  to gm_item-plant.
move '4000'  to gm_item-stge_loc.
move '4999'  to gm_item-move_stloc.

append gm_item.

* Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
     exporting
          goodsmvt_header  = gm_header
          goodsmvt_code    = gm_code
     importing
          goodsmvt_headret = gm_headret
          materialdocument = gm_retmtd
     tables
          goodsmvt_item    = gm_item
          return           = gm_return.

if not gm_retmtd is initial.
  commit work and wait.
  call function 'DEQUEUE_ALL'.
else.
  commit work and wait.
  call function 'DEQUEUE_ALL'.
endif.

write:/ gm_retmtd.

loop at gm_return.
  write:/ gm_return.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 19:47:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553325#M250869</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-10T19:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Bapi or Functional Module !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553326#M250870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use BAPI_GOODSMVT_CREATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Sample code:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* BAPI Communication Structure: Material Document Header Data  
   data xl_bapi2017_gm_head_01 like bapi2017_gm_head_01.

* BAPI Structure-New Key Assignment GM_CODE to Transaction of Inv. Mgmt
  data xl_bapi2017_gm_code like bapi2017_gm_code.

* MMIM: Output Structure For General FM To Post Goods Movement
  data xl_bapi2017_gm_head_ret like bapi2017_gm_head_ret.

* BAPI Communication Structure: Create Material Document Item
  data itl_bapi2017_gm_item_create like bapi2017_gm_item_create
           occurs 0 with header line.

* BAPI Communication Structure: Create Mat. Doc., Serial No.
  data itl_bapi2017_gm_serialnumber like bapi2017_gm_serialnumber
           occurs 0 with header line.


* Populating Material Document Header Data
  xl_bapi2017_gm_head_01-pstng_date      = sy-datum.      "Posting date
  xl_bapi2017_gm_head_01-doc_date        = sy-datum.      "Document date

* Populating New Key Assignment GM_CODE to Transaction of Inv. Mgmt
  xl_bapi2017_gm_code-gm_code            =   "Movement code

* Populating BAPI Communication Structure: Create Material Document Item
  itl_bapi2017_gm_item_create-material   = "Material
  itl_bapi2017_gm_item_create-plant      = "Plant
  itl_bapi2017_gm_item_create-stge_loc   = "Storage Loc.
  itl_bapi2017_gm_item_create-batch      = "Batch
  itl_bapi2017_gm_item_create-move_type  = "Movement type
  itl_bapi2017_gm_item_create-customer   = "Customer
  itl_bapi2017_gm_item_create-entry_qnt  = "Quantity
  itl_bapi2017_gm_item_create-profit_ctr = "Profit Center
  append itl_bapi2017_gm_item_create.


* Calling BAPI function module BAPI_GOODSMVT_CREATE
  refresh it_bapiret2.
  clear it_bapiret2.
  call function 'BAPI_GOODSMVT_CREATE'
       exporting
            goodsmvt_header       = xl_bapi2017_gm_head_01
            goodsmvt_code         = xl_bapi2017_gm_code
*           TESTRUN               = ' '
       importing
            goodsmvt_headret      = xl_bapi2017_gm_head_ret
*           MATERIALDOCUMENT      =
*           MATDOCUMENTYEAR       =
       tables
            goodsmvt_item         = itl_bapi2017_gm_item_create
            goodsmvt_serialnumber = itl_bapi2017_gm_serialnumber
            return                = it_bapiret2.
* In case of Error
  if it_bapiret2-type &amp;lt;&amp;gt; 'E'.          "If BAPI returned error
 
    call function BAPI_TRANSACTION_COMMIT
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 20:01:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553326#M250870</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-10T20:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bapi or Functional Module !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553327#M250871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You guys...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 20:02:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553327#M250871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-10T20:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Bapi or Functional Module !!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553328#M250872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please make sure to award points for helpful answers and mark your post as solved when solved completely.  Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2006 20:04:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-or-functional-module/m-p/1553328#M250872</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-10T20:04:32Z</dc:date>
    </item>
  </channel>
</rss>

