<?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: ERROR: Gross Weight, Net Weight Upload using BAPI in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616487#M276068</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;have a look at the Sample programs of this BAPI ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm" target="test_blank"&gt;http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/bapi-to-copy-materials-from-one-plant-to-another.htm" target="test_blank"&gt;http://www.sap-img.com/abap/bapi-to-copy-materials-from-one-plant-to-another.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Sep 2006 19:04:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-22T19:04:02Z</dc:date>
    <item>
      <title>ERROR: Gross Weight, Net Weight Upload using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616486#M276067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written some code for Material Master: Gross Weight, Net Weight Upload using BAPI but i'm gettting errors from the BAPI. But i can create the same using mm02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;"Specify the conversion factors for the unit of measure EA"&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code i'm using is posted below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  Loop at itab.
    select single * from mara into mara
       where matnr = itab-matnr.                        


    xbapimathead-material          =   mara-matnr.        
    xbapimathead-ind_sector        =   mara-mbrsh.        
    xbapimathead-matl_type         =   mara-mtart.        
    xbapimathead-basic_view        =   'X'.

    xbapimara-matl_group           =   mara-matkl.        

    translate itab-weight using ', '.
    condense  itab-weight no-gaps.
    move      itab-weight to ws_brgew.

    xbapimara-net_weight           =   ws_brgew.
    xbapimara-unit_of_wt           =   'LB'.

    xbapimarax-net_weight          =   'X'.
    xbapimarax-unit_of_wt          =   'X'.

    xbapimarm-gross_wt             =   ws_brgew.
    xbapimarm-unit_of_wt           =   'LB'.
    xbapimarm-alt_unit             =   mara-meins.
    append xbapimarm.

    xbapimarmx-gross_wt            =   'X'.
    xbapimarmx-unit_of_wt          =   'X'.
    xbapimarmx-alt_unit            =   mara-meins.
    append xbapimarmx.

  clear: return.     refresh: return.

  call function 'BAPI_MATERIAL_SAVEDATA'
    exporting
      headdata        = xbapimathead
      clientdata      = xbapimara
      clientdatax     = xbapimarax
    importing
      return          = return
    tables
      unitsofmeasure  = xbapimarm
      unitsofmeasurex = xbapimarmx.

  read table return with key type = 'S'.
  if sy-subrc = 0.
    call function 'BAPI_TRANSACTION_COMMIT'
      exporting
        wait   = '1'
      importing
        return = return.
  endif.

  if return-type = 'E'.
    write:/       xbapimathead-material color 6.
  elseif return-type = 'S'.
    write:/       xbapimathead-material color 5.
  endif.
  write:    20  return-type,
            40  return-id,
            55  return-number,
            75  return-message.

Endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know what i'm doing wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Jr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Jr Abaper&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2006 18:58:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616486#M276067</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-22T18:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Gross Weight, Net Weight Upload using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616487#M276068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;have a look at the Sample programs of this BAPI ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm" target="test_blank"&gt;http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/bapi-to-copy-materials-from-one-plant-to-another.htm" target="test_blank"&gt;http://www.sap-img.com/abap/bapi-to-copy-materials-from-one-plant-to-another.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2006 19:04:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616487#M276068</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-22T19:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Gross Weight, Net Weight Upload using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616488#M276069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Sudheer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However those doesn't quite answer my problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks anyways,&lt;/P&gt;&lt;P&gt;Jr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2006 19:09:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616488#M276069</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-22T19:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Gross Weight, Net Weight Upload using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616489#M276070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try to pass the Base Unit of Measure which you can extract from MARA. I think that will rectify your error for Unit of Measure conversions. For unit of measure conversions, check table MARM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2006 19:47:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616489#M276070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-22T19:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Gross Weight, Net Weight Upload using BAPI</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616490#M276071</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;I checked this code..It is working fine for me..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since your code is within a loop make sure you refresh all the internal tables...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH: xbapimarm, xbapimarmx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the previous material data might carry over...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2006 20:11:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-gross-weight-net-weight-upload-using-bapi/m-p/1616490#M276071</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-22T20:11:06Z</dc:date>
    </item>
  </channel>
</rss>

