cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic Settlement Rule creation for WBS in Maintenance order

0 Kudos

Hi Experts ,

We are adding WBS in other Equipment and for the other equipment add Cost center ...in the settlement profile add the cost center Default object type ...my client need automatic settlement rule for WBS if equipment assigned to WBS..Is there a way to do that by standard or by enhancement

Help is highly appreciated.

Best regards

Sasko

Accepted Solutions (1)

Accepted Solutions (1)

former_member400468
Active Participant
0 Kudos

Hi!

Try to use construction like this:

DATA: srules    TYPE srules_ext OCCURS 0.
DATA: srules_wa TYPE srules_ext.


  CALL FUNCTION 'K_SRULE_CREATE'
    EXPORTING
      i_objnr                   = caufvd_imp-objnr
   EXCEPTIONS
     rule_already_exists       = 1
     OTHERS                    = 2.


    srules_wa-settl_type = 'FUL'.
    srules_wa-percentage = 100.
    srules_wa-amount     = 0.
    srules_wa-costcenter  = caufvd_imp-kostl.
    APPEND srules_wa TO srules.


  CALL FUNCTION 'K_ORDER_SRULE_ADD'
    EXPORTING
      object_no                  = caufvd_imp-objnr
   TABLES
     srules                     = srules
   EXCEPTIONS
     wrong_input                = 1
     error_occurred             = 2
     object_not_found           = 3
     activity_not_allowed       = 4
     OTHERS                     = 5.

Evgeny

Answers (2)

Answers (2)

0 Kudos

Dear Evgeny Gubenko & Peter Atkin

thanks for sharing your knowledge .... 🙂

sasko

peter_atkin
Active Contributor
0 Kudos

Sasko,

You can manipulate the settlement rules via user-exit IWO10027 (see SMOD).

Talk to your ABAP Team who should be able to help.

PeteA