Need some help with a C business Function...

pbare

Well Known Member
I need to modify an existing JDE C Business function
B4300140 in the CDIST.dll. The function that I need to change is the DetermineAppoverAtNextLimit.

The scenario that I need to fix is related to Approval Routes and delegations

My business users came across the following:
Have a route set up like:
From Amount Person (iD)
1 913255 Pam
100,001 955452 Janet
500,001 988785 Shaun
1,000,001 988722 Mel

Create a Purchase Order for 750,000 and select this particular route

Everything works correctly until a Delegate is specified. For this route, we want to delegate the third approvers (Shaun) limit to the second approver (Janet). So now our route looks like this:
From Amount Person (iD)
1 913255 Pam
100,001 955452 Janet
500,001 955452 Janet
1,000,001 988722 Mel
Now 955452 (Janet) should have a limit of 1,000,000. Everything seems to work as expected until Janet goes into P43081 and selects the order to approve.

Right now, the system seems to think that Mel still needs to approve the order even though it is below her threshold. It should have been approved by Janet.

I have been stepping through the code and have found in the DetermineApproverAtNextLimit function has a Math Copy line
(MathCopy (&mnCurrentApproverLimit, &dsFetchFromF43008.apalim);)

This line is only retrieving Janet's original amount of 100,001 instead of 500,001.

My question is how to I write code to tell the system to check for more than one record in the F43008 table for that Approver.

Any thoughts/help would be appreciated. I do know that the ideal solution would not involve changing the base JDE code but I haven't found a different solution yet.

Thanks in advance for any help
Pam
 
Sorry Pam, this isn't going to help you - but I am curious.

I didn't think you could use Delegate to increase someone's limit!

If you can use Delegate in this way, I would think that this is most likely a known issue with the Call Center, and would think they would be best to identify the appropriate work around or whatever.

If that is not the case either, give Sebastien a shout....he reads c code like it was poetry.

Ben again,
 
I don't think you are supposed to be able to but apparently my users had made that request some time ago and the code that would stop the duplicate record is commented out.

Now I am trying to find a fix for this scenario that they just found.

Thanks for checking it out though
 
well It will be easier to change the delegation application. The system is working as designed. You cannot have the same approver in different levels and at the same time you cannot have different approvers at the same level. In your case you have the same approver at different levels. The system is picking up the first value. In the delegation application, delete the first record and store this in a temporary table, so that you have this information when you want to revert back. I feel that this is a better option.
 
Thank you for the suggestion. I have proposed it to my business users but so far, they would rather the system just allowed for the approver to be at 2 different levels.

I believe I have found the line that is causing me grief but I don't know enough about C code to modify the code to read the F43008 table until all records with a particular id have been read.

In the JDE code, it is a simple Select...Fetch Next loop
 
I have checked the code on the Delegation application and have found the code that would have checked for the duplicate name was commented out back in 97 (my company only started using the system in 2004 - so that change has been in there for a while)

I think I have found 2 functions that are causing me issues at the moment (both are in B4300140). One is the AccessOrderApprovalRow - it doesn't seem to be picking up the 2N record if I have the same id on one record with a 2A as well as a 2N. The other is the DetermineApproveratNextLimit - it definitely is not seeing that there is a higher value

I have tried changing the index that the function uses but that didn't help me either.

If anyone can think of any other way to get this process to work correctly with delegations, I would appreciate.

Tomorrow, I am going to investigate the idea of deleting the record at the lower limit and then adding it back in when the delegation is turned off.

Pam
 
Pam,

Have a look at the SQL statement in the debug log. You should be able to work out why it is not getting the second row from that. Then, at least you will know what changes need to be made, if not how to actually make them.
 
Back
Top