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: 

Making Dafault Cost Center to the Settlement receiver field

Former Member
0 Kudos

Hi Friends,

I have a requirement to default the cost center value to the settlement rules 'Sett;ement receiver' in IW01 transaction.

I searched in SDN and i found few answers but nothing was useful. Iif anybody has an idea on this or anybody has done this, please suggest me how to do it.

Thanks,

Satish

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I had a similar requirement but couldn't find a way.The alternative which I did was to validate the field in the user exit.

Try the below code in user exit ZXAUFU02.

  • Call function module to get the settlement rule from buffer

call function 'K_SETTLEMENT_RULE_GET'

EXPORTING

objnr = i_aufk-OBJNR

x_all = ' '

TABLES

e_cobra = lt_cobra

e_cobrb = lt_cobrb

EXCEPTIONS

not_found = 1

others = 2.

If sy-subrc eq 0.

  • create an instance of BADI

call method cl_exithandler=>get_instance

changing

instance = exit.

  • call the check method of the BADI

call method: exit->DISTRIBUTION_RULE_CHECK

EXPORTING

DISTRIBUTION_RULE = lt_cobrb

EXCEPTIONS

not_allowed = 1

not_allowed_with_msg = 2.

Endif.

And in the implementation do the validation.

Hope this Helps.

Thanks,

Sudha.

8 REPLIES 8

Former Member
0 Kudos

Guys... No inputs for me????

Former Member
0 Kudos

What version are you on? This transaction isn't in our system.

Rob

0 Kudos

Hi Rob,

Sorry it was my mistake, Transaction is IW31. Settlement rules for Work Order.

Thanks,

Satish

0 Kudos

Satish,

You can create field exit to set the value of Cost centre.

Thanks,

Srinivas

0 Kudos

Sorry Srinivas, it can not be done through field exit. Any how thanks for your reply.

-Satish

0 Kudos

Satish, If both these fields exist in the same screen then it is verymuch possible. Can you tell me in which tab these values are available?

Thanks,

Srinivas

Former Member
0 Kudos

See if it can be a SET GET parameter, that way you can either set that parameter in some user exit or set it in the user master for all users.

Former Member
0 Kudos

I had a similar requirement but couldn't find a way.The alternative which I did was to validate the field in the user exit.

Try the below code in user exit ZXAUFU02.

  • Call function module to get the settlement rule from buffer

call function 'K_SETTLEMENT_RULE_GET'

EXPORTING

objnr = i_aufk-OBJNR

x_all = ' '

TABLES

e_cobra = lt_cobra

e_cobrb = lt_cobrb

EXCEPTIONS

not_found = 1

others = 2.

If sy-subrc eq 0.

  • create an instance of BADI

call method cl_exithandler=>get_instance

changing

instance = exit.

  • call the check method of the BADI

call method: exit->DISTRIBUTION_RULE_CHECK

EXPORTING

DISTRIBUTION_RULE = lt_cobrb

EXCEPTIONS

not_allowed = 1

not_allowed_with_msg = 2.

Endif.

And in the implementation do the validation.

Hope this Helps.

Thanks,

Sudha.