cancel
Showing results for 
Search instead for 
Did you mean: 

BADI for HR infotypes

Former Member
0 Kudos

Hello Experts,

Hello All,

I am using BAdi HRPAD00INFTY (before output) for chnaging some values of the HR infotypes before display such as Salary.I am accessing those values by using following code.

data : I0008 TYPE P0008.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

EXPORTING

PRELP = INNNN

IMPORTING

PNNNN = I0008.

All the values all populating in I0008 but when i change the value of bet01(I0008-bet01 = 123456.) , it is not displaying on screen.

any idea?? Is there any other way to process the data of SAP HR screen before display?

Thanks,

Prashant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

After you get the data in I0008 structure , you have to again change in to PNNNN structure.For that use this method CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP. Please give points if this reply helps you.

regards,

Bhagyashree

Former Member
0 Kudos

Thanks Bhagyashree for your prompt reply. I have done this also. I have written following code :

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

EXPORTING

PRELP = INNNN

IMPORTING

PNNNN = I0008.

I0008-bet01 = 123456.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP

EXPORTING

PNNNN = I0008

IMPORTING

PRELP = INNNN.

but screen is not getting refreshed!!

Is I am missing anyrhing??

Regards,

Prashant

Edited by: Prashant Jagdale (Genius) on Jan 8, 2009 11:34 AM

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks you all for your valuable help!!!

I did the same using field-symbols. I have used following code.

data : sub_area_salary TYPE P0008-bet01.

field-symbols <fs_Salary> type any.

if sy-dynnr = 2010 or sy-dynnr = 2000 .

sub_area_salary = SoapResponse-DATA_OUT.

assign ('(MP000800)p0008-bet01') to <fs_Salary>.

<fs_Salary> = sub_area_salary.

endif.

Former Member
0 Kudos

Hi Prashant,

I am facing the same problem, can you please share the solution,where u have added the field symbol code.

Regards

Lakhan

0 Kudos

Thanks P NJ after all this time, your solution still works !!

regards

HBastian

Former Member
0 Kudos

Hi Prashant

your code may be working fine i guess , but you wont be able to see it while changing

just save the record come out of PA30 & then check again in if the changed value is there ( and you may see the changed value now ) the problem in Infotype -8 is it has screen fields of Q structure so some times you dont see the changes immediately.

Former Member
0 Kudos

Thanks Abap, I am waiting for your post only.

But i am not changing the values, i am just displaying the same. I need to modify the data before displaying. I need to do it for PBO.

Any help??

Thanks,

Prashant

Former Member
0 Kudos

Also Please give points if my reply has helped you !!

Former Member
0 Kudos

I think badi wont work becoz it has only import parameters. try using exit EXIT_SAPFP50M_001 . This exit is trigerred while saving any infotype. It has INNNN as importing and exporting paramters.

In this badi chek for infotype

IF innnn-infty = '0008'.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

EXPORTING

PRELP = INNNN

IMPORTING

PNNNN = I0008.

I0008-bet01 = 123456.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP

EXPORTING

PNNNN = I0008

IMPORTING

PRELP = INNNN.

endif.

Former Member
0 Kudos

I don't want to change the values while saving. I need to do the changes before displaying.

I already checked with your specified user exit, for this also, control is not coming in this when user clicks on display button.

Regards,

Prashant