11-28-2007 12:52 PM
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
12-14-2007 8:24 PM
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.
11-28-2007 5:17 PM
11-28-2007 5:24 PM
What version are you on? This transaction isn't in our system.
Rob
11-28-2007 5:29 PM
Hi Rob,
Sorry it was my mistake, Transaction is IW31. Settlement rules for Work Order.
Thanks,
Satish
11-28-2007 5:52 PM
Satish,
You can create field exit to set the value of Cost centre.
Thanks,
Srinivas
11-28-2007 6:08 PM
Sorry Srinivas, it can not be done through field exit. Any how thanks for your reply.
-Satish
11-28-2007 7:18 PM
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
12-13-2007 10:10 PM
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.
12-14-2007 8:24 PM
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.