2013 Oct 20 6:39 PM
Dear Experts,
I want to use userexit EXIT_SAPFP50M_002 to assign default value to payroll identifier field.
All i want is when i press next screen the payroll identifier field is automatically filled according to the following query:
SELECT MAX(PAYID) from PA0267 into max_pay where BEGDA = Payment Date.
and assign max_pay + 1 to payroll identifier.
Here are the steps.
1- Run transaction PA70:
2- check Additional off-cycle Payments and Preselect using report, the with proposal
3- choose multiple personnel numbers
4- check with proposal
5- Here i change the payment date and add the wage type then press next screen,
all what i need is to automatically fill payroll identifier according to this query:
SELECT MAX(PAYID) from PA0267 into max_pay where BEGDA = Payment Date.
and assign max_pay + 1 to payroll identifier.
So for all these employee the payroll identifier will be assigned.
2013 Oct 21 6:13 AM
Hi Ahmed,
As discussed earlier to your previous thread
http://scn.sap.com/message/14423654#14423654
Write the same logic inside the USER EXIT.
EXIT_SAPFP50M_001
DATA : lx_0267 TYPE p0267.
Constant : lc_0267 type infty value '0267'.
* Check the Infotypes...
CLEAR lx_0267.
IF sy-tcode NE 'PA20' AND ( ipsyst-ioper EQ 'INS' OR ipsyst-ioper EQ 'MOD' ).
CASE innnn-infty.
WHEN lc_0267.
*** Importing data from innnn to the structure lx_0267
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = lx_0267.
Here you can write the logic... Like... Validations or pass default values to the screen elements..
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = lx_0267
IMPORTING
prelp = innnn.
WHEN OTHERS.
ENDCASE.
WHEN OTHERS.
ENDCASE.
ENDIF.
http://www.slideshare.net/RingelJen/user-exit-training
With regards,
SuDEESH
Dear Experts,
I want to use userexit EXIT_SAPFP50M_002 to assign default value to payroll identifier field.
All i want is when i press next screen the payroll identifier field is automatically filled according to the following query:
SELECT MAX(PAYID) from PA0267 into max_pay where BEGDA = Payment Date.
and assign max_pay + 1 to payroll identifier.
Here are the steps.
1- Run transaction PA70:
2- check Additional off-cycle Payments and Preselect using report, the with proposal
3- choose multiple personnel numbers
4- check with proposal
5- Here i change the payment date and add the wage type then press next screen,
all what i need is to automatically fill payroll identifier according to this query:
SELECT MAX(PAYID) from PA0267 into max_pay where BEGDA = Payment Date.
and assign max_pay + 1 to payroll identifier.
So for all these employee the payroll identifier will be assigned.
2013 Oct 21 6:13 AM
Hi Ahmed,
As discussed earlier to your previous thread
http://scn.sap.com/message/14423654#14423654
Write the same logic inside the USER EXIT.
EXIT_SAPFP50M_001
DATA : lx_0267 TYPE p0267.
Constant : lc_0267 type infty value '0267'.
* Check the Infotypes...
CLEAR lx_0267.
IF sy-tcode NE 'PA20' AND ( ipsyst-ioper EQ 'INS' OR ipsyst-ioper EQ 'MOD' ).
CASE innnn-infty.
WHEN lc_0267.
*** Importing data from innnn to the structure lx_0267
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = lx_0267.
Here you can write the logic... Like... Validations or pass default values to the screen elements..
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = lx_0267
IMPORTING
prelp = innnn.
WHEN OTHERS.
ENDCASE.
WHEN OTHERS.
ENDCASE.
ENDIF.
http://www.slideshare.net/RingelJen/user-exit-training
With regards,
SuDEESH
2013 Oct 21 10:14 AM
Dear Sudeesh,
I have here a different case, In PA30 it was a single employee only.
My logic is to search for the max payroll identifier in table PA0267 and increment this value and assign it to the employee.
as follows:
CASE innnn-infty.
WHEN lc_0267.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = lx_0267.
SELECT max( PAYID ) FROM PA0267 INTO SERIAL WHERE BEGDA = IPSYST-DDATE.
lx_0267-PAYID = SERIAL + '1'.
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = lx_0267
IMPORTING
prelp = innnn.
WHEN OTHERS.
ENDCASE.
For transaction PA70, i have multiple employees.
If i use the same logic for multiple employees, every employee will be incremented by one.
I want to increment the payid only once.
In other words:
I want to change the value of payid of all the employees at the same time
2013 Oct 21 10:24 AM
For this purpose why you want to write logic in EXIT.
Better try to create a custom program using the FM HR_INFOTYPE_OPERATION.
And update the same in the infotype 0267.
With regards.
SuDEESH
2013 Oct 21 12:44 PM
Can i create global variable that is incremented every time the exit is called?
2013 Oct 21 12:53 PM
2013 Oct 21 12:59 PM
CASE innnn-infty.
WHEN lc_0267.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = lx_0267.
GLOBVAR = GLOBVAR + 1.
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = lx_0267
IMPORTING
prelp = innnn.
WHEN OTHERS.
ENDCASE.
I want to get number of employees in the table and store it in global variable.
2013 Oct 21 1:06 PM
But where will you declare that global variable?
in user exit? if it so, whether it won't get be initial? when control passes for every employees?
2013 Oct 21 1:05 PM
Dear Ahmed,
You can use memory id as well.
import from memory id 'ZZPAYID'.
lx_0267-PAYID = SERIAL + '1'.
export to memory id 'ZZPAYID'.
2013 Oct 21 1:07 PM
This case doesnt work out like pa30 because they are multiple employees.
for example:
Higher payid in pa0267 is 4.
then personnal number 00999201 will have payid = 5.
and post it in pa0267.
for the next personnal number,
Higher payid in pa0267 will be 5.
then personnal number 00999203 will have payid = 6.
and post it in pa0267.
Higher payid in pa0267 will be 6.
then personnal number 00999333 will have payid = 7.
and post it in pa0267.
what i actually want is:
I want to look for the higher payid in pa0267.
and increment it and assign it to all the employees.
for example:
Higher payid in pa0267 is 4.
then personnal number 00999201 will have payid = 5.
for the next personnal number,
Higher payid in pa0267 will be 4.
then personnal number 00999203 will have payid = 5.
Higher payid in pa0267 will be 4.
then personnal number 00999333 will have payid = 5.
Then post post it in pa0267.
2013 Oct 21 1:11 PM
Try to create a custom program and update the same using the HR_INFOTYPE_OPERATION.
This will really help you!!
2013 Oct 21 1:17 PM
But i want this to be executed when the user create additional offcyle in pa70
2013 Oct 21 1:26 PM
Then for all employees, Get payid and increment it by 1.
l_payid = payid + 1.
2013 Oct 21 1:30 PM
2013 Oct 21 1:35 PM
2013 Oct 21 3:16 PM
2013 Oct 22 5:46 AM
You can write logic in EXIT_SAPFP50M_002. But Compare with your requirement.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |