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: 

trans.iw32 - changing settlement Receiver cost center

Former Member
0 Kudos

hi,

We implement Pm order when the settlement profile define the cost center as the default cost reciever.

The default value defined is the cost center assigned to the technical object (Functional location, equipment). We want that the default value will be derived from the Responsible cost center (defined for the Responsible work center).

We try to use exit IWO10027, but we found that this field is not accessible.

Do we have a way to do it ?

5 REPLIES 5

Former Member
0 Kudos

You can try the BADI - CO_SRULE_CHECK ( use transaction SE18 to view the definition ).

When you create or change settlement rule the control goes thru this BADI. Possible you can put a message here asking the user to change it to your desired Cost Center ( deriving from the Work Centers). or call a function module like K_SETTLEMENT_RULES_UPDATE for automatically updating it.

0 Kudos

i found this badi in trans.se18 and than i went to trans.se19 and gave a

Implementation name.

than in the definition name i gave CO_SRULE_CHECK.

in the interface->method i put break-point and i dont know why its not stop there.

do you know what did i did wrong?

thank you,

dana.

0 Kudos

do you have a sample code for this function?

thanks,

dana.

0 Kudos

Dana,

ya.. thats fine. Or u can use the BREAK-POINT statement in the code ( in the method of the implemented class - i.e. after double clicking on the method in SE19).

The method will be fired when the user tries to edit something in the Settlement rule screen - otherwise it wont be executed.

Do u want to default the settlement receivers automatically ??

sample code inside the method

[code]

IF NOT DISTRIBUTION_RULE-KOSTL IS INITIAL.

SELECT BUKRS UP TO 1 ROWS

FROM CSKS

INTO WA_KOSTL_BUKRS

WHERE KOKRS EQ DISTRIBUTION_RULE-KOKRS

AND KOSTL EQ DISTRIBUTION_RULE-KOSTL

AND DATBI GE SY-DATUM

AND DATAB LE SY-DATUM.

ENDSELECT.

IF SY-SUBRC NE 0.

CLEAR WA_KOSTL_BUKRS.

ENDIF.

IF WA_KOSTL_BUKRS NE WA_BUKRS.

MESSAGE E761(P2) WITH DISTRIBUTION_RULE-KOSTL

WA_KOSTL_BUKRS

WA_BUKRS

RAISING NOT_ALLOWED_WITH_MSG.

ENDIF.

ENDIF.

[\code]

0 Kudos

The user should get it automatically without edit something.

I think that in this case Badi wont work.

Am i correct?