<?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 material deletion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018054#M1347192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example for delete material on plant level:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: XHEADDATA   LIKE BAPIMATHEAD        OCCURS 0 WITH HEADER LINE,
      XPLANTDATA  LIKE BAPI_MARC          OCCURS 0 WITH HEADER LINE,
      XPLANTDATAX LIKE BAPI_MARCX         OCCURS 0 WITH HEADER LINE,
      XRETURN     LIKE BAPI_MATRETURN2    OCCURS 0 WITH HEADER LINE.

XPLANTDATA-PLANT      = P_WERKS. " set plant here
XPLANTDATA-DEL_FLAG   = 'X'.
APPEND XPLANTDATA.

XPLANTDATAX-PLANT      = P_WERKS. " set plant here
XPLANTDATAX-DEL_FLAG   = 'X'.
APPEND XPLANTDATAX.

REFRESH XHEADDATA.
XHEADDATA-MATERIAL      = P_MATNR. " set material number here
XHEADDATA-STORAGE_VIEW  = 'X'.
XHEADDATA-INP_FLD_CHECK = 'W'.
APPEND XHEADDATA.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
     EXPORTING
          HEADDATA       = XHEADDATA
          PLANTDATA      = XPLANTDATA
          PLANTDATAX     = XPLANTDATAX
     TABLES
          RETURNMESSAGES = XRETURN.
IF SY-SUBRC = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
            WAIT            = 'X'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2009 06:25:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-04T06:25:28Z</dc:date>
    <item>
      <title>BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018047#M1347185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I have a requirement where I have to delete a material in the background. I understand that this is possible through BAPI_MATERIAL_DELETE but this bapi calls the transaction MM06. . Is there any other BAPI so that I can delete the material Directly in background. Any suggestion on this will be very helpful. I want to achieve this through BAPI only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance,&lt;/P&gt;&lt;P&gt;Rajeev.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:15:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018047#M1347185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018048#M1347186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use BAPI BAPI_MATERIAL_SAVEDATA&lt;/P&gt;&lt;P&gt;BAPI_MARA-DEL_FLAG - Flag Material for Deletion at Client Level&lt;/P&gt;&lt;P&gt;BAPI_MARC-DEL_FLAG - Flag Material for Deletion at Plant Level&lt;/P&gt;&lt;P&gt;BAPI_MARD-DEL_FLAG - Flag Material for Deletion at Storage Location Level&lt;/P&gt;&lt;P&gt;BAPI_MBEW-DEL_FLAG - Deletion flag for all material data of a valuation type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also do not forget to fill structures BAPI_MARAX, BAPI_MARCX etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018048#M1347186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018049#M1347187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this bapi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_MATERIAL_DELETE&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:20:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018049#M1347187</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2009-08-04T05:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018050#M1347188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;link:[http://abap.wikiprog.com/wiki/BAPI_MATERIAL_MAINTAINDATA_RT]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:21:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018050#M1347188</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-08-04T05:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018051#M1347189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Material can't be deleted but you can only mark the material for deletion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You might have to write BDC of t.code MM06 for marking material for deletion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:22:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018051#M1347189</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018052#M1347190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dzed,&lt;/P&gt;&lt;P&gt;Can you please tell me that how we can use BAPI_MATERIAL_SAVEDATA to delete the material?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:24:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018052#M1347190</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018053#M1347191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check documentation if available&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:30:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018053#M1347191</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-08-04T05:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018054#M1347192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example for delete material on plant level:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: XHEADDATA   LIKE BAPIMATHEAD        OCCURS 0 WITH HEADER LINE,
      XPLANTDATA  LIKE BAPI_MARC          OCCURS 0 WITH HEADER LINE,
      XPLANTDATAX LIKE BAPI_MARCX         OCCURS 0 WITH HEADER LINE,
      XRETURN     LIKE BAPI_MATRETURN2    OCCURS 0 WITH HEADER LINE.

XPLANTDATA-PLANT      = P_WERKS. " set plant here
XPLANTDATA-DEL_FLAG   = 'X'.
APPEND XPLANTDATA.

XPLANTDATAX-PLANT      = P_WERKS. " set plant here
XPLANTDATAX-DEL_FLAG   = 'X'.
APPEND XPLANTDATAX.

REFRESH XHEADDATA.
XHEADDATA-MATERIAL      = P_MATNR. " set material number here
XHEADDATA-STORAGE_VIEW  = 'X'.
XHEADDATA-INP_FLD_CHECK = 'W'.
APPEND XHEADDATA.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
     EXPORTING
          HEADDATA       = XHEADDATA
          PLANTDATA      = XPLANTDATA
          PLANTDATAX     = XPLANTDATAX
     TABLES
          RETURNMESSAGES = XRETURN.
IF SY-SUBRC = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
            WAIT            = 'X'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 06:25:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018054#M1347192</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T06:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018055#M1347193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dzed,&lt;/P&gt;&lt;P&gt;Can we delete the material by directly using BAPI_MATERIAL_SAVEDATA by entering all deletion flag fields and all required field? Also by using the above code, will be material be deleted at all level or just plant level?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 06:44:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018055#M1347193</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T06:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018056#M1347194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No. For delete on client level you need fill only BAPI_MARA-DEL_FLAG.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: XHEADDATA    LIKE BAPIMATHEAD        OCCURS 0 WITH HEADER LINE,
      XCLIENTDATA  LIKE BAPI_MARA          OCCURS 0 WITH HEADER LINE,
      XCLIENTDATAX LIKE BAPI_MARAX         OCCURS 0 WITH HEADER LINE,
      XRETURN      LIKE BAPI_MATRETURN2    OCCURS 0 WITH HEADER LINE.

XCLIENTDATA-DEL_FLAG   = 'X'.
APPEND XCLIENTDATA.

XCLIENTDATAX-DEL_FLAG   = 'X'.
APPEND XCLIENTDATAX.

REFRESH XHEADDATA.
XHEADDATA-MATERIAL      = P_MATNR. " set material number here
XHEADDATA-BASIC_VIEW  = 'X'.
XHEADDATA-INP_FLD_CHECK = 'W'.
APPEND XHEADDATA.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
     EXPORTING
          HEADDATA        = XHEADDATA
          CLIENTDATA      = XCLIENTDATA
          CLIENTDATAX     = XCLIENTDATAX
     TABLES
          RETURNMESSAGES = XRETURN.
IF SY-SUBRC = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
            WAIT            = 'X'.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 07:08:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018056#M1347194</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T07:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018057#M1347195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dzed,&lt;/P&gt;&lt;P&gt;when I m trying to delete material through this BAPI bu marking the flag for deletion, it is not being flagged for deletion. I can see this material in MM03. Please help me on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 08:42:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018057#M1347195</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T08:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018058#M1347196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Balu Latpate&lt;/STRONG&gt; have said you above: Material only mark as deleted.&lt;/P&gt;&lt;P&gt;In MM03 you can see this material, but will be message that this material was deleted on client level.&lt;/P&gt;&lt;P&gt;For delete this material from tables you need to archive this (t-code SARA, object MM_MATNR).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 08:54:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018058#M1347196</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T08:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018059#M1347197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dzed,&lt;/P&gt;&lt;P&gt;I can not see any message as you mentioned neither while doing it through BAPI nor while viewing in MM03. Please correct me am i going in right direction?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 09:55:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018059#M1347197</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T09:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for material deletion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018060#M1347198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx Dzed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 10:50:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-material-deletion/m-p/6018060#M1347198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T10:50:21Z</dc:date>
    </item>
  </channel>
</rss>

