Application Development and Automation 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: 
Read only

problem with changing settlement rule

Former Member
0 Likes
1,267

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

3 REPLIES 3
Read only

Former Member
0 Likes
710

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.

Read only

Former Member
0 Likes
710

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

Read only

Former Member
0 Likes
710

seems not to be possible