11-15-2013 9:01 PM
Hi,
I am trying to default value for wagetype & TRFAR and TRFGB in user exit Include ZXPADU01 (before output).
But INNNN does not contain any information except PERNR and Dates inside the user exit.
But on PA30/PA40 screen I can see default values for TRFAR, TRFGB & LGA01, LGA02, etc.
I have already done the code for user exit so that is not the issue but values itself are not available.
Am I missing some place to check?
Please advise.
Regards,
Amit
11-17-2013 5:31 AM
Hi Amit Khare ,
The user exit ZXPADU01 is triggered only when you are opening an infotype for an employee in PA30 in create mode. It is not triggered in edit mode or display mode.
Andwhen creating the infotype, obviously, the only fields that are there would be PERNR, and the current date other than infotype number.You can however default your vales by using the casting method.
INNN is a generic structure and hence will not contain infotype specific information like trfgb, trfar, bet01, lga01 etc. To access these fields, you need to cast them the innn structure to specific infotype structure as mentioned above.
To default values, pass values to the infotype structure and cast it back to the generic structure using the reverse of the above method.
CASE innnn-infty.
when '0008'.
*--Cast generic structure to specific structure
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = v_0008.
v_0008-trfar =
v_0008-trfgb =
v_0008-lga01 =
v_0008-bet01 =
etc ( I guess you must have already done this)
*--Cast specific structure to generic structure
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = v_0008
IMPORTING
prelp = innnn.
You will get your values defaulted.
If you want to get the already existing values of these fields, when you will obviously be in edit mode, then you need to implement the BADI HRPAD00INFTY which will be triggered on editing any infotype.
11-16-2013 6:57 AM
Declare a structure of type P0008.
Call the below method.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = ls_0008.
You will get all the required field values in ls_0008.
11-16-2013 7:14 PM
Hitesh,
Thats what I mentioend, it only returning PERNR, BEGDA & ENDDA.
11-17-2013 7:06 AM
Hi Amit,
As suggested by Hitesh structure LS_0008 going to have fields TRFAR and TRFGB. As you have mentioned you want to default it. You need to pass the values to these fields to populate as default.
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = LS_0008.
LS_0008-TRFAR = 'X'.
LS_0008-TRFGB = 'Y'.
cl_hr_pnnnn_type_cast=>pnnnn_to_prelp(
EXPORTING
pnnnn = LS_0008
IMPORTING
prelp = innnn
).
Cheers
11-17-2013 7:15 AM
Hi Amit,
Pls go thru the below suggestion given by Susmitha in details or try to explore INNNN-DATA1.
Cheers
11-17-2013 5:31 AM
Hi Amit Khare ,
The user exit ZXPADU01 is triggered only when you are opening an infotype for an employee in PA30 in create mode. It is not triggered in edit mode or display mode.
Andwhen creating the infotype, obviously, the only fields that are there would be PERNR, and the current date other than infotype number.You can however default your vales by using the casting method.
INNN is a generic structure and hence will not contain infotype specific information like trfgb, trfar, bet01, lga01 etc. To access these fields, you need to cast them the innn structure to specific infotype structure as mentioned above.
To default values, pass values to the infotype structure and cast it back to the generic structure using the reverse of the above method.
CASE innnn-infty.
when '0008'.
*--Cast generic structure to specific structure
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = v_0008.
v_0008-trfar =
v_0008-trfgb =
v_0008-lga01 =
v_0008-bet01 =
etc ( I guess you must have already done this)
*--Cast specific structure to generic structure
CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = v_0008
IMPORTING
prelp = innnn.
You will get your values defaulted.
If you want to get the already existing values of these fields, when you will obviously be in edit mode, then you need to implement the BADI HRPAD00INFTY which will be triggered on editing any infotype.
11-18-2013 2:39 AM
Susmitha,
As mentioned when I am doing
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnn , I am only getting PERNR and none of the other fields.
I am aware about the conditions to handle the user exit.
11-18-2013 4:16 AM
Hi Amit,
You must have triggered this when creating the info type. So what other information other than pernr do you have to be retrieved ? There is no other information available for the screen before creating hence, you will not get any thing else. What other information are you expecting to get when you are calling the method while creating the infotype?
But you can pass data to the screen using this method and the reverse of this method.
Once again, as I had written above, if you are talking about editing an infotype, when information is already there, then there is a question of getting other information besides pernr. In such a case, as I had mentioned above, ZXPADU01 may not be triggered in edit mode and you may have to use the BADI HRPAD00INFTY to access the data.
07-11-2014 10:19 AM
Hi ,
I am facing the problem.
calculated all values but in display mode it is not reflecting the calculated value ..
i m trying to use your code :
> if sy-ucomm ne 'UPD' and sy-ucomm ne 'UPDL'.
> show_data_again = 'X'.
> endif.
but still not getting.
AFTER CALCULATING IT IS SHOWING VALUE IN CHANGE MODE..
BUT AGAIN WHEN WE DISPLAY IT IS NOT REFLECTING..
.
need to display
1spl wage type(bet06) and total amount (sumbb)
please guide....
11-18-2013 1:19 AM
Amit,
I think you need to implement the Classic BAdI HRPAD00INFTY then use this to convert it into a Kernel BAdI / Enhancement Spot BAdI.
The PBO FM of the enhancement PBAS0001 will only be called by system on INS (Create) mode and COP (Copy) mode. The INNNN is not populated in your case because it is simply not called by the system when you are in MOD (Change) mode.
Cheers,
Sougata.
11-18-2013 2:41 AM
Sougata,
I am calling the code while creating the infotype.
Regards,
Amit
11-18-2013 5:41 AM
Of course you will be if you are in the Create mode.
So you have PERNR, BEGDA and ENDDA in the INNNN structure....
Say you want to default TRFGR to "Salary".
Why don't you do it like below in ZXPADU01
CASE innnn-infty.
WHEN `0008`.
DATA: ls_p0008 TYPE p0008.
cl_hr_pnnnn_type_cast=>prelp_to_pnnnn(
EXPORTING
prelp = innnn
IMPORTING
pnnnn = ls_p0008 ).
ls_p0008-trfgr = |SALARY|.
cl_hr_pnnnn_type_cast=>pnnnn_to_prelp(
EXPORTING
pnnnn = ls_p0008
IMPORTING
prelp = innnn ).
WHEN OTHERS.
ENDCASE.
Cheers,
Sougata.
11-18-2013 6:17 AM
Actually don't use the BAdI HRPAD00INFTY as you are trying to default values to the screen. You won't be able to do this with that BAdI because all parameters of the method BEFORE_OUTPUT are IMPORTING.
Cheers,
Sougata.
11-18-2013 8:23 PM
my issue is not TRFAR, TRFGB but LGA01, LGA02 as they are not showing any wage types.
I am able to figure out that wage tye are populating via fetaure LGMST so they are not part here.