<?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: is there any BAPI or Function Module for Material Substitution create in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407605#M196595</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Shilpa has already used the FM 'RV_MAT_SUB_SAVE' and is not able to save the records. Why cant we try to commit the DB work by using 'BAPI_TRANSACTION_COMMIT' and see if table has been updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Dec 2006 11:02:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-13T11:02:45Z</dc:date>
    <item>
      <title>is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407595#M196585</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;Is ther any a BAPI or Function module to create or change material substitution (transaction VB11/VB12).&lt;/P&gt;&lt;P&gt;Appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 17:42:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407595#M196585</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-13T17:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407596#M196586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here you go!!&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;RV_MAT_SUB_SAVE&amp;lt;/b&amp;gt; ( Update for Material Substitution)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see Include :&amp;lt;b&amp;gt;MV13DF00&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RV_MAT_SUB_SAVE' IN UPDATE TASK&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            USE_OUTBOUND_CALL = BOOLE_T&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            X_KONDDVB         = XKONDD&lt;/P&gt;&lt;P&gt;            Y_KONDDVB         = YKONDD&lt;/P&gt;&lt;P&gt;            X_KONDDPVB        = XKONDDP&lt;/P&gt;&lt;P&gt;            Y_KONDDPVB        = YKONDDP&lt;/P&gt;&lt;P&gt;            DB_TIME           = TIME_VAKE_DB&lt;/P&gt;&lt;P&gt;            DB_XVAKE          = XVAKE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this&amp;#146;ll give you idea!!&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Pl... award the points.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Good luck &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Saquib Khan&lt;/P&gt;&lt;P&gt;"Some are wise and some are otherwise"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 17:47:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407596#M196586</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-07-13T17:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407597#M196587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hariprasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;PRODUCT_SUBSTITUTION&lt;/P&gt;&lt;P&gt;COND_CROSS_SELLING&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jul 2006 17:53:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407597#M196587</guid>
      <dc:creator>ferry_lianto</dc:creator>
      <dc:date>2006-07-13T17:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407598#M196588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried both the function modules with out much sucess. Basicaaly I want to save data for transaction VB11/VB12 in background. I don't want to use BDC to save data.Is there any BAPI which save data for Material Substitution?.&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, 14 Jul 2006 11:09:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407598#M196588</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-14T11:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407599#M196589</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;Try with Fm RV_MAT_SUB_SAVE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RV_MAT_SUB_SAVE' IN UPDATE TASK&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            USE_OUTBOUND_CALL = BOOLE_T&lt;/P&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            X_KONDDVB         = XKONDD&lt;/P&gt;&lt;P&gt;            Y_KONDDVB         = YKONDD&lt;/P&gt;&lt;P&gt;            X_KONDDPVB        = XKONDDP&lt;/P&gt;&lt;P&gt;            Y_KONDDPVB        = YKONDDP&lt;/P&gt;&lt;P&gt;            DB_TIME           = TIME_VAKE_DB&lt;/P&gt;&lt;P&gt;            DB_XVAKE          = XVAKE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This FM is used in the include MV13DF00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If useful reward points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 11:11:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407599#M196589</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-14T11:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407600#M196590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used this function, But I can't view the data from VB13 once I save data using this function. basically once I save the data using function, I should able to see the data again in vb13 which is material determination display.&lt;/P&gt;&lt;P&gt;I am using SAP standard material determination procedure A0001 and condition type A001. looking for help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 12:23:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407600#M196590</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-14T12:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407601#M196591</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;VB11/VB12  is using this Fm , I told you in my last post . &lt;/P&gt;&lt;P&gt;see Include :MV13DF00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION &amp;lt;b&amp;gt;'RV_MAT_SUB_SAVE' IN UPDATE TASK&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;USE_OUTBOUND_CALL = BOOLE_T&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;X_KONDDVB = XKONDD&lt;/P&gt;&lt;P&gt;Y_KONDDVB = YKONDD&lt;/P&gt;&lt;P&gt;X_KONDDPVB = XKONDDP&lt;/P&gt;&lt;P&gt;Y_KONDDPVB = YKONDDP&lt;/P&gt;&lt;P&gt;DB_TIME = TIME_VAKE_DB&lt;/P&gt;&lt;P&gt;DB_XVAKE = XVAKE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tip: if you go to se93 : give transaction ..double click on the prog name and search key word "Call fucntion" in program . you`ll get this FM "RV_MAT_SUB_SAVE".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Saquib&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2006 14:21:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407601#M196591</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-07-14T14:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407602#M196592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Saquib,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I knew this function is used by transaction VB11&amp;amp;Vb12. But just calling this function and passing data can't create condition record for material determination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam using SAP standard condition type A001&amp;amp;pocedure A0001. I am looking for a function to create material substitution in an interface mode. i.e looking function or sequence of functions for creating Material determination. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your ideas/help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Jul 2006 15:51:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407602#M196592</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-16T15:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407603#M196593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried using the Function module RV_MAT_SUB_SAVE' IN UPDATE TASK, but the records are not getting updated. Do we need to use any other function module before calling this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2006 12:00:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407603#M196593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-09T12:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407604#M196594</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 think you'll need to execute function module RV_KONDITION_SICHERN before calling RV_MAT_SUB_SAVE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p.s. you will also need to use the NUMBER_GET_NEXT function before calling RV_KONDITION_SICHERN.  Parameters are as follows:&lt;/P&gt;&lt;P&gt;NR_RANGE_NR = '01'&lt;/P&gt;&lt;P&gt;OBJECT = 'KOND'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2006 09:50:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407604#M196594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-13T09:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407605#M196595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Shilpa has already used the FM 'RV_MAT_SUB_SAVE' and is not able to save the records. Why cant we try to commit the DB work by using 'BAPI_TRANSACTION_COMMIT' and see if table has been updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2006 11:02:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407605#M196595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-13T11:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: is there any BAPI or Function Module for Material Substitution create</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407606#M196596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I'll make it easy for you guys.  Here's a function module I knocked together to do the job.  I know it works as I'm using it in one of my programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION z_create_mat_substitution.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     REFERENCE(IT_MAT_SUB) TYPE  ZMATERIAL_SUBSTITUTION_T&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     REFERENCE(ET_BAPIRET2) TYPE  BAPIRET2_T&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      FAILED&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;*"  This function uses the following standard function modules to&lt;/P&gt;&lt;P&gt;*"  create material substitutions:&lt;/P&gt;&lt;P&gt;*"      RV_KONDITION_SICHERN&lt;/P&gt;&lt;P&gt;*"      RV_MAT_SUB_SAVE&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: ls_mat_sub   LIKE zmaterial_substitution,&lt;/P&gt;&lt;P&gt;        ls_vakedb    LIKE vakedb,&lt;/P&gt;&lt;P&gt;        ls_xkonddvb  LIKE konddvb,&lt;/P&gt;&lt;P&gt;        ls_bapiret2  LIKE bapiret2,&lt;/P&gt;&lt;P&gt;        lt_vakedb    LIKE STANDARD TABLE OF vakedb,&lt;/P&gt;&lt;P&gt;        lt_xkonddvb  LIKE STANDARD TABLE OF konddvb,&lt;/P&gt;&lt;P&gt;        lt_ykonddvb  LIKE STANDARD TABLE OF konddvb,&lt;/P&gt;&lt;P&gt;        lt_xkonddpvb LIKE STANDARD TABLE OF konddpvb,&lt;/P&gt;&lt;P&gt;        lt_ykonddpvb LIKE STANDARD TABLE OF konddpvb,&lt;/P&gt;&lt;P&gt;        lv_knumh     TYPE knumh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT it_mat_sub INTO ls_mat_sub.&lt;/P&gt;&lt;P&gt;    CLEAR: ls_vakedb,&lt;/P&gt;&lt;P&gt;           ls_xkonddvb,&lt;/P&gt;&lt;P&gt;           lt_vakedb[],&lt;/P&gt;&lt;P&gt;           lt_xkonddvb[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate structure for RV_KONDITION_SICHERN.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    MOVE: 'D'               TO ls_vakedb-kvewe,&lt;/P&gt;&lt;P&gt;          '001'             TO ls_vakedb-kotabnr,&lt;/P&gt;&lt;P&gt;          'V'               TO ls_vakedb-kappl,&lt;/P&gt;&lt;P&gt;          'A001'            TO ls_vakedb-kschl,&lt;/P&gt;&lt;P&gt;          ls_mat_sub-matwa  TO ls_vakedb-vakey,&lt;/P&gt;&lt;P&gt;          ls_mat_sub-datbi  TO ls_vakedb-datbi,&lt;/P&gt;&lt;P&gt;          ls_mat_sub-datab  TO ls_vakedb-datab,&lt;/P&gt;&lt;P&gt;          'I'               TO ls_vakedb-xxdbaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate structure for RV_MAT_SUB_SAVE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    MOVE: sy-mandt          TO ls_xkonddvb-mandt,&lt;/P&gt;&lt;P&gt;          ls_mat_sub-smatn  TO ls_xkonddvb-smatn,&lt;/P&gt;&lt;P&gt;          ls_mat_sub-meins  TO ls_xkonddvb-meins,&lt;/P&gt;&lt;P&gt;          ls_mat_sub-sugrd  TO ls_xkonddvb-sugrd,&lt;/P&gt;&lt;P&gt;          'I'               TO ls_xkonddvb-updkz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Determine next available condition record number.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL FUNCTION 'NUMBER_GET_NEXT'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        nr_range_nr = '01'&lt;/P&gt;&lt;P&gt;        object      = 'KOND'&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        number      = lv_knumh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ls_vakedb-knumh = ls_xkonddvb-knumh = lv_knumh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Append to internal tables.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    APPEND: ls_vakedb  TO lt_vakedb,&lt;/P&gt;&lt;P&gt;            ls_xkonddvb TO lt_xkonddvb.&lt;/P&gt;&lt;P&gt;&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;Call RV_KONDITION_SICHERN.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'RV_KONDITION_SICHERN' IN UPDATE TASK&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      vakedb_tab = lt_vakedb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call RV_MAT_SUB_SAVE to complete creation of Material Substitution.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'RV_MAT_SUB_SAVE' IN UPDATE TASK&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      x_konddvb  = lt_xkonddvb&lt;/P&gt;&lt;P&gt;      y_konddvb  = lt_ykonddvb&lt;/P&gt;&lt;P&gt;      x_konddpvb = lt_xkonddpvb&lt;/P&gt;&lt;P&gt;      y_konddpvb = lt_ykonddpvb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Commit to DB and wait as we need to check if the updates have been&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;successful or not.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  COMMIT WORK AND WAIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check that substitutions have been created successfully.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT it_mat_sub INTO ls_mat_sub.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT SINGLE matwa INTO ls_mat_sub-matwa&lt;/P&gt;&lt;P&gt;           FROM kotd001&lt;/P&gt;&lt;P&gt;           WHERE kappl EQ 'V'&lt;/P&gt;&lt;P&gt;             AND kschl EQ 'A001'&lt;/P&gt;&lt;P&gt;             AND matwa EQ ls_mat_sub-matwa&lt;/P&gt;&lt;P&gt;             AND datbi GE sy-datum&lt;/P&gt;&lt;P&gt;             AND datab LE sy-datum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR: ls_bapiret2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Return success message.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      ls_bapiret2-type = 'S'.&lt;/P&gt;&lt;P&gt;      ls_bapiret2-id   = 'ZMD_TOOL'.&lt;/P&gt;&lt;P&gt;      ls_bapiret2-number = '010'.&lt;/P&gt;&lt;P&gt;      ls_bapiret2-message_v1 = ls_mat_sub-matwa.&lt;/P&gt;&lt;P&gt;      ls_bapiret2-message_v2 = ls_mat_sub-smatn.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Return error message.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      ls_bapiret2-type = 'E'.&lt;/P&gt;&lt;P&gt;      ls_bapiret2-id   = 'ZMD_TOOL'.&lt;/P&gt;&lt;P&gt;      ls_bapiret2-number = '011'.&lt;/P&gt;&lt;P&gt;      ls_bapiret2-message_v1 = ls_mat_sub-matwa.&lt;/P&gt;&lt;P&gt;      ls_bapiret2-message_v2 = ls_mat_sub-smatn.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SHIFT: ls_bapiret2-message_v1 LEFT DELETING LEADING '0',&lt;/P&gt;&lt;P&gt;           ls_bapiret2-message_v2 LEFT DELETING LEADING '0'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Obtain message text.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL FUNCTION 'BALW_BAPIRETURN_GET2'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        type   = ls_bapiret2-type&lt;/P&gt;&lt;P&gt;        cl     = ls_bapiret2-id&lt;/P&gt;&lt;P&gt;        number = ls_bapiret2-number&lt;/P&gt;&lt;P&gt;        par1   = ls_bapiret2-message_v1&lt;/P&gt;&lt;P&gt;        par2   = ls_bapiret2-message_v2&lt;/P&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;P&gt;        return = ls_bapiret2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND ls_bapiret2 TO et_bapiret2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only extra bit you need to do is create a structure called ZMATERIAL_SUBSTITUTION with the following fields:&lt;/P&gt;&lt;P&gt;MATWA&lt;/P&gt;&lt;P&gt;SMATN&lt;/P&gt;&lt;P&gt;MEINS&lt;/P&gt;&lt;P&gt;SUGRD&lt;/P&gt;&lt;P&gt;DATBI&lt;/P&gt;&lt;P&gt;DATAB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.... and then a Table Type based on this structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Chris.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Dec 2006 16:38:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-there-any-bapi-or-function-module-for-material-substitution-create/m-p/1407606#M196596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-13T16:38:47Z</dc:date>
    </item>
  </channel>
</rss>

