Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Modifying values in an infotype using HRPAD00INFTY's BEFORE_OUTPUT method.

Former Member
0 Likes
1,046

Hi,

When I select an employee in Infotype 0194 using transaction PA30, I would like to set a series of fields to a series of values from another table. I've implemented it via an enhancement to HRPAD00INFTY's BEFORE_OUTPUT method, but the values aren't showing up in the fields on the change screen, and I do not understand why it isn't working properly. Could someone tell me what I'm doing wrong?

DATA i0194 TYPE p0194.

IF sy-tcode = 'PA30' AND INNNN-INFTY = '0194'.

CLASS cl_hr_pnnnn_type_cast DEFINITION LOAD.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

EXPORTING

PRELP = INNNN

IMPORTING

PNNNN = i0194.

"Changes to i0194 here

i0194-ORNAM = ........

i0194-ORSTR = ........

i0194-ORORT = ........

........etc.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP

EXPORTING

PNNNN = i0194

IMPORTING

PRELP = INNNN.

ENDIF.

Looking through the debugger, the code is being executed and the data appears to be copied over, but it's not appearing in the fields on the change or display screens.

Hi,

When I select an employee in Infotype 0194 using transaction PA30, I would like to set a series of fields to a series of values from another table. I've implemented it via an enhancement to HRPAD00INFTY's BEFORE_OUTPUT method, but the values aren't showing up in the fields on the change screen, and I do not understand why it isn't working properly. Could someone tell me what I'm doing wrong?

DATA i0194 TYPE p0194.

IF sy-tcode = 'PA30' AND INNNN-INFTY = '0194'.

CLASS cl_hr_pnnnn_type_cast DEFINITION LOAD.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

EXPORTING

PRELP = INNNN

IMPORTING

PNNNN = i0194.

"Changes to i0194 here

i0194-ORNAM = ........

i0194-ORSTR = ........

i0194-ORORT = ........

........etc.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP

EXPORTING

PNNNN = i0194

IMPORTING

PRELP = INNNN.

ENDIF.

Looking through the debugger, the code is being executed and the data appears to be copied over, but it's not appearing in the fields on the change or display screens.

4 REPLIES 4
Read only

uwe_schieferstein
Active Contributor
0 Likes
843

Hello Andrew

Have you had a look at the type of the method parameters?

All are IMPORTING meaning that none of the changes you do within your method is propagated to the calling program.

However, you may use the following trick described in:

[SAP User Exits and the People Who Love Them|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8]

Regards

Uwe

Read only

Former Member
0 Likes
843

Ah. Thank you for pointing that out. The original plan was to modify the user exit to do this, but the PBO use exit does not seem to be invoked when selecting change or display mode. I'm at a bit of a loss as how to modify the screen fields during PBO.

Read only

Former Member
0 Likes
843

I resolved the problem by enhancing a later point in the program MP019400 to place the values for P0194-ORNAM, etc., in there. Now it is setting the data as I want it.

Read only

0 Likes
843

Can you please explain the procedure to do it as I am facing the same problem.

Thanks