Welcome To My BLOG

This site is to give a brief idea for the abap learners who are looking for some real time programs .It consists of collection of programs from my side . I hope these programs are very much used for all of the learners. Please check the links for any information in ABAP.
Please vote for my Blog. And please input me on this mail addrssess.Email me

Share this link with your friends

http://www.rebtel.com/u/15163104576

For every friend who signs up using this link and makes a payment, we'll give you 8 €!


Monday, December 20, 2010

Handling User Exits In HR ABAP


There are two main user exits for HR module, namely ZXPADU01 and ZXPADU02. The first one is for the PAI( putting the default values) and the second is for the PBO( after an event like enter or save) in the transaction. There are the exits for the transactions PA20,30,40 and PB20,30,40.

Please find the below code to work on.

case: innnn-infty.

when '0014'.

call method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = i0014.

select * from pa0008
into corresponding fields of table it_pa0008
where pernr = i0014-pernr.

if sy-subrc = 0.
read table it_pa0008 index 1.

move it_pa0008 to lfs_0008.

do 40 times varying wagetypes-lga from lfs_0008-lga01 next lfs_0008-lga02
varying wagetypes-bet from lfs_0008-bet01 next lfs_0008-bet02.

check wagetypes-lga is not initial.

case wagetypes-lga.
when '1000'.
v_basic = wagetypes-bet.
endcase.

enddo.

endif.

v_hra = v_basic * 25 / 100.

v_final_amt = v_basic + v_hra.

if i0014-lgart = '2000'.

i0014-betrg = v_final_amt * ( 9 / 100 ). .
i0014-waers = 'SAR'.

elseif i0014-lgart = '2010'.

i0014-betrg = v_final_amt * ( 11 / 100 ).
i0014-waers = 'SAR'.

if i0014-betrg le 0.
i0014-betrg = i0014-betrg .
endif.

elseif i0014-lgart = '2020'.

i0014-betrg = v_final_amt * ( 2 / 100 ).

if i0014-betrg gt '900'.
i0014-betrg = '900'.
endif.

i0014-waers = 'SAR'.

if i0014-betrg le 0.
i0014-betrg = i0014-betrg.
endif.

endif.

call method cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
EXPORTING
pnnnn = i0014
IMPORTING
prelp = innnn.

if sy-ucomm = ''.
show_data_again = 'X'.
else.
show_data_again = ''.
endif.


Here the show data again is required to display the contents after the event like enter or save or some other. if there is no manupulation of data, there is no use of show_data_again .

No comments: