HR02 User Exit

 9 Replies
 0 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
SamKinnamon
New Member Send Private Message
Posts: 2
New Member

Hi everyone--

Hopefully this is something very easy that I am just missing, since I am new to using Lawson and User Exits.  My problem is that I have a User Exit for HR02.  The user exit kicks off a process flow each time a department is changed, added or deleted.  The user exit works perfectly when it is executed in the LID.  But, it does not appear to triggered at all when a change is made in Portal.

I have tried an ISO Cache Refresh.  In addition, I've done the tmcontrol -rp hr hr02 and tmcontrol -rp hr hr02b.  I've also restarted the Lawson services on our server to no avail.  Is there something that I'm missing?

We are on a Windows server.

Thanks for any help!

SamKinnamon
New Member Send Private Message
Posts: 2
New Member

I've figured this out.  It seems that I am my own victim.  I had compiled the user exit against the wrong product line.

Chesca
Veteran Member Send Private Message
Posts: 490
Veteran Member
Could you please show me step by step how to create a simple user exit for an LP program? Would it matter if the source files were empty to start with and then I can add user exits as needed? I just want to see how it works first. Thanks
Ragu Raghavan
Veteran Member Send Private Message
Posts: 477
Veteran Member
Do you have access to the support site ? Look for a document "Doc for Developers: Application
Development Workbench Standards". This has a section on user exits that may help.
Chesca
Veteran Member Send Private Message
Posts: 490
Veteran Member
Yes, I do. However, I am having issues editing the LPCUSTOMPD to create my first user exit called LP140VAC1-TRANSACTION and add my logic.
Ragu Raghavan
Veteran Member Send Private Message
Posts: 477
Veteran Member
That is a different animal all together.
Here is an example :

000220 3000-USER-EXIT-CALC-AMT SECTION.
000230****************************************************************
000240 3000-START.
000250
000260 INITIALIZE LPC-CALC-AMOUNT.
000270
IF (LPMST-CALCULATION = "VFTPAY7.21" OR
"VFTPAY4.04" OR
"VFTPAY4.33" OR
"VFTPAY5.38" OR
"VFTPAY5.58" OR
"VFTPAY5.77" OR
"VFTPAY6.73" OR
"VFTPAY6.97" OR
"VFTPAY8.08" OR
"VFTPAY8.37" OR
"VFTPAY8.65" OR
"VFTPAY5.77" OR
"VFTPAY7.21" OR
"VFTPAY8.08" OR
"VFTPAY8.65" OR
"VFTPAY9.42" OR
"VFTPAY1010")

* DISPLAY "CUSTOM CALC " LPMST-CALCULATION
MOVE LPMST-TEM-EMPLOYEE TO DB-EMPLOYEE
PERFORM 840-FIND-EMPSET1
COMPUTE LPC-CALC-AMOUNT ROUNDED =
EMP-PAY-RATE * TCA-USER-NUM-1
DISPLAY "CUSTOM CALC " LPMST-CALCULATION
" FOR " LPMST-TEM-EMPLOYEE " " LPC-CALC-AMOUNT
END-IF.
Chesca
Veteran Member Send Private Message
Posts: 490
Veteran Member
Ragu, your post was very helpful. I just have a question, is the coded added within 3000-USER-EXIT-CALC-AMT or I would have to create a new one? But I don't see how it would be called by the base program LP140? Hey have your company moved from TA to Absence management yet?

LPCUSTOMPD code:

3000-USER-EXIT-CALC-AMT SECTION.
000230****************************************************************
000240 3000-START.
000250
000260 INITIALIZE LPC-CALC-AMOUNT.
IF (EMP-PROCESS-LEVEL = "XXX")
PERFORM 3010-LPVACHRI-TRANSACTION
THRU 3010-LPVACHRI-TRANSACTION-END
END-IF.
******************************************************************
3010-LPVACHRI-TRANSACTION.
******************************************************************
***LP VACATION SUBROUTINE FOR XX 
000270 IF (EMP-PROCESS-LEVEL = "XXX")
IF (PEM-BARGAIN-UNIT = "00" OR "06" OR "07")
IF (LPC-ACR-HOURS >= (EMP-STAND-HOURS * 7))
OR (LPC-ACR-HOURS > EMP-STAND-HOURS)
000280 OR (LPC-ACR-HOURS = EMP-STAND-HOURS)
Ragu Raghavan
Veteran Member Send Private Message
Posts: 477
Veteran Member
Some section in LP140 or one of the libs that LP140 uses, calls 3000-USER-EXIT...
When control returns to the calling routune, it checks the value in the variable LPC-CALC-AMOUNT
Chesca
Veteran Member Send Private Message
Posts: 490
Veteran Member
ragu, it's starting to make more sense now except that I don't know if the LPMST- fields will be populated and passed to be use in my LPCUSTOMPD routine. I don't have any data to test and see. 

3000-USER-EXIT-CALC-AMT
I   INITIALIZE LPC-CALC-AMOUNT.
    PERFORM 3100-LPVACATION-CALC.



3100-LPVACATION-CALC           SECTION 50.
*** LOOKUP TAEMPSERV RECORD FOR INPUT EMPLOYEELOYEE
           INITIALIZE                                          DB-TES-OBJ-ID.
           MOVE LPMST-TEM-COMPANY  TO DB-COMPANY.
           MOVE LPMST-TEM-EMPLOYEE TO DB-EMPLOYEE.
           PERFORM 840-FIND-TESSET1.
           IF (TAEMPSERV-NOTFOUND)
               GO TO 3100-END.
Chesca
Veteran Member Send Private Message
Posts: 490
Veteran Member
Hi Ragu, I wanted to give you a update about this exit routine. LPCUSTOMPD turned out to be a library routine and not a user exit. It's called by LP140, LP14 and LP198. So I added cutom code in this library to calculate accruals when called by LP140. So it's working as expected. Thank you for all you input.