View Full Version: Benset2

LawsonTalk > Other > Benset2



Title: Benset2


John Polito - January 26, 2006 08:12 PM (GMT)
Can someone tell me how I can look at BENSET2.
I need to see how the start date is being uses.

I notices in lawson doc that the startdate has an * by it, can you tell me what that means?

Thanks,
John

trezaei - January 26, 2006 08:46 PM (GMT)
Hi John,

There are a couple of ways you can look at an index. And I hope I am answering your question correctly.

From LID you can do one of the following:

A ) Use dbdoc

dbdoc dev bn benefit | lashow

I am assuming the productline is dev in the above. Then you can scroll down using the PageDown button until you see the definition for BENSET2

B ) Use dbdef

dbdef dev

F6 , A (File), Type in "benefit", Tab, F6, A (Index), Ctrl+J will move through the indexes.

Obviously the first choice is simpler but the second gives you more navigation and is a lot more dangerous.

Good luck and I hope that answers your question.

John Polito - January 26, 2006 09:20 PM (GMT)
Thanks trezaei,

Can you tell me what the * means next to startdate.

John

trezaei - January 26, 2006 09:26 PM (GMT)
Hmm,
I don't have access to my server right now to check but I am guessing it means that its a sorted index.
Probably sorted by date. If you pull up the index in dbdef you should see an arrow next to one of the fields. If the arrow points down that means the index is sorted in descending order on that field, if it points up ascending.

What exactly are you trying to figure out? Not that I want to deprive you of the discovery ... :P

John Polito - January 26, 2006 10:03 PM (GMT)
Well we have a user exit in pr140 that lawson consulting wrote for us and it does a call out to the benifit table to get the 401k information.
It is using the pretax percentage for company match on the records.

The pretax 401k was calculated correct, but the company match picked up the record that has a start date of 02/01/2006 on it.

So I was wondering if it got the wrong record even though it should have passed the date of 1/27/2006 in the startdate for benset2.

I know the user exit really well, it just little things like this that drive me nut.
I don't know how the beeset2 works. If it creates a SQL statement to get the record from the table or what.

Any help is appreciated.

John

Ragu - January 27, 2006 01:35 AM (GMT)
The * does mean descending order of key.

Your code probably goes something like this:
MOVE <> to DB-COMPANY
MOVE <> TO DB-PLAN-TYPE
MOVE <> TO DB-PLAN-CODE
MOVE <> TO DB-EMPLOYEE
MOVE HIGH-VALUES TO DB-START-DATE
PERFORM 850-FIND-NLT-BENSET2

What the coder was probably trying to do is get the latest (most recent) benefit record. However, this would get a benefit record entered with a future date.

Simply change it to
MOVE WS-SYSTEM-DATE-YMD TO DB-DATE
so the lookup will only fetch the most recent benefit record that was started today or earlier.

Ragu - January 27, 2006 01:49 AM (GMT)
I am not sure that you can look at BENSET2. You can certainly figure out in what order the data is retrievied via BENSET2 using the rngdbump command with the -i <index> option

John Polito - January 27, 2006 01:15 PM (GMT)
Thanks Ragu,

We are already loading the check date into the date field. Lawson was using the system date but I had to change that to check date due to when we run our payroll. There are times that the pay date is a couple of day after the first of the month and we were having problems not get the correct benifit record.

John

trezaei - January 27, 2006 03:59 PM (GMT)
Hi John,

Like Ragu pointed out there is an API that uses an index. Can you check and see which API the code is using?

You can then check the Lawson API document to see exactly what the API does. The document is name something like "eapi-802u-01.pdf" and should be available from support.

Its the part of the code that goes like

PERFORM 8XX-FIND-XXXXX-BENSET2 or something like that

for example

PERFORM 840-FIND-BENSET2 finds a very specific record and returns only one
PERFORM 850-FIND-NLT-BENSET2 returns the first record that meets the Not Less Than criteria for the DB field filled. and so on.

You probably already know all that, sorry if I'm rambling. :yammer:

Ragu - January 27, 2006 06:19 PM (GMT)
In this particulat case of the benefit picking up 2/1/2006 instead of 1/27/2006, what was the pay-date you were moving to DB-START-DATE ?

John Polito - January 27, 2006 09:45 PM (GMT)
Thanks for all your help!
We were getting the correct benifit record, but the way we allow after tax the max company match is 4.5% for both before and after tax.

So after more code searching I found that we use a value that is updated on the HREMPUSF table, and Benefits ran their program early and update the field to soon.

Thanks again,

John




Hosted for free by InvisionFree