10-16-2008 3:36 PM
Hello,
IT0105: How to insert/update with HR_INFOTYPE_OPERATION?
I need to insert/update following info:
USRTY = 'MAIL'
SYSID = 'my.email at something.com'
USRTY = 'NETW'
SYSID = 'BEOPT'
USRTY = 'LEAS'
SYSID = 'ABC123'
...
Can anyone help me please?
Thanks.
10-16-2008 3:44 PM
For Infotype 105 use these BAPIs.
BAPI_EMPLCOMM_CREATE
BAPI_EMPLCOMM_CHANGE
BAPI_EMPLCOMM_DELIMIT
BAPI_EMPLCOMM_GETDETAIL
-Aman
10-16-2008 3:41 PM
Hi,
Check this code block..this code is for updating records in infotype 0015. May be it will help u to meet ur requirement.
Local data declaration
data:
Bapi Return Parameter
l_wa_bapireturn type bapireturn1, "Bapi Return Message
Work-area for HR Master Record: Infotype 0015
l_wa_pa0015 type p0015. "HR Master Record: Infotype 0015
Get the data from internal table and create using BAPI.
loop at i_data into wa_data.
'BAPI_EMPLOYEE_ENQUEUE' to lock the employee before updating
call function 'BAPI_EMPLOYEE_ENQUEUE'
exporting
number = wa_data-pernr "Personnel No
importing
return = l_wa_bapireturn. "BAPI return messages
If BAPI returns error message then display Enqueue Failed.
if l_wa_bapireturn-id ne space.
Set the checkflag.
wa_data-chkflg = c_check.
Populate the reason for failure
wa_data-msg = 'Enqueue failed'(005).
Modify the check flag and message field of internal table i_data
modify i_data from wa_data transporting chkflg msg.
Increment the counter for failure
v_fail = v_fail + 1.
Exit from the loop for the next pass
continue.
endif.
Work-area is populated
l_wa_pa0015-pernr = wa_data-pernr. "Personnel Number
l_wa_pa0015-begda = wa_data-begda. "Start Date
l_wa_pa0015-lgart = wa_data-lgart. "Wage Type
Replace the comma separator in the Amount Field
replace all occurrences of c_comma in wa_data-betrg with ''.
Condense the amount field
condense wa_data-betrg.
l_wa_pa0015-betrg = wa_data-betrg. "Wagetype of Amount for payments
l_wa_pa0015-waers = wa_data-waers. "Currency Key
l_wa_pa0015-zuord = wa_data-zuord. "Assignment No.
Updates the information for Infotype 00015
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = c_type "Infotype(0015)
number = wa_data-pernr "Personnel No
record = l_wa_pa0015 "Internal table for infotype
validitybegin = c_begin "Validity Start Date
validityend = c_end "Validity End Date
operation = c_mode "Mode of operation(Insert)
importing
return = l_wa_bapireturn."BAPI return messages
10-16-2008 3:44 PM
For Infotype 105 use these BAPIs.
BAPI_EMPLCOMM_CREATE
BAPI_EMPLCOMM_CHANGE
BAPI_EMPLCOMM_DELIMIT
BAPI_EMPLCOMM_GETDETAIL
-Aman
10-16-2008 3:56 PM
How do you work with the seqnrs?
So if you have 4 items to put into IT0105 for 1 PERNR.
(I hope this makes sense)
I know you can do it with HR_MAINTAIN_MASTERDATA and the table PROPOSED_VALUES, but how to do this with HR_INFOTYPE_OPERATION
t_prop-INFTY = '0105'.
t_prop-FNAME = 'P0105-USRTY'.
t_prop-FVAL = 'MAIL'.
t_prop-SEQNR = '00'.
append t_prop.
t_prop-INFTY = '0105'.
t_prop-FNAME = 'P0105-SYSID'.
t_prop-FVAL = 'my.email at something.com'.
t_prop-SEQNR = '00'.
append t_prop.
t_prop-INFTY = '0105'.
t_prop-FNAME = 'P0105-USRTY'.
t_prop-FVAL = 'LEAS'.
t_prop-SEQNR = '01'.
append t_prop.
t_prop-INFTY = '0105'.
t_prop-FNAME = 'P0105-SYSID'.
t_prop-FVAL = 'ABC123'.
t_prop-SEQNR = '01'.
append t_prop.
...
10-16-2008 4:26 PM
Hi Dude,
Simple question.. any specific reason to complicate code? Why not keep it simple with BAPI_EMPLCOMM_CREATE.
A
10-17-2008 7:25 AM
How do you use this?
Is this per communication type or can I give in all at one time.
If it's also per communication type, then I can use the same FM as for the others [HR_INFTOTYPE_OPERATION] 😄
It's my first ABAP try, maybe that's why I complicate things 😜
Best regards,
Ilse
10-17-2008 10:36 AM
Dear
Each Coomunication type is belogs to subtype of the IT0105.
So you have to insert one by one.
Like subtype 0001 for User Name
subtype 0010 for email id.
Regards,
Chandrashekhar
10-17-2008 10:45 AM
Thanks, but if it's one by one, I will use HR_INFOTYPE_OPERATION to be consistent with the rest of the code