<?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/2560858#M584029</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;Please check your user's date format settings to be the same in both systems. You can change it in 4.7 if it leads to the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System menu - User defaults - Own data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jul 2007 10:07:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-17T10:07:06Z</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/2560857#M584028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am testing BAPI Function module BAPI_GOODSMVT_CREATE in 4.7 Version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an error like this.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------" /&gt;&lt;P&gt;LOBM_VFDAT: Value "00.00.0000" not found&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I am testing the same BAPI Function module in ECC 6.0, Its Working Fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone spot the Error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vijayanand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 10:04:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/2560857#M584028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-17T10:04:11Z</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/2560858#M584029</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;Please check your user's date format settings to be the same in both systems. You can change it in 4.7 if it leads to the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;System menu - User defaults - Own data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tamá&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 10:07:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/2560858#M584029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-17T10:07:06Z</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/2560859#M584030</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;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form process_0112.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  clear post_status.&lt;/P&gt;&lt;P&gt;  post_status-delivery = wa_likp-vbeln.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;posting&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform post_goodsreceipt     changing post_status.&lt;/P&gt;&lt;P&gt;  perform post_delivery_hist    changing post_status.&lt;/P&gt;&lt;P&gt;  perform post_transferorder    changing post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;reversal posting if necessary&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform reverse_goodsreceipt  changing post_status.&lt;/P&gt;&lt;P&gt;  perform reverse_delivery_hist changing post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;display message in case of error&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform issue_message         changing post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;leave transaction&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  leave to transaction sy-tcode.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endform.                    " process_0112&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form post_goodsreceipt changing post_status structure post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA DECLARATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_head.&lt;/P&gt;&lt;P&gt;          include structure bapi2017_gm_head_01.&lt;/P&gt;&lt;P&gt;  data: end of it_head.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;T158G special code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_code.&lt;/P&gt;&lt;P&gt;          include structure bapi2017_gm_code.&lt;/P&gt;&lt;P&gt;  data: end of it_code.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document returned data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_rthead.&lt;/P&gt;&lt;P&gt;          include structure bapi2017_gm_head_ret.&lt;/P&gt;&lt;P&gt;  data: end of it_rthead.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document items&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_pos occurs 100.&lt;/P&gt;&lt;P&gt;          include structure bapi2017_gm_item_create.&lt;/P&gt;&lt;P&gt;  data: end of it_pos.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;error table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_errmsg occurs 10.&lt;/P&gt;&lt;P&gt;          include structure bapiret2.&lt;/P&gt;&lt;P&gt;  data: end of it_errmsg.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;return data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: post_mat_doc  type bapi2017_gm_head_ret-mat_doc,&lt;/P&gt;&lt;P&gt;        post_doc_year type bapi2017_gm_head_ret-doc_year.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILL DATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  it_head-pstng_date  = sy-datum.            &lt;/P&gt;&lt;P&gt;  it_head-doc_date    = sy-datum.            &lt;/P&gt;&lt;P&gt;  it_head-header_txt  = 'RF'.                &lt;/P&gt;&lt;P&gt;  it_head-pr_uname    = sy-uname.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;T158G code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  it_code-gm_code     = '01'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document items&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at it_lips into wa_lips where posnr &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;    it_pos-mvt_ind              = 'B'.&lt;/P&gt;&lt;P&gt;    it_pos-deliv_numb_to_search = wa_lips-vbeln.&lt;/P&gt;&lt;P&gt;    it_pos-deliv_item_to_search = wa_lips-posnr.&lt;/P&gt;&lt;P&gt;    it_pos-po_number            = wa_lips-vgbel.&lt;/P&gt;&lt;P&gt;    it_pos-po_item              = wa_lips-vgpos.&lt;/P&gt;&lt;P&gt;    it_pos-move_type            = '985'.&lt;/P&gt;&lt;P&gt;    it_pos-entry_qnt            = wa_lips-rv_lfimg.&lt;/P&gt;&lt;P&gt;    append it_pos.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL BAPI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  refresh: it_errmsg.&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             = it_head&lt;/P&gt;&lt;P&gt;      goodsmvt_code               = it_code&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      materialdocument            = post_mat_doc&lt;/P&gt;&lt;P&gt;      matdocumentyear             = post_doc_year&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      goodsmvt_item               = it_pos&lt;/P&gt;&lt;P&gt;      return                      = it_errmsg.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;check result&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if post_mat_doc is initial.&lt;/P&gt;&lt;P&gt;    post_status-post_mat_doc  = space.&lt;/P&gt;&lt;P&gt;    post_status-post_doc_year = space.&lt;/P&gt;&lt;P&gt;    rollback work.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    post_status-post_mat_doc  = post_mat_doc.&lt;/P&gt;&lt;P&gt;    post_status-post_doc_year = post_doc_year.&lt;/P&gt;&lt;P&gt;    commit work and wait.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endform.                    " post_goodsreceipt&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form post_delivery_hist changing post_status structure post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA DECLARATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  data: it_vbfa    like vbfa occurs 0,&lt;/P&gt;&lt;P&gt;        wa_vbfa    like vbfa.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CHECK IF UPDATE DELIVERY IS ESSENTIAL&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  check not post_status-post_mat_doc  is initial&lt;/P&gt;&lt;P&gt;  and   not post_status-post_doc_year is initial.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;POPULATE TABLE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  loop at it_lips into wa_lips where posnr &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;    clear wa_vbfa.&lt;/P&gt;&lt;P&gt;    wa_vbfa-vbelv = wa_lips-vbeln.&lt;/P&gt;&lt;P&gt;    wa_vbfa-posnv = wa_lips-posnr.&lt;/P&gt;&lt;P&gt;    wa_vbfa-vbeln = post_status-post_mat_doc.&lt;/P&gt;&lt;P&gt;    wa_vbfa-vbtyp_n = 'R'.&lt;/P&gt;&lt;P&gt;    wa_vbfa-vbtyp_v = '7'.&lt;/P&gt;&lt;P&gt;    wa_vbfa-plmin   = '+'.&lt;/P&gt;&lt;P&gt;    select single zeile waers menge dmbtr meins matnr bwart&lt;/P&gt;&lt;P&gt;      from mseg&lt;/P&gt;&lt;P&gt;        into (wa_vbfa-posnn, wa_vbfa-waers,&lt;/P&gt;&lt;P&gt;              wa_vbfa-rfmng, wa_vbfa-rfwrt,&lt;/P&gt;&lt;P&gt;              wa_vbfa-meins, wa_vbfa-matnr,&lt;/P&gt;&lt;P&gt;              wa_vbfa-bwart)&lt;/P&gt;&lt;P&gt;          where mblnr = post_status-post_mat_doc&lt;/P&gt;&lt;P&gt;            and mjahr = post_status-post_doc_year&lt;/P&gt;&lt;P&gt;            and ebeln = wa_lips-vgbel&lt;/P&gt;&lt;P&gt;            and ebelp = wa_lips-vgpos.&lt;/P&gt;&lt;P&gt;    append wa_vbfa to it_vbfa.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UPDATE DELIVERY&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  data:    begin of yvbfa occurs 0.&lt;/P&gt;&lt;P&gt;             include structure vbfavb.&lt;/P&gt;&lt;P&gt;  data:    end of yvbfa.&lt;/P&gt;&lt;P&gt;  data:    begin of xvbfa occurs 0.&lt;/P&gt;&lt;P&gt;             include structure vbfavb.&lt;/P&gt;&lt;P&gt;  data:    end of xvbfa.&lt;/P&gt;&lt;P&gt;  data:    begin of xvttk occurs 0.&lt;/P&gt;&lt;P&gt;             include structure vttkvb.&lt;/P&gt;&lt;P&gt;  data:    end of xvttk.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  sort it_vbfa by mandt vbelv posnv vbeln posnn vbtyp_n.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  loop at it_vbfa into xvbfa.&lt;/P&gt;&lt;P&gt;    xvbfa-rfmng_flt = xvbfa-rfmng.&lt;/P&gt;&lt;P&gt;    xvbfa-updkz = 'I'.&lt;/P&gt;&lt;P&gt;    append xvbfa.&lt;/P&gt;&lt;P&gt;    at end of vbelv.&lt;/P&gt;&lt;P&gt;      call function 'SD_DELIVERY_UPDATE'&lt;/P&gt;&lt;P&gt;           exporting&lt;/P&gt;&lt;P&gt;                i_vbtyp          = '7'&lt;/P&gt;&lt;P&gt;                nicht_sperren    = 'Y'&lt;/P&gt;&lt;P&gt;                no_imseg_refresh = 'X'&lt;/P&gt;&lt;P&gt;           tables&lt;/P&gt;&lt;P&gt;                zxvbfa        = xvbfa&lt;/P&gt;&lt;P&gt;                zyvbfa        = yvbfa&lt;/P&gt;&lt;P&gt;                zxvttk        = xvttk&lt;/P&gt;&lt;P&gt;           exceptions&lt;/P&gt;&lt;P&gt;                others        = 1.&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      refresh xvbfa.&lt;/P&gt;&lt;P&gt;    endat.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;check result&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    post_status-post_deli_hist  = 'R'.&lt;/P&gt;&lt;P&gt;    rollback work.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    post_status-post_deli_hist  = 'C'.&lt;/P&gt;&lt;P&gt;    commit work and wait.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endform.                    " post_delivery_hist&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;rewards point if useful.....&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;regards..&lt;/P&gt;&lt;P&gt;Abhay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 10:09:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/2560859#M584030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-17T10:09:23Z</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/2560860#M584031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form process_0112.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  clear post_status.&lt;/P&gt;&lt;P&gt;  post_status-delivery = wa_likp-vbeln.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;posting&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform post_goodsreceipt     changing post_status.&lt;/P&gt;&lt;P&gt;  perform post_delivery_hist    changing post_status.&lt;/P&gt;&lt;P&gt;  perform post_transferorder    changing post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;reversal posting if necessary&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform reverse_goodsreceipt  changing post_status.&lt;/P&gt;&lt;P&gt;  perform reverse_delivery_hist changing post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;display message in case of error&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform issue_message         changing post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;leave transaction&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  leave to transaction sy-tcode.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endform.                    " process_0112&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form post_goodsreceipt changing post_status structure post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA DECLARATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_head.&lt;/P&gt;&lt;P&gt;          include structure bapi2017_gm_head_01.&lt;/P&gt;&lt;P&gt;  data: end of it_head.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;T158G special code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_code.&lt;/P&gt;&lt;P&gt;          include structure bapi2017_gm_code.&lt;/P&gt;&lt;P&gt;  data: end of it_code.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document returned data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_rthead.&lt;/P&gt;&lt;P&gt;          include structure bapi2017_gm_head_ret.&lt;/P&gt;&lt;P&gt;  data: end of it_rthead.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document items&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_pos occurs 100.&lt;/P&gt;&lt;P&gt;          include structure bapi2017_gm_item_create.&lt;/P&gt;&lt;P&gt;  data: end of it_pos.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;error table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: begin of it_errmsg occurs 10.&lt;/P&gt;&lt;P&gt;          include structure bapiret2.&lt;/P&gt;&lt;P&gt;  data: end of it_errmsg.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;return data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  data: post_mat_doc  type bapi2017_gm_head_ret-mat_doc,&lt;/P&gt;&lt;P&gt;        post_doc_year type bapi2017_gm_head_ret-doc_year.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FILL DATA&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  it_head-pstng_date  = sy-datum.            &lt;/P&gt;&lt;P&gt;  it_head-doc_date    = sy-datum.            &lt;/P&gt;&lt;P&gt;  it_head-header_txt  = 'RF'.                &lt;/P&gt;&lt;P&gt;  it_head-pr_uname    = sy-uname.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;T158G code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  it_code-gm_code     = '01'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material document items&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at it_lips into wa_lips where posnr &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;    it_pos-mvt_ind              = 'B'.&lt;/P&gt;&lt;P&gt;    it_pos-deliv_numb_to_search = wa_lips-vbeln.&lt;/P&gt;&lt;P&gt;    it_pos-deliv_item_to_search = wa_lips-posnr.&lt;/P&gt;&lt;P&gt;    it_pos-po_number            = wa_lips-vgbel.&lt;/P&gt;&lt;P&gt;    it_pos-po_item              = wa_lips-vgpos.&lt;/P&gt;&lt;P&gt;    it_pos-move_type            = '985'.&lt;/P&gt;&lt;P&gt;    it_pos-entry_qnt            = wa_lips-rv_lfimg.&lt;/P&gt;&lt;P&gt;    append it_pos.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL BAPI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  refresh: it_errmsg.&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             = it_head&lt;/P&gt;&lt;P&gt;      goodsmvt_code               = it_code&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      materialdocument            = post_mat_doc&lt;/P&gt;&lt;P&gt;      matdocumentyear             = post_doc_year&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      goodsmvt_item               = it_pos&lt;/P&gt;&lt;P&gt;      return                      = it_errmsg.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;check result&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if post_mat_doc is initial.&lt;/P&gt;&lt;P&gt;    post_status-post_mat_doc  = space.&lt;/P&gt;&lt;P&gt;    post_status-post_doc_year = space.&lt;/P&gt;&lt;P&gt;    rollback work.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    post_status-post_mat_doc  = post_mat_doc.&lt;/P&gt;&lt;P&gt;    post_status-post_doc_year = post_doc_year.&lt;/P&gt;&lt;P&gt;    commit work and wait.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endform.                    " post_goodsreceipt&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form post_delivery_hist changing post_status structure post_status.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATA DECLARATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  data: it_vbfa    like vbfa occurs 0,&lt;/P&gt;&lt;P&gt;        wa_vbfa    like vbfa.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CHECK IF UPDATE DELIVERY IS ESSENTIAL&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  check not post_status-post_mat_doc  is initial&lt;/P&gt;&lt;P&gt;  and   not post_status-post_doc_year is initial.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;POPULATE TABLE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  loop at it_lips into wa_lips where posnr &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;    clear wa_vbfa.&lt;/P&gt;&lt;P&gt;    wa_vbfa-vbelv = wa_lips-vbeln.&lt;/P&gt;&lt;P&gt;    wa_vbfa-posnv = wa_lips-posnr.&lt;/P&gt;&lt;P&gt;    wa_vbfa-vbeln = post_status-post_mat_doc.&lt;/P&gt;&lt;P&gt;    wa_vbfa-vbtyp_n = 'R'.&lt;/P&gt;&lt;P&gt;    wa_vbfa-vbtyp_v = '7'.&lt;/P&gt;&lt;P&gt;    wa_vbfa-plmin   = '+'.&lt;/P&gt;&lt;P&gt;    select single zeile waers menge dmbtr meins matnr bwart&lt;/P&gt;&lt;P&gt;      from mseg&lt;/P&gt;&lt;P&gt;        into (wa_vbfa-posnn, wa_vbfa-waers,&lt;/P&gt;&lt;P&gt;              wa_vbfa-rfmng, wa_vbfa-rfwrt,&lt;/P&gt;&lt;P&gt;              wa_vbfa-meins, wa_vbfa-matnr,&lt;/P&gt;&lt;P&gt;              wa_vbfa-bwart)&lt;/P&gt;&lt;P&gt;          where mblnr = post_status-post_mat_doc&lt;/P&gt;&lt;P&gt;            and mjahr = post_status-post_doc_year&lt;/P&gt;&lt;P&gt;            and ebeln = wa_lips-vgbel&lt;/P&gt;&lt;P&gt;            and ebelp = wa_lips-vgpos.&lt;/P&gt;&lt;P&gt;    append wa_vbfa to it_vbfa.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UPDATE DELIVERY&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;  data:    begin of yvbfa occurs 0.&lt;/P&gt;&lt;P&gt;             include structure vbfavb.&lt;/P&gt;&lt;P&gt;  data:    end of yvbfa.&lt;/P&gt;&lt;P&gt;  data:    begin of xvbfa occurs 0.&lt;/P&gt;&lt;P&gt;             include structure vbfavb.&lt;/P&gt;&lt;P&gt;  data:    end of xvbfa.&lt;/P&gt;&lt;P&gt;  data:    begin of xvttk occurs 0.&lt;/P&gt;&lt;P&gt;             include structure vttkvb.&lt;/P&gt;&lt;P&gt;  data:    end of xvttk.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  sort it_vbfa by mandt vbelv posnv vbeln posnn vbtyp_n.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  loop at it_vbfa into xvbfa.&lt;/P&gt;&lt;P&gt;    xvbfa-rfmng_flt = xvbfa-rfmng.&lt;/P&gt;&lt;P&gt;    xvbfa-updkz = 'I'.&lt;/P&gt;&lt;P&gt;    append xvbfa.&lt;/P&gt;&lt;P&gt;    at end of vbelv.&lt;/P&gt;&lt;P&gt;      call function 'SD_DELIVERY_UPDATE'&lt;/P&gt;&lt;P&gt;           exporting&lt;/P&gt;&lt;P&gt;                i_vbtyp          = '7'&lt;/P&gt;&lt;P&gt;                nicht_sperren    = 'Y'&lt;/P&gt;&lt;P&gt;                no_imseg_refresh = 'X'&lt;/P&gt;&lt;P&gt;           tables&lt;/P&gt;&lt;P&gt;                zxvbfa        = xvbfa&lt;/P&gt;&lt;P&gt;                zyvbfa        = yvbfa&lt;/P&gt;&lt;P&gt;                zxvttk        = xvttk&lt;/P&gt;&lt;P&gt;           exceptions&lt;/P&gt;&lt;P&gt;                others        = 1.&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        exit.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      refresh xvbfa.&lt;/P&gt;&lt;P&gt;    endat.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;check result&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    post_status-post_deli_hist  = 'R'.&lt;/P&gt;&lt;P&gt;    rollback work.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    post_status-post_deli_hist  = 'C'.&lt;/P&gt;&lt;P&gt;    commit work and wait.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endform.                    " post_delivery_hist&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check this link.... u will get all help from this code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap4.com/wiki/index.php?title=BAPI_GOODSMVT_CREATE&amp;amp;printable=yes" target="test_blank"&gt;http://sap4.com/wiki/index.php?title=BAPI_GOODSMVT_CREATE&amp;amp;printable=yes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 10:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-goodsmvt-create-problem/m-p/2560860#M584031</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-17T10:11:24Z</dc:date>
    </item>
  </channel>
</rss>

