Application Development 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: 

BADI : HRPAD00INFTY

Former Member
0 Kudos

Hi,

I have implemented the BADI HRPAD00INFTYto default value in infotype 0016.

I have the following code. but it is not working. the badi is active. and i have checked in debug mode. the value is coming correct but it is not getting defaulted.

i tried through user exit, the code works perfectly.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN

EXPORTING

PRELP = INNNN

IMPORTING

PNNNN = Ip0016.

SELECT SINGLE * FROM PA0298 INTO IP0298

WHERE PERNR = INNNN-PERNR

AND ORDNU NE ''.

IF SY-SUBRC EQ 0.

IP0016-CTNUM = IP0298-ORDNU+0(20).

ENDIF.

IP0016-LFZFR = 22.

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP

EXPORTING

PNNNN = IP0016

IMPORTING

PRELP = INNNN.

can anyone help me on this???

thanks

jayanthi.K

3 REPLIES 3

Former Member
0 Kudos

Jayanthi Kuttalam ,

Check for the OSS notes.

Thanks,

Greetson

Former Member
0 Kudos

Jayanthi Try using the following code,I few small change in u r code :


Data : I0016 type p0016,
          I0298 type p0298,
          I0000 type p0000..

CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
EXPORTING
PRELP = INNNN
IMPORTING
PNNNN = I0016.
SELECT SINGLE * FROM PA0298 INTO IP0298
WHERE PERNR = I0000-PERNR
AND *ORDNU NE ''.*(Write correct condition like I0298-ordnu ne '0')
IF SY-SUBRC EQ 0.
I0016-CTNUM = I0298-ORDNU+0(20).
ENDIF.
I0016-LFZFR = 22.
CALL METHOD CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP
EXPORTING
PNNNN = I0016
IMPORTING
PRELP = INNNN.

And I think u know that u need to write this code in BEFORE_OUTPUT method.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Apr 21, 2008 1:43 PM

0 Kudos

there is no problem in the query. i could see the value in debug mode. proper value is there in INNNN structure. the same code works perfectly in user exit.

thanks

jayanthi.K