<?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 for MB31 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638616#M1443073</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_GOODSMVT_CREATE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the function module documentation ... Its very clear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Feb 2010 14:39:45 GMT</pubDate>
    <dc:creator>kesavadas_thekkillath</dc:creator>
    <dc:date>2010-02-06T14:39:45Z</dc:date>
    <item>
      <title>BAPI for MB31</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638614#M1443071</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;can any1 plz tel me the bapi for T.code MB31.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i have to do is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MB31 ---&amp;gt;give movt. type (101), order, plant, stor. location, and press enter&lt;/P&gt;&lt;P&gt;selct item &lt;DEL&gt;&amp;gt; press Adopt+ details, then click on Adopt&lt;/DEL&gt;-&amp;gt;Goto  Details from items&lt;/P&gt;&lt;P&gt;then Goto --&amp;gt; Classify Batch --&amp;gt; gives values and save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz let me what bapi to be used and that are the field need to be export to BAPI function module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Feb 2010 12:42:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638614#M1443071</guid>
      <dc:creator>Noorie</dc:creator>
      <dc:date>2010-02-06T12:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for MB31</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638615#M1443072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hie&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create Goods Receipt you can use the BAPI below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
BAPI_GOODSMVT_CREATE

see the sample code also:

*------------------------------------------------------------------------
*   Populate the header data
*------------------------------------------------------------------------
*   Convert date to internal format recognizable by BAPI
      CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'
        EXPORTING
          datum = xheader-pstng_date
          dtype = 'DATS'
        IMPORTING
          idate = xgd_header-pstng_date.
*   Convert date to internal format recognizable by BAPI
      CALL FUNCTION 'CONVERT_DATE_TO_INTERN_FORMAT'
        EXPORTING
          datum = xheader-doc_date
          dtype = 'DATS'
        IMPORTING
          idate = xgd_header-doc_date.
      xgd_header-pr_uname       = xheader-pr_uname.
      xgd_header-ref_doc_no     = xheader-works_order.
      xgd_header-header_txt     = xheader-header_txt.
*--------------------------------------------------------------------------
*Populate the trailer items
*--------------------------------------------------------------------------
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = xtrailer-material
        IMPORTING
          output = xgoodsmvt_item-material.
      xgoodsmvt_item-plant      = xtrailer-plant.
      xgoodsmvt_item-stge_loc   = xtrailer-stge_loc.
      xgoodsmvt_item-move_type  = xtrailer-move_type.
      xgoodsmvt_item-vendor     = xtrailer-vendor.
      xgoodsmvt_item-item_text  = xtrailer-item_text.
      xgoodsmvt_item-entry_qnt  = xtrailer-quantity.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = xtrailer-costcenter
        IMPORTING
          output = xgoodsmvt_item-costcenter.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = xtrailer-gl_account
        IMPORTING
          output = xgoodsmvt_item-gl_account.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = xtrailer-gl_account
        IMPORTING
          output = xgoodsmvt_item-gl_account.
*-----------------------------------------------------------------------
*Meaning of the GM Code
*-----------------------------------------------------------------------
* GM_Code 01: Goods receipt for purchase order
* GM_Code 02: Goods receipt for production order
* GM_Code 03: Goods issue
* GM_Code 04: Transfer posting
* GM_Code 05: Other goods receipt
* GM_Code 06: Reversal of goods movements
* GM_Code 07: Subsequent adjustment with regard to a subcontract order
*------------------------------------------------------------------------
      xgd_code-gm_code = '01'.
*-------------------------------------------------------------------------
*Append the data records to the BAPI transfer structures
*-------------------------------------------------------------------------
      APPEND xgoodsmvt_item.
*-------------------------------------------------------------------------
    ENDLOOP.
*-------------------------------------------------------------------------
*Append detail to header structure outside of line items loop
*-------------------------------------------------------------------------
    APPEND xgd_header.
*-------------------------------------------------------------------------
*Create the goods receipt
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header  = xgd_header
        goodsmvt_code    = '01'                           "xgd_code
      IMPORTING
        materialdocument = xmat_doc
        matdocumentyear  = xmat_doc_yr
      TABLES
        goodsmvt_item    = xgoodsmvt_item
        return           = xreturn.

    read table xreturn.
    if sy-tfill &amp;lt;&amp;gt; 0.
      LOOP AT xreturn.

        CLEAR xf_return.
        MOVE-CORRESPONDING xreturn TO xf_return.
        IF xreturn-type = 'A' OR xreturn-type = 'E'.
          xf_return-error_flag = 'X'.
          error_flag = 'X'.
        ENDIF.
        APPEND xf_return.
      endloop.
    else.

    IF error_flag = 'X'.
      ROLLBACK WORK.
    ELSE.
      COMMIT WORK.
      xfinal-works_order  = xheader-works_order.
      xfinal-mat_doc      = xmat_doc.
      xfinal-mat_doc_yr   = xmat_doc_yr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Feb 2010 14:26:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638615#M1443072</guid>
      <dc:creator>prince_isaac</dc:creator>
      <dc:date>2010-02-06T14:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for MB31</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638616#M1443073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_GOODSMVT_CREATE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the function module documentation ... Its very clear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Feb 2010 14:39:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638616#M1443073</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-02-06T14:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for MB31</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638617#M1443074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;chk this wiki for BAPI_GOODSMVT_CREATE(To Post Goods Movement) sample code&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiki.sdn.sap.com/wiki/display/Snippets/BAPI_GOODSMVT_CREATE-ABAP" target="test_blank"&gt;http://wiki.sdn.sap.com/wiki/display/Snippets/BAPI_GOODSMVT_CREATE-ABAP&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Feb 2010 02:38:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638617#M1443074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-07T02:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for MB31</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638618#M1443075</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;Thanks all of you for your kind reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My main concern is i have to give some valuse in classfy batch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MB31 ---&amp;gt;give movt. type (101), order, plant, stor. location, and press enter&lt;/P&gt;&lt;P&gt;selct item &lt;DEL&gt;&amp;gt; press Adopt+ details, then click on Adopt&lt;/DEL&gt;-&amp;gt;Goto  Details from items&lt;/P&gt;&lt;P&gt;then &lt;STRONG&gt;Goto --&amp;gt; Classify Batch --&amp;gt; gives values and save&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wher and how to export this data to BAPI.&lt;/P&gt;&lt;P&gt;we have header for header data and item table for item data etc... for for this classify batch-- i have to give some characterstics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly let me know&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks n regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Feb 2010 07:40:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-mb31/m-p/6638618#M1443075</guid>
      <dc:creator>Noorie</dc:creator>
      <dc:date>2010-02-07T07:40:53Z</dc:date>
    </item>
  </channel>
</rss>

