on 04-26-2012 11:01 AM
Hi experts,
In web dynpro leave application screen, i m entering staring date and lev end date. based on that it will calculate next resuming date..
so my problem is i m updating the resuming date in PA9005 table with function module ' HR_INFOTYPE_OPERATION '.
I need to update only the act_resum field. can u guide me what are the values i need to pass to the above FM?
Hi Ramana,
I hope you are trying to modify existing infotype record. May be below code is usefule for you.
first you need read the existing infotype record which you want to modify (old image). and same record modfiy with with the values you want modify and pass same structure to FM HR_INFOTYPE _OPERATION as showed below.
call function 'HR_READ_INFOTYPE'
exporting
* TCLAS = 'A'
pernr = iv_pernr
infty = '0002'
tables
infty_tab = lt_p0002
exceptions
infty_not_found = 1
others = 2.
if sy-subrc <> 0.
*--->Implement suitable error handling here
endif.
read table lt_p0002 assigning <fs_p0002> with key endda = hr_high_date.
if sy-subrc = 0.
ls_record = <fs_p0002>.
if <fs_p0002>-vorna ne iv_vorna or <fs_p0002>-nachn ne iv_nachn .
validitybegin = <fs_p0002>-begda.
validityend = <fs_p0002>-endda.
ls_record-seqnr = <fs_p0002>-seqnr.
ls_record-vorna = iv_vorna.
ls_record-nachn = iv_nachn.
ls_record-begda = <fs_p0002>-begda.
ls_record-endda = <fs_p0002>-endda.
ls_record-subty = <fs_p0002>-subty.
ls_record-pernr = <fs_p0002>-pernr.
ls_record-objps = <fs_p0002>-objps.
ls_record-sprps = <fs_p0002>-sprps.
c_change = 'MOD'
*---> Change infotype 0002
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0002'
subtype = ls_record-subty
objectid = ls_record-objps
number = ls_record-pernr "employeenumber
validityend = validityend
validitybegin = validitybegin
record = ls_record
recordnumber = ls_record-seqnr
operation = c_change
nocommit = abap_true
dialog_mode = '0'
importing
return = ls_ret_0002
key = personaldatakey
exceptions
others = 0.
regards
Srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to pass INFTY,NUMBER,RECORD and OPERATION. Rest is optional .
Let me say you an easy way, Go SE37 , Give the FM name you want to use, press (CTRL+SHIFT+F3), which will give you a where used list. You can see how that FM is implimented.
You can tr the same in your code..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ramana,
updating infotype using HR_INFOTYPE_OPERATION will need many values , main sequence number,begda, endda, and you have to pass the infotype structure values.... and in operation you have to use UPD. I can not write every parameter here.
check below link. it will help you.
http://www.se80.co.uk/sapfms/h/hr_i/hr_infotype_operation.htm
http://www.sapdev.co.uk/fmodules/fms_HR_INFOTYPE_OPERATION.htm
Regards
Srinivas
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.