<?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: FM for settlement rules WBS elements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-for-settlement-rules-wbs-elements/m-p/3611270#M869974</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 don't know what your SAP version is, mine is ECC6 and I found this FM: AUC_SETTLEMENT_POST.&lt;/P&gt;&lt;P&gt;Maybe it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Chang Chung Chi on Mar 24, 2008 7:55 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Mar 2008 17:34:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-20T17:34:20Z</dc:date>
    <item>
      <title>FM for settlement rules WBS elements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-for-settlement-rules-wbs-elements/m-p/3611269#M869973</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;I'm looking for a function module or a method to insert settlement rules for WBS-elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx.&lt;/P&gt;&lt;P&gt;Bert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2008 08:14:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-for-settlement-rules-wbs-elements/m-p/3611269#M869973</guid>
      <dc:creator>b_deterd2</dc:creator>
      <dc:date>2008-03-20T08:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: FM for settlement rules WBS elements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-for-settlement-rules-wbs-elements/m-p/3611270#M869974</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 don't know what your SAP version is, mine is ECC6 and I found this FM: AUC_SETTLEMENT_POST.&lt;/P&gt;&lt;P&gt;Maybe it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Chang Chung Chi on Mar 24, 2008 7:55 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2008 17:34:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-for-settlement-rules-wbs-elements/m-p/3611270#M869974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-20T17:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: FM for settlement rules WBS elements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-for-settlement-rules-wbs-elements/m-p/3611271#M869975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did anyone found solution for this?  I am not able to find any bapi or FM that I can use to create Settlement Rules for WBS Elements CJ02.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Apr 2008 14:29:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-for-settlement-rules-wbs-elements/m-p/3611271#M869975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-03T14:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: FM for settlement rules WBS elements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fm-for-settlement-rules-wbs-elements/m-p/3611272#M869976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I found in a Rusian foruma way to create a settlement rule using the functions of the FM KOBS.  I changed a bit the code because my requirement was just to update the field URZUO of the settlement rule. The original post (in Russian) can be found &lt;A href="http://sapboard.ru/forums/viewtopic.php?p=247755&amp;amp;sid=5c0726376747b5bdf1acf3bf7bf9f69c"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;My implementation is more simple because the requirement was different:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
types: begin of ty_objnr,
  objnr    like prps-objnr,
end of ty_objnr.

*.COBRA-Buffer (see FM KOBS)
types: begin of ty_cobra_buf.
        include structure cobra.
types:   uflag like dkobr-upd_flag,
       end of ty_cobra_buf.
types: ty_t_cobra_buf type ty_cobra_buf occurs 10.

*.COBRB-Puffer mit Änderungsflag (see FM KOBS)
types: begin of ty_cobrb_buf.
        include structure cobrb.
types:   uflag like dkobr-upd_flag,
       end of ty_cobrb_buf.
types: ty_t_cobrb_buf type ty_cobrb_buf occurs 10.
***********************************************************************
* Internal tables                                                    *
***********************************************************************
data: it_abrechnug      type standard table of ty_abrechnung,
      it_objnr          type standard table of ty_objnr,
      it_cobra          like table of cobra with header line,
      it_cobrb          like table of cobrb with header line.
***********************************************************************
* Data                                                                *
***********************************************************************
data: wa_cobra_buf      type ty_t_cobra_buf,
      wa_cobrb_buf        type ty_t_cobrb_buf,
      wa_objnr            like line of it_objnr,
      wa_urzuo            like cobrb-urzuo,
      l_mem_cobrb         like wa_cobrb_buf[],
      l_mem_cobra         like wa_cobra_buf[],
      l_mem_cobrb_zeile   like line of l_mem_cobrb,
      l_mem_cobra_zeile   like line of l_mem_cobra.
	  
form urzuo_aendern  using    p_objnr p_pspnr p_urzuo.
  data: c_objnr like prps-objnr,
        c_pspnr like prps-pspnr,
        c_urzuo like cobrb-urzuo.

  c_objnr = p_objnr.
  c_pspnr = p_pspnr.
  c_urzuo = p_urzuo.

  refresh: it_objnr,
           it_cobra,
           it_cobrb,
           l_mem_cobra,
           l_mem_cobrb.

  wa_objnr = c_objnr.
  append wa_objnr to it_objnr.

* Reas settlement rule from the DM
  call function 'K_SRULE_PRE_READ'
  exporting
    i_pflege               = ' '
  tables
    t_sender_objnr         = it_objnr
*         T_COBRA                =
  exceptions
    wrong_parameters       = 1
    others                 = 2.
  if sy-subrc &amp;lt;&amp;gt; 0.
    perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
  endif.
* Fill internal buffer with settlement rules
  call function 'K_SETTLEMENT_RULE_GET'
    exporting
      objnr     = c_objnr
      x_all     = ' '
    tables
      e_cobra   = it_cobra
      e_cobrb   = it_cobrb
    exceptions
      not_found = 1
      others    = 2.
  if sy-subrc &amp;lt;&amp;gt; 0.
    perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
  endif.
* Save settlement rule in ABAP-Memory
  call function 'K_SRULE_EXPORT_IMPORT'
    exporting
      i_mode     = 'EX'
    exceptions
      wrong_mode = 1
      others     = 2.
  if sy-subrc &amp;lt;&amp;gt; 0.
    perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
  endif.
* Read ABAP-Memory
  import l_mem_cobra l_mem_cobrb from memory id 'K_SRULE'.
* Change field URZUO and set Update-Flag
  loop at l_mem_cobrb into l_mem_cobrb_zeile where urzuo is initial.
    l_mem_cobrb_zeile-urzuo = p_urzuo.
    l_mem_cobrb_zeile-uflag = 'U'. "Update Kennzeichen
    modify l_mem_cobrb from l_mem_cobrb_zeile transporting urzuo uflag.
  endloop.
* Clear internal buffer
  call function 'K_SETTLEMENT_RULE_REFRESH'
    exporting
      objnr = c_objnr.
* Fill ABAP-Memory with new rules
  export l_mem_cobra l_mem_cobrb to memory id 'K_SRULE'.
* Fill internal buffer with new rules
  call function 'K_SRULE_EXPORT_IMPORT'
    exporting
      i_mode     = 'IM'
    exceptions
      wrong_mode = 1
      others     = 2.
  if sy-subrc &amp;lt;&amp;gt; 0.
    perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
  endif.
* SAve new rules
  call function 'K_SETTLEMENT_RULE_SAVE'
    exporting
      dialog            = 'X'
      objnr             = c_objnr
      i_status_update   = ' '
    exceptions
      no_rule_for_objnr = 1
      others            = 2.
  if sy-subrc &amp;lt;&amp;gt; 0.
    perform error using c_pspnr sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    exit.
  endif.

  commit work.

  perform erfolg using c_pspnr.
endform.                    " URZUO_AENDERN
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope it helps,&lt;/P&gt;&lt;P&gt;Jaime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 14:06:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fm-for-settlement-rules-wbs-elements/m-p/3611272#M869976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T14:06:22Z</dc:date>
    </item>
  </channel>
</rss>

