Network activity - settlement rule change FM or BAPI

I wonder if there is any FM or BAPI to change settlement rule for network activity?

Hi everybody,
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 here.
My implementation is more simple because the requirement was different:
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 <> 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 <> 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 <> 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 <> 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 <> 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
Hope it helps,
Jaime

Similar Messages

  • SAP-PS Settlement Rule Change

    Is it possible to change settlement rule for PS project. I have a number of projects, with one settlement rule. How can I have the settlement rule changed for the subsequently created projects? How does this change affect the existing projects?
    Thanks.

    We currentlt use a settlement rule by which the projects (and the associated costs etc.) are settled for month-end closing.
    We need to change the settlement rule by which projects (and the associated costs etc.) can be settled any time as required.desired.
    Hope this explains.

  • Internal order "settlement rule" change

    Dear Gurus,
    I would like to change "settlement rule" in internal oder which has been used since go-live under ECC6.0.
    I go to KO02, keyin 'order number' ,enter and click on "settlement rule" button to update.
    but profitability segment line just display mode not changeable.
    How can i update settlement rule in KO02?
    kr,
    J.

    once you settle an order with a settlement rule you cannot change the rule no more.
    But you can create a new settlement  rule.
    First double click on the settlement rule you are currently using and for the "validity from field" give the last period. so this rule wont be in use anymore.
    than create a new rule.
    after these steps when you run the settlement, system will pick up the new rule you created.

  • WBS settlement rule - change receiver

    In the settlement rule for WBS element, catelgory G/L, how do I change the default Settlement Receiver?  User wants WBS elements settling to a different account.
    Thanks
    Althea

    thank you Sridhar,
    Calm outside advice triumphs over frantic end-users every time.
    Althea

  • Settlement Rule change

    Dear Gurus,
    This is related to an order which was created on 2007.
    Order has been created and settlement rule has been defined with both PER one is 95% and other is 5% both has got settled on 2007. Now there is some balance amount which needs to be settled.
    When we run the settlement rule it says there is nothing to be settled, but when we check in order there is very small amount to be settled. This is not happening because we need to change the settlement from Per to Ful but we cannot do it as this order type can have only max 2 settlement rule(both defined) and we cannot do any changes also as both of them used earlier.
    Kindly let me know what shall we do for this case?
    senthil

    Hi Senthil,
    The below links may be helpful ( Venkatesan Anandan  had posted them in one tread)
    http://sap-img.com/plant/settlement-rule-in-maintenance-order.htm
    http://sap-img.com/plant/impact-on-business-if-pm-order-not-settled.htm
    Regards
    Arif

  • Settlement Rule in Networks

    Hi Friends,
    I'm trying to create settlement rules for networks in CJ20N and facing issues. I have projects with WBS elements, networks, and activitieis (standard projects). System is allowing to maintain dettlement rules for WBS elements, but not for networks, i.e., when I go to Edit - Cost - Settlement rules, after selecting networks, the settlement rule page is coming up only in display mode. Any suggestions on what could be the root cause? FYI... I have all necessary authorizations roles in Project Systems.
    Regards,
    Aman

    Also check if your network is header assigned or activity assigned. if the same is header assigned in that case only you can assign settlement rule at network header if the same is activity assigned in that case you need to assign settlement rule at activity  level.
    With  Regards
    Nitin P.

  • Bapi for settlement rule in IW32

    I want a bapi which will create settlement rule for IW32 ?It should be able to update Valid From And Valied to fields in IW32.
    I have checked BAPI_ALM_ORDER_MAINTAIN it does not have Valid from and Valid to fields in structure BAPI_ALM_ORDER_SRULE.I need a bapi which can be used to update those fields.

    HI
    Check This Link
    Re: Create/change settlement rule for inv.order - BAPI, funct.module???

  • Settlement rule determination in case of FXA

    Hi Experts
    My project is meant for settlement to asset.
    W.r.t. Networks, the settlement rule can be automated using strategy as 'receiver is WBS'.
    But, can we automate settlement rule determination except the specification of receiver for WBS?
    Because, each WBS is to settled for individual sub asset
    warm regards
    ramSiva

    Hi Virendra
    In my case, the client is initially creates CWIP assets manually (Capital work in progress, nothing but the AUC, however it can be seen as fixed asset)
    The CWIP assets can be more in number per project (one for each WBS or activity)
    Until completion of project, the settlements are made to CWIP assets.
    At completion, the transfer of all CWIP's to fixed asset is carried out in asset accounting.
    So, the different assets are available initially, but need to be manually assigned.
    Any standard program interface to upload based on the project strucxture?
    warm regards
    ramSiva

  • Infoobject for settlement rule

    hi,
    Can anyone tell me the infoobejct for the settlement rule on WBS element.
    I am able to find only settlement area in OCOOM_CO2.
    thanks
    venku

    HI
    Check This Link
    Re: Create/change settlement rule for inv.order - BAPI, funct.module???

  • Automatic substitution for network activity

    Hi.
    I have managed a substitution for network activities. But I want this substitution automatic when saving network or all project (CJ20N). On IMG on network profile, I have not the "automatic substitution indicator" I have usually on "project profile".
    Have you an idea, please ?

    Your requirement is that you want the substitution automatic when saving network or all projects. 
    On IMG on network profile, you are not getting  the "automatic substitution indicator" that is standard.
    infact you network activity susstitution rule will flow to project via assignment of that network profile to project pfofile.
    Please follow below steps.
    1. you have to  tick mark  the filed 'automatic substitution indicator' in all the project profile for which you want substitution automatic when saving.
    2. in that above step no. project profiles you have to use the network profile in which you have defined your substition for the activities.
    Regards
    Nitin

  • Settlement rule for Network activity

    hi,
    in my project, settlement rule of network activity is automatic to the superior WBS..  however i noticed that the default settlement rule is FUL.. is it possible to make setting such that the default settlement rule would still be to the superior WBS but it is PER (periodic settlement insted of full)
    how to do this?
    thanks in advance.

    see OSS note 317871
    Summary
    Symptom
    When you create a network or a new network activity, the respective settlement rules can be generated automatically by default. In the standard system, default rule PS1 is currently supported for this. This default rule creates a settlement rule for the full settlement.
    A default rule for the generation of a settlement rule for periodic settlement does currently not exist.
    Additional key words
    CN21, settlement rule
    Cause and prerequisites
    At present, the function is not supported in the standard system.
    Solution
    The attached program creates a corresponding new default rule PS2 which generates a periodic rule. In Customizing, you can assign this default rule to the affected network types afterwards.
    It is planned to include this default rule in a future release in the standard system.
    Source code corrections
    Header Data
    Release Status: Released for Customer
    Released on: 18.06.2007  07:57:36
    Priority: Recommendations/additional info
    Category: Advance development
    Primary Component: PS-COS-PER Automatic and Periodic Allocations
    Secondary Components: PS-COS-PER-SE Settlement
    Affected Releases
    Software
    Component Release From
    Release To
    Release And
    subsequent
    SAP_APPL 40 40B 40B  
    SAP_APPL 45 45B 45B  
    SAP_APPL 46 46B 46B  
    SAP_APPL 46C 46C 46C  
    SAP_APPL 470 470 470 X
    SAP_APPL 500 500 500  
    SAP_APPL 600 600 600

  • Bapi for changing internal order settlement rules

    Hi
    I'm looking for BAPI to add/ modify settlement rules in internal order (like in tc KO02). BAPI_ALM_ORDER_MAINTAIN seems not working, and there's only BAPI_INTERNALORDER_CREATE and GETITEM in internal order group ( there's no MAINTAIN ).
    Is there another BAPI to do this? of FM?
    regards
    Wojciech.

    Thanks for help but this links points to discussions abut creating internal order. I want to change one. BAPI_INTERNALORDER_CREATE does not allow to change orders ( i've just tested it.)
    regards
    wojciech

  • Cannot Maintain settlement rule for the activity

    Dear All,
    I tried to maintain settlement rule in activity under WBS. But it shows message :
    You cannot maintain the settlement rule for the activity
    Message no. CN006
    Diagnosis
    The network has header account assignment. You can only maintain settlement rules for the network header.
    System Response
    Processing stopped.
    Procedure
    Maintain the settlement rule for the network header.
    Please help.
    Cheers,
    Nies

    Hi,
    I already tried the config OPUV (network type Parameters) but it shows the activity account assignment already ticket.
    If i go to network header and go to settlement rule the warning message shows :
    Network has activity account assignment
    Message no. CN057
    Diagnosis
    Costs can only be written to activities for the network whose key you have entered.
    System Response
    Processing stopped.
    Procedure
    1. Check whether you have entered the correct key for the network. Change it if necessary.
    2. Maintain the key for the network to which you want the costs to be written.
    In addition, if i tick the activity under the network header : it shows
    You cannot maintain the settlement rule for the activity
    Message no. CN006
    Diagnosis
    The network has header account assignment. You can only maintain settlement rules for the network header.
    System Response
    Processing stopped.
    Procedure
    Maintain the settlement rule for the network header.
    Cheers,
    Nies
    Edited by: Nies on Nov 6, 2009 3:26 AM

  • BAPI/FM to create WBS settlement rules.

    Hi,
    I would like to know if there is a FM or BAPI to create WBS settlement rules. I use CJ20N transaction to create manually. Any qucik response will be much appreciated and Obviously rewarded
    Thanks,
    Vivek.T

    U can use the user exit
    COPCP005 and its function exit EXIT_SAPLCKAZ_001. Try this out....
    Or choose any one options from the below list which suits ur requirement:
    Develop Enhancements for Material Costing
    The following SAP enhancements are available for the area Cost Estimate with Quantity Structure:
    o Costing Reports (SAPLXCKA)
    o Costing Production Resources and Tools (COPCP003)
    o Material Valuation with Cross-Company Costing (COPCP001)
    o Costing Bulk Materials (COPCP004)
    o Valuation Price for Materials from User Exit (COPCP005)
    1. Costing Reports: SAPLXCKA
    Here you can create your own reports for displaying cost estimates with quantity structure or activate the example reports in the standard system.
    This enhancement contains the following components:
    · EXIT_SAPLCKAZ_001 Display/print itemization
    This enhancement contains example program code from SAP that you can modify and use for your own enhancement, or activate directly as a report for the itemization.
    · EXIT_SAPLCKAZ_002 Display/print cost components
    This enhancement contains example program code from SAP that you can either modify and use for your own enhancement, or activate as a report for the cost components.
    · EXIT_SAPLCKAZ_003 Display/print cost components and itemization
    This enhancement does not contain example program code.
    In the cost estimate with quantity structure you access the reports with Costs -> Display user exit. The report refers to the first cost component view listed. If you want to see the costs with reference to another cost component view, choose Settings -> Cost display and choose the desired report under Select view.
    You can display your own reports in the information system by adding them to the report list for product costing.
    See also:
    Check report list for material cost estimate
    2. Costing production resources/tools: COPCP003
    This enhancement contains the component EXIT_SAPLCK01_001.
    The costs for production resources and tools are calculated as a flat rate within production overhead.
    This enhancement enables you to plan the costs for production resources in costing with quantity structure in different ways. Here you can specify how the production resources are to be costed.
    In the cost component structure, the production resources can be shown in separate cost components.
    This enhancement contains example program code from SAP that you can modify or use as is.
    3. Material valuation with cross-company costing: COPCP001
    This enhancement contains the component EXIT_SAPLCK21_001.
    Here you can enter the prices for valuation of a material that is transferred between company codes.
    You have the following options for the valuation of materials that are transferred between company codes:
    o You are using the standard system without cross-company costing. In this case the system uses a price in the material master record in accordance with the valuation strategy. The material is treated as if it were externally procured.
    o You activate cross-company costing. In this case the material is recosted in the other company code or transferred according to the transfer control ID.
    If you have not activated cross-company costing, you can use this enhancement to define alternative prices for valuation of a material that is transferred between company codes. That is, this enhancement allows you to specify which price should be used instead of the price from the material master record.
    In include LXCKAF)) you can find an example program code. However, this code example can not be directly copied and used
    4. Costing Bulk Materials: COPCP004
    This enhancement contains the component EXIT_SAPLKKEX_001.
    You can use this enhancement to plan the costs for bulk materials and show in the cost element itemization.
    If the indicator Bulk material is set in the material master, the indicator Relevant to costing in in the BOM does not accept input for the item. The enhancement allows you to determine the costing relevancy. The items with the bulk materials indicator at item level of BOM are also included as relevant to costing.
    This enhancement contains example program code from SAP that you can modify or use as is.
    5. Valuation Price with Valuation Strategy U: COPCP005
    This enhancement contains the component EXIT_SAPLCK21_002.
    You can use this enhancement to specify prices for valuation of materials if you want to use valuation strategy U (valuation with USER EXIT) for material valuation to find a price for the materials.
    This enhancement does not contain any example program code from SAP.
    Activities
    To activate the SAP example reports (the procedure is similar forthe other enhancements):
    1. Create a new project or use an existing one.
    2. Set the indicator SAP enhancements and choose Change.
    3. Enter SAPLXCKA as the SAP enhancement and choose Save.
    4. Set the indicator Enhancement components and choose Change.
    5. Position the cursor on the enhancement component EXIT_SAPLCKAZ_001 and choose Edit -> Use SAP source code.
    6. The system asks whether you want to create ZXCKAU01. Answer Yes.
    7. Maintain the attributes.
    8. Save the program and choose Back.
    9. Position the cursor on the enhancement component EXIT_SAPLCKAZ_002 and choose Edit -> Use SAP source code.
    10. The system asks whether you want to create ZXCKAU02. Answer Yes.
    11. Maintain the attributes.
    12. Save the program and choose Back.
    13. Activate the project.
    14. To display the reports, you must perform costing again.
    Further notes
    Unlike modifications, enhancements are always upgrade-compatible because they are implemented in a name range reserved for the customer rather than in the SAP original.
    The general procedures for creating enhancements can be found in the enhancement transaction CMOD under Goto -> Online Manual. This takes you to the SAP library where you can find detailed information on customer exits.For more information on the above enhancements, see the associated function module documentation.
    Reward if useful...
    Regards
    Karthik D

  • Change the Settlement Rule

    Hi Experts,
    In the settlement rule for the Process orders, the system creating the rules with the category 'OIT' (Order Item)  but i want it to be changed to 'MAT' (Material) how and where do i change the same. i know that it cant be changed in Settlement rule for the Order.
    thanks
    Regards
    Suresh

    Hi rasuresh,
    When I read down the the comments all the way down and back to your question, one question arise in my mind, why do you want to change the settlement rule to be MAT?
    You said the your order is a Process Order, meaning that in one process order it can generate more than one out put. Please check the material master of your product via MM03 on MRP2. Check, is the co-product indicator activated? If yes, then click on tab Joint Production icon. There, in the joint production indicator showing what items will be produced during processing of the products.
    By indicator Joint product, by default the receiver Item category will be set to OIT in the settlement rule. What you see in the distrubution rule receiver are the proportion of cost based on setting of joint production in the MRP view 2.
    I don't think, this is as a problem. It is as what should be as a process order.
    It would be different if your order is Production Order or order type PP01, then the receiver will be MAT
    Hope this help you.
    Best regards,
    Irhasni

Maybe you are looking for

  • ABAP Proxy or IDOC Adapter?

    Hi all, In my project, we are using 3 system(SAP R/3(ECC 6.0), Oracle and VAN). Data has to synchronize between these systems. 1. Oracle ->PI ->SAP R/3 Oracle system is sending Material master data to SAP R/3 ECC 6.0. At sender side I am using JDBC A

  • FME freezes when connecting Canon HV20 via firewire

    Hoping someone can help me out. I'm using a Canon HV20 camera as a live video stream via FME and every time I try FME will freeze and my laptop will freeze and I have to restart. My camera settings are DV standard and it should work. The necessary dr

  • COPA derivation rule :more than 6 target fields

    Hi , As per client's requirement I need to include 10 target fields in a COPA derivation rule . Now after entering 6 , I can see rest of the rows are greyed out ; it looks like SAP does not allow more than 6 as target . I tried to find out if such li

  • Upgrade 46C to ECC 6 0 - Preparation steps

    1. Before the Upgrade is started what are the PRE - Upgrade steps  related to security? for example should any tables be dwn loaded ? etc etc..I will be doing the upgrade in two weeks just wanted to prepare the the docs as well as the system before.

  • To List out BAPI in a system

    Hi All, Is there any way to list out all the activated BAPI's in a system thro' a funtion module or report? Rgds, J.Jayanthi