‎2007 Sep 10 9:22 AM
In a serviceorder when a user changes the wbs element in the additional data tab he or she also needs to change the settlement rule accordingly
further on their needs to be a check if the new wbs element is not TAFS and if the element is a wbs element (since also projects can be filled in here)
I have managed to programm the check in user exit EXIT_SAPLCOIH_009
there I can find out the new value entered by the user and check if it's correct
I only can't get the new filled in values before save from the settlement rule
when I use
ASSIGN ('(SAPLKOBS)dkobr') TO <dkobr>.
CHECK <dkobr> IS ASSIGNED.
the new values for the wbs element are not filled in dkobr when the user exit is running
is there any other way to find the new values for the settlement rule in memory in the user exit mentioned above ?
or is there a bapi or function to adapt the settlement rule automaticaly ?
I have looked at K_ORDER_SETTLEMENT_RULE but I don't see where you can enter the WBS element in this function ?
kind regards
arthur
Message was edited by:
A. de Smidt
‎2007 Sep 10 10:32 AM
You can achieve this by using the BADI - CO_SRULE_CHECK. ( Use Transaction SE18).
You implement this BADI - in the method DISTRIBUTION_RULE_CHECK you will be getting the Settlement lines. ( returned by COBRB - this table stores the settlement rules by object numbers - Object number of the Order is stored in AUFK).
From the above mentioned method - DISTRIBUTION_RULE_CHECK , you call a FM - READ_NOTIFICATION_BUFFER. This will return all the buffered data for Notification/Order. You can check the ncessary conditions and raise exception message.
You can use these follwing FMs from your customer exit - EXIT_SAPLCOIH_010 for changing the Settlement rules ( if you want to go that way) -
K_SETTLEMENT_RULES_UPDATE
K_SETTLEMENT_RULE_COPY
or search with K_SETTLEMENT_RULE* to get the list of usefull FMs.
Hope it helps.
‎2007 Dec 03 8:25 AM
Hi A. de Smidt
I am facing similar problem like yours. Did you manage to get a solution for this?
Any inputs are much appretiated.
Thanks
Meg
‎2009 Feb 24 2:47 PM