<?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 Calling BAPI_GOODSMVT_CREATE in MB_DOCUMENT_BADI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-bapi-goodsmvt-create-in-mb-document-badi/m-p/9477451#M1744339</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;This is my first question on this portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need to create a goods movement (code 501) whenever a goods movement code 261 is created, whether it's from transaction MIGO, MB1A or a custom program that generates them. So i used the BAdI MB_DOCUMENT_BADI - method MB_DOCUMENT_BEFORE_UPDATE to call a function i wrote to created the goods movement 501. This function calls BAPI_GOODSMVT_CREATE to do the busy work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In testing, my goods movement creation code works great, but when it's called within the BADI, it fails and i get this message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short text of error message:&lt;BR /&gt;Function module MB_CREATE_GOODS_MOVEMENT cannot be executed&lt;/P&gt;&lt;P&gt;Long text of error message:&lt;BR /&gt; Diagnosis&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The function module MB_CREATE_GOODS_MOVEMENT is called up for the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; second time. After it was called up the first time, the function&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; module MB_POST_GOODS_MOVEMENT was called, but a COMMIT WORK was not&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; carried out in the calling program.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As running the two function modules again would result in the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; database being incorrectly updated, processing is terminated.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System Response Procedure Please ensure that a COMMIT WORK is set&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; after you call up the function module MB_POST_GOODS_MOVEMENT.&lt;/P&gt;&lt;P&gt;Technical information about the message:&lt;BR /&gt;Message class....... "M7"&lt;BR /&gt;Number.............. 299&lt;BR /&gt;Variable 1.......... " "&lt;BR /&gt;Variable 2.......... " "&lt;BR /&gt;Variable 3.......... " "&lt;BR /&gt;Variable 4.......... " "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what i understand, i'm calling the function module MB_CREATE_GOODS_MOVEMENT within itself (before i can commit the BAPI) and SAP doesn't like that. Any idea how i can bypass that? Right now, it's done by a program that runs every hours that looks for the newly created material documents with the code 261 but the maintenance and warehouse teams need these to be instantaneous.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 May 2013 12:39:32 GMT</pubDate>
    <dc:creator>former_member223727</dc:creator>
    <dc:date>2013-05-16T12:39:32Z</dc:date>
    <item>
      <title>Calling BAPI_GOODSMVT_CREATE in MB_DOCUMENT_BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-bapi-goodsmvt-create-in-mb-document-badi/m-p/9477451#M1744339</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;This is my first question on this portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need to create a goods movement (code 501) whenever a goods movement code 261 is created, whether it's from transaction MIGO, MB1A or a custom program that generates them. So i used the BAdI MB_DOCUMENT_BADI - method MB_DOCUMENT_BEFORE_UPDATE to call a function i wrote to created the goods movement 501. This function calls BAPI_GOODSMVT_CREATE to do the busy work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In testing, my goods movement creation code works great, but when it's called within the BADI, it fails and i get this message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Short text of error message:&lt;BR /&gt;Function module MB_CREATE_GOODS_MOVEMENT cannot be executed&lt;/P&gt;&lt;P&gt;Long text of error message:&lt;BR /&gt; Diagnosis&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The function module MB_CREATE_GOODS_MOVEMENT is called up for the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; second time. After it was called up the first time, the function&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; module MB_POST_GOODS_MOVEMENT was called, but a COMMIT WORK was not&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; carried out in the calling program.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As running the two function modules again would result in the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; database being incorrectly updated, processing is terminated.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System Response Procedure Please ensure that a COMMIT WORK is set&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; after you call up the function module MB_POST_GOODS_MOVEMENT.&lt;/P&gt;&lt;P&gt;Technical information about the message:&lt;BR /&gt;Message class....... "M7"&lt;BR /&gt;Number.............. 299&lt;BR /&gt;Variable 1.......... " "&lt;BR /&gt;Variable 2.......... " "&lt;BR /&gt;Variable 3.......... " "&lt;BR /&gt;Variable 4.......... " "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what i understand, i'm calling the function module MB_CREATE_GOODS_MOVEMENT within itself (before i can commit the BAPI) and SAP doesn't like that. Any idea how i can bypass that? Right now, it's done by a program that runs every hours that looks for the newly created material documents with the code 261 but the maintenance and warehouse teams need these to be instantaneous.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2013 12:39:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-bapi-goodsmvt-create-in-mb-document-badi/m-p/9477451#M1744339</guid>
      <dc:creator>former_member223727</dc:creator>
      <dc:date>2013-05-16T12:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calling BAPI_GOODSMVT_CREATE in MB_DOCUMENT_BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-bapi-goodsmvt-create-in-mb-document-badi/m-p/9477452#M1744340</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;Call it with a job. Create this calling and encapsulate it in a function module with option IN UPDATE TASK. Call the BAPI from a report (with a selection screen), so, the sequence is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JOB_OPEN&lt;/P&gt;&lt;P&gt;GET_PRINT_PARAMETERS&lt;/P&gt;&lt;P&gt;RS_CREATE_VARIANT&amp;nbsp;&amp;nbsp; "where you call this report&lt;/P&gt;&lt;P&gt;JOB_SUBMIT&lt;/P&gt;&lt;P&gt;JOB_CLOSE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And try in the same BADI but with method POST_DOCUMENT (you have the ID MBLNR and you can set it in any field and you can made some traceability for both documents)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eduardo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 12:24:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-bapi-goodsmvt-create-in-mb-document-badi/m-p/9477452#M1744340</guid>
      <dc:creator>eduardo_hinojosa</dc:creator>
      <dc:date>2013-05-17T12:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calling BAPI_GOODSMVT_CREATE in MB_DOCUMENT_BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-bapi-goodsmvt-create-in-mb-document-badi/m-p/9477453#M1744341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I pushed my code in a program and called it with a job defined in the BAdI and it works like a charm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 May 2013 19:50:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-bapi-goodsmvt-create-in-mb-document-badi/m-p/9477453#M1744341</guid>
      <dc:creator>former_member223727</dc:creator>
      <dc:date>2013-05-17T19:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calling BAPI_GOODSMVT_CREATE in MB_DOCUMENT_BADI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/calling-bapi-goodsmvt-create-in-mb-document-badi/m-p/13868290#M2030982</link>
      <description>&lt;P&gt;Hi ,&lt;BR /&gt;I have the&amp;nbsp; same requirement Could you please share sample code for below&amp;nbsp;&lt;/P&gt;&lt;P&gt;JOB_OPEN&lt;/P&gt;&lt;P&gt;GET_PRINT_PARAMETERS&lt;/P&gt;&lt;P&gt;RS_CREATE_VARIANT&amp;nbsp;&amp;nbsp; "where you call this report&lt;/P&gt;&lt;P&gt;JOB_SUBMIT&lt;/P&gt;&lt;P&gt;JOB_CLOSE&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 14:02:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/calling-bapi-goodsmvt-create-in-mb-document-badi/m-p/13868290#M2030982</guid>
      <dc:creator>Srinivas327</dc:creator>
      <dc:date>2024-09-17T14:02:19Z</dc:date>
    </item>
  </channel>
</rss>

