Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Function module Prob with kostl

hi,good day guys.

Iam using K_ORDER_SRULE_ADD for settelment rules. In this other function module for read the fields one whic is K_DEFAULT_RULE_READ.. This is k_order_srule_add f.m source code as below as.

.default rule table TKB2C is maintained as 'I_SRULES' therefore
*.....aditional work area is needed.
      i_srules = srules.
*.....fill COBL to find KONTY
      cobl-kokrs        = ld_kokrs.
      cobl-gsber        = srules-bus_area.
      cobl-bukrs        = srules-comp_code.
      cobl-saknr        = srules-gl_account.
      cobl-prctr        = srules-profit_ctr.
      cobl-kostl        = srules-costcenter.                     "here iam getting the cost center value
      cobl-aufnr        = srules-orderid.
      CALL FUNCTION 'CJPN_EXTERN_TO_INTERN_CONV'
        EXPORTING
          ext_num       = srules-wbs_element
        IMPORTING
          int_num       = cobl-ps_psp_pnr
        EXCEPTIONS
          error_message = 2
          OTHERS        = 1.
        EXIT.
      ENDIF.
      cobl-anln1        = srules-asset_no.
      cobl-anln2        = srules-sub_number.
      cobl-nplnr        = srules-network.
      cobl-vornr        = srules-activity.
      cobl-kdauf        = srules-sales_ord.
      cobl-kdpos        = srules-s_ord_item.
      cobl-kstrg        = srules-cost_obj.
      cobl-prznr        = srules-co_busproc.
*.....get ASSIGN information in IT_DFTAB
      CLEAR konty.
      CALL FUNCTION 'K_DEFAULT_RULE_READ'        "this FM reads the fields and assining to the lt_dftab
        EXPORTING
          dfreg         = 'BAP'
          obart         = 'OR'
          i_cobl        = cobl
        IMPORTING
          e_konty       = konty
        TABLES
          dftab         = it_dftab                                           "iam not getting the costcenter[kostl] field..
        EXCEPTIONS
          error_message = 2
          OTHERS        = 1.
      IF ( sy-subrc <> 0 ).
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
                RAISING error_occurred.
        flg_leave = 'X'.
        EXIT.
      ENDIF.

Based on lt_dftab fields. K_POSTING_RULE_INSERT f.m willbe insert the values.prob with costcenter.

Edited by: balaji kiran on Apr 14, 2010 7:55 AM

Edited by: balaji kiran on Apr 14, 2010 7:57 AM

Not what you were looking for? View more on this topic or Ask a question