Problem with Settelment Rule for iw32

Hi,
Good day guys
Iam getting the problem while creating the settelment rule creation. Ive got a problem with " wa_srules-SOURCE     = '1' ".
If i wont fill this field, settelment rule is going to be created. but i need to fill this field as per requirement. 
Ive got a error message "Enter an Existing source assingment for souce stracutre CS.
Plz any one guide me, how to overcome this prob
DATA: srules TYPE srules_ext OCCURS 0,
      wa_srules TYPE srules_ext,
      lv_mandt type SYMANDT.
DATA IT_OBJNR TYPE STANDARD TABLE OF IONRB WITH HEADER LINE.
DATA: ls_copadata type BAPI_COPA_DATA occurs 0.
DATA: ls_cobrb type standard table of cobrb with header line.
IT_OBJNR-OBJNR = CAUFVD_IMP-OBJNR.
APPEND IT_OBJNR.
break-point.
CALL FUNCTION 'K_SRULE_PRE_READ'
EXPORTING
   I_PFLEGE               = ' '
TABLES
   T_SENDER_OBJNR          = IT_OBJNR
*   T_COBRA                =
EXCEPTIONS
   WRONG_PARAMETERS       = 1
   OTHERS                 = 2
CALL FUNCTION 'K_SETTLEMENT_RULE_EXISTENCE'
  EXPORTING
    objnr                = caufvd_imp-objnr
*   FLG_LOCAL            = ' '
* IMPORTING
*   E_COBRA              =
EXCEPTIONS
   RULE_NOT_FOUND       = 1
   OTHERS               = 2
CALL FUNCTION 'K_SRULE_CREATE'
EXPORTING
   i_objnr                   = caufvd_imp-objnr
*     I_CHECK_ONLY_LOCAL        = ' '
*   IMPORTING
*     E_COBRA                   =
EXCEPTIONS
  rule_already_exists       = 1
  OTHERS                    = 2.
wa_srules-SOURCE     = '1'.
wa_srules-settl_type = 'FUL'.
wa_srules-percentage = '100'.
*wa_srules-amount     = ''.
wa_srules-COMP_CODE  = caufvd_imp-bukrs.
*wa_srules-PROFIT_CTR = caufvd_imp-PRCTR.
*wa_srules-costcenter = caufvd_imp-kostl.
wa_srules-costcenter = '10-60'.
APPEND wa_srules TO srules.
wa_srules-SOURCE     = '1'.
wa_srules-settl_type = 'PER'.
wa_srules-percentage = '100'.
*wa_srules-amount     = ''.
wa_srules-COMP_CODE  = caufvd_imp-bukrs.
*wa_srules-PROFIT_CTR = caufvd_imp-PRCTR.
*wa_srules-costcenter = caufvd_imp-kostl.
wa_srules-costcenter = '10-60'.
APPEND wa_srules TO srules.
CALL FUNCTION 'K_ORDER_SRULE_ADD'
  EXPORTING
    object_no                  = caufvd_imp-objnr
* IMPORTING
*   FLG_RULE_INSERTED          =
  tables
    srules                     = srules
IF sy-subrc = 0.
  commit work.
Endif
Regards
Edited by: balaji kiran on Mar 26, 2010 10:18 AM

Hello Vitaliy,
Nice to "see" you here
I did try remodelling and it works fine here. A constant value rule really gets a constant value.
The user exit option also works fine here. Here's an example of a very simple user exit for a KF:
method IF_RSCNV_EXIT~EXIT.
  FIELD-SYMBOLS: <l_s_old> TYPE ANY,
                 <l_fillfield> TYPE ANY,
                 <l_newfield> TYPE ANY,
                 <fs_kfsource> type any.
* Assign the references to field symbols
  ASSIGN c_r_newfield->* TO <l_newfield>.
  ASSIGN i_r_old->* TO <l_s_old>.
* We will use the value of the 0AMOUNT KF. The value of the new KF is 0AMOUNT + 5.
  ASSIGN COMPONENT 'AMOUNT' OF STRUCTURE <l_s_old> TO <fs_kfsource>.
  <l_newfield> = <fs_kfsource> + 5.
endmethod.
For a KF, you can check the fields of the FACT Table (/BIx/Fzzzz) to know the field names for your source KFs.
Hope this helps.

Similar Messages

Maybe you are looking for

  • Choose for Selection option in ALV report

    Hi SAP experts, There is a requirement of using the functionality of Settings->Field for selection functionality in our ALV report. Please suggest some way to implement it. I am attaching the screenshot. This functionality i need to use in alv report

  • Ipod won't sync with windows 8

    The Ipod connects and shows up in iTunes (yes latest version) but I can't sync - it's grayed out. For some reason all the songs on the Ipod are not also present on the computer. The original computer the iPod was set up on was a Vista machine. It die

  • Trigger Process Chain from Source System into Target System

    Hello...actually in source system BZD, we have a process chain, in the target system BWD, we have another process chain as well. We want to have a process of combining these two process chain together. When the process chain in source system is compl

  • AS3.0 compiler

    Hello,I am a student from China.I want to know which AS3.0 complier used in flash cs5? waitting  for your help! Thanks very much!

  • Insufficient access privileges for operation Logic Pro

    What means "Insufficient access privileges for operation" when I try to open a *.logic file in a new track?