<?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: Function Module to create or change pricing conditions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-or-change-pricing-conditions/m-p/3378482#M811217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try using the FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_REQUIREMENTS_GETDETAIL&lt;/P&gt;&lt;P&gt;this will give u the old pricing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_REQUIREMENTS_CHANGE&lt;/P&gt;&lt;P&gt;this is to change&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Feb 2008 14:42:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-19T14:42:05Z</dc:date>
    <item>
      <title>Function Module to create or change pricing conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-or-change-pricing-conditions/m-p/3378481#M811216</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 need a function module that changes a specific pricing condition in background. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a condition table for pricing A501. the pricing condition is about VKORG/MATNR.&lt;/P&gt;&lt;P&gt;Also I know the application type ('V'), condition type (PSF1 or whatever I want), validity dates(starting &amp;amp; ending dates) and all other parameters that I need (hierarchy etc.). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm about to write a remote enabled FM that creates/changes the condition data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do u know any FM to handle this issue. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;burak&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 13:32:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-or-change-pricing-conditions/m-p/3378481#M811216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-19T13:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to create or change pricing conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-or-change-pricing-conditions/m-p/3378482#M811217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try using the FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_REQUIREMENTS_GETDETAIL&lt;/P&gt;&lt;P&gt;this will give u the old pricing &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_REQUIREMENTS_CHANGE&lt;/P&gt;&lt;P&gt;this is to change&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 14:42:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-or-change-pricing-conditions/m-p/3378482#M811217</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-19T14:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module to create or change pricing conditions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-or-change-pricing-conditions/m-p/3378483#M811218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi finally i found a FM that do the job same as VK11 &amp;amp; VK12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The function that creates or changes the price conditions is 'RV_CONDITION_COPY'. also you have to use 'RV_CONDITION_SAVE' and  'RV_CONDITION_RESET' . Here is an example : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION zlib_change_prices_single .&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;*"     VALUE(E_KAPPL) LIKE  A501-KAPPL DEFAULT 'V'&lt;/P&gt;&lt;P&gt;*"     VALUE(E_VKORG) LIKE  A501-VKORG DEFAULT '1000'&lt;/P&gt;&lt;P&gt;*"     VALUE(E_KSCHL) LIKE  A501-KSCHL&lt;/P&gt;&lt;P&gt;*"     VALUE(E_MATNR) LIKE  A501-MATNR&lt;/P&gt;&lt;P&gt;*"     VALUE(E_DATBI) LIKE  A501-DATBI&lt;/P&gt;&lt;P&gt;*"     VALUE(E_DATAB) LIKE  A501-DATAB&lt;/P&gt;&lt;P&gt;*"     VALUE(E_KOSRT) LIKE  KONH-KOSRT OPTIONAL&lt;/P&gt;&lt;P&gt;*"     VALUE(E_KBETR) LIKE  KONP-KBETR&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(I_RETURN) TYPE  BAPIRETURN&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lt_mat_price LIKE zlib_s_material_price OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA:lt_cond LIKE zsd_price_condition_in OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;       lt_cond_rt LIKE zsd_price_condition_rt OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : wa_komg TYPE komg.&lt;/P&gt;&lt;P&gt;  DATA : it_komv TYPE komv OCCURS 1 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;         it_komv_idoc TYPE komv_idoc OCCURS 1 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;         lt_knumh_map TYPE knumh_comp OCCURS 1 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : new_record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  PERFORM read_t001 USING c_bukrs_beymen&lt;/P&gt;&lt;P&gt;                     CHANGING gw_t001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lt_cond-matnr = e_matnr.&lt;/P&gt;&lt;P&gt;  lt_cond-vkorg = e_vkorg.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;lt_cond-kbstat = 'Z1'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  lt_cond-datab = e_datab.&lt;/P&gt;&lt;P&gt;  lt_cond-datbi = e_datbi.&lt;/P&gt;&lt;P&gt;  lt_cond-waerk = gw_t001-waers.&lt;/P&gt;&lt;P&gt;  lt_cond-kbetr = e_kbetr.&lt;/P&gt;&lt;P&gt;*-arastir&lt;/P&gt;&lt;P&gt;  lt_cond-cmpgn_id = e_kosrt.&lt;/P&gt;&lt;P&gt;*-&lt;/P&gt;&lt;P&gt;  APPEND lt_cond.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MOVE-CORRESPONDING : lt_cond TO wa_komg.&lt;/P&gt;&lt;P&gt;  it_komv-kappl = e_kappl.&lt;/P&gt;&lt;P&gt;  it_komv-kschl = e_kschl.&lt;/P&gt;&lt;P&gt;  it_komv-kbetr = e_kbetr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  it_komv-waers = gw_t001-waers.&lt;/P&gt;&lt;P&gt;  it_komv-krech = 'C'.&lt;/P&gt;&lt;P&gt;  it_komv-kpein = 1.&lt;/P&gt;&lt;P&gt;  it_komv-kmein = 'ST'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND it_komv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MOVE-CORRESPONDING : it_komv TO it_komv_idoc.&lt;/P&gt;&lt;P&gt;  APPEND it_komv_idoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'RV_CONDITION_COPY'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      application                 = e_kappl&lt;/P&gt;&lt;P&gt;      condition_table             = '501'&lt;/P&gt;&lt;P&gt;      condition_type              = e_kschl&lt;/P&gt;&lt;P&gt;      date_from                   = e_datab&lt;/P&gt;&lt;P&gt;      date_to                     = e_datbi&lt;/P&gt;&lt;P&gt;      enqueue                     = 'X'&lt;/P&gt;&lt;P&gt;      key_fields                  = wa_komg&lt;/P&gt;&lt;P&gt;      maintain_mode               = 'A'&lt;/P&gt;&lt;P&gt;      keep_old_records            = 'X'&lt;/P&gt;&lt;P&gt;      used_by_idoc                = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    I_KONA                      =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      overlap_confirmed           = 'X'&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      new_record                  = new_record&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      copy_records                = it_komv&lt;/P&gt;&lt;P&gt;      copy_recs_idoc              = it_komv_idoc&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      enqueue_on_record           = 1&lt;/P&gt;&lt;P&gt;      invalid_application         = 2&lt;/P&gt;&lt;P&gt;      invalid_condition_number    = 3&lt;/P&gt;&lt;P&gt;      invalid_condition_type      = 4&lt;/P&gt;&lt;P&gt;      no_authority_ekorg          = 5&lt;/P&gt;&lt;P&gt;      no_authority_kschl          = 6&lt;/P&gt;&lt;P&gt;      no_authority_vkorg          = 7&lt;/P&gt;&lt;P&gt;      no_selection                = 8&lt;/P&gt;&lt;P&gt;      table_not_valid             = 9&lt;/P&gt;&lt;P&gt;      no_material_for_settlement  = 10&lt;/P&gt;&lt;P&gt;      no_unit_for_period_cond     = 11&lt;/P&gt;&lt;P&gt;      no_unit_reference_magnitude = 12&lt;/P&gt;&lt;P&gt;      invalid_condition_table     = 13&lt;/P&gt;&lt;P&gt;      OTHERS                      = 14.&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CASE sy-subrc.&lt;/P&gt;&lt;P&gt;      WHEN '1'. "enqueue&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = text-003.&lt;/P&gt;&lt;P&gt;        CONCATENATE Condition Type:' e_kschl '-&amp;gt;' e_matnr&lt;/P&gt;&lt;P&gt;               INTO i_return-message_v3.&lt;/P&gt;&lt;P&gt;      WHEN '2'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = text-004.&lt;/P&gt;&lt;P&gt;        i_return-message_v3 = e_kappl.&lt;/P&gt;&lt;P&gt;        i_return-message_v4 = text-005.&lt;/P&gt;&lt;P&gt;      WHEN '3'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = text-006.&lt;/P&gt;&lt;P&gt;        i_return-message_v4 = text-005.&lt;/P&gt;&lt;P&gt;      WHEN '4'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = text-007.&lt;/P&gt;&lt;P&gt;        i_return-message_v3 = e_kschl.&lt;/P&gt;&lt;P&gt;        i_return-message_v4 = text-005.&lt;/P&gt;&lt;P&gt;      WHEN '5'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = 'NO_AUTHORITY_EKORG'.&lt;/P&gt;&lt;P&gt;      WHEN '6'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;      WHEN '7'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;      WHEN '8'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = text-008.&lt;/P&gt;&lt;P&gt;      WHEN '9'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = 'TABLE_NOT_VALID'.&lt;/P&gt;&lt;P&gt;      WHEN '10'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = 'no_material_for_settlement'.&lt;/P&gt;&lt;P&gt;      WHEN '11'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = 'no_unit_for_period_cond'.&lt;/P&gt;&lt;P&gt;      WHEN '12'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = 'no_unit_reference_magnitude'.&lt;/P&gt;&lt;P&gt;      WHEN '13'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = 'invalid_condition_table'.&lt;/P&gt;&lt;P&gt;      WHEN '14'.&lt;/P&gt;&lt;P&gt;        i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;        i_return-message = text-001.&lt;/P&gt;&lt;P&gt;        i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;        i_return-message_v2 = text-009.&lt;/P&gt;&lt;P&gt;      WHEN OTHERS.&lt;/P&gt;&lt;P&gt;    ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'RV_CONDITION_SAVE'&lt;/P&gt;&lt;P&gt;      TABLES&lt;/P&gt;&lt;P&gt;        knumh_map = lt_knumh_map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DESCRIBE TABLE lt_knumh_map.&lt;/P&gt;&lt;P&gt;    IF sy-tfill GT 0.&lt;/P&gt;&lt;P&gt;      LOOP AT lt_knumh_map.&lt;/P&gt;&lt;P&gt;        i_return-type = 'S'.&lt;/P&gt;&lt;P&gt;        i_return-message = lt_knumh_map-knumh_new.&lt;/P&gt;&lt;P&gt;        WRITE e_matnr TO i_return-message_v1.&lt;/P&gt;&lt;P&gt;        WRITE Price has been saved successfully' TO i_return-message_v2.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'RV_CONDITION_RESET'.&lt;/P&gt;&lt;P&gt;      COMMIT WORK.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      i_return-type = 'E'.&lt;/P&gt;&lt;P&gt;      i_return-message = text-001.&lt;/P&gt;&lt;P&gt;      i_return-message_v1 = text-002.&lt;/P&gt;&lt;P&gt;      i_return-message_v2 = text-010.&lt;/P&gt;&lt;P&gt;      i_return-message_v3 = text-011.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 14:19:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-to-create-or-change-pricing-conditions/m-p/3378483#M811218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T14:19:21Z</dc:date>
    </item>
  </channel>
</rss>

