Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Function module Prob with kostl

former_member251546
Participant
0 Kudos

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

3 REPLIES 3

former_member251546
Participant
0 Kudos

Ive solved the problem . jsut ive maintained the TK2bc table..

0 Kudos

thankyou.. i did it

0 Kudos

Hi,

Could you explain how you did it?

-Thanks