‎2008 Oct 29 5:20 PM
Please provide updates for this question:
What are the standard SAP programs to update infotypes ( Ex: 001 / 002 / 003 ) .
I will be uploading data from legacy system ( Excel / Text file ) and would like to use standard programs
before going ahead with BDC .
Thanks
Rohan
‎2008 Oct 30 5:55 AM
Please provide updates for this question:
What are the standard SAP programs to update infotypes ( Ex: 001 / 002 / 003 ) .
I will be uploading data from legacy system ( Excel / Text file ) and would like to use standard programs
before going ahead with BDC .
Thanks
Rohan
Hi Rohan ,
you can update you infotype using 'HR_INFOTYPE_OPERATION' function module .
1) transfer all your excel data into internal table .
2) loop at internal table
3) fill all the required field of that infotype .
4) lock table
5) call that functuion module .
6) unlock table
for this fallow the below code...
DATA: it_p0169 TYPE STANDARD TABLE OF pa0169 WITH HEADER LINE. (make internal table according to your requirment)
DATA: wa_p0169 TYPE p0169.
LOOP AT it_file
v_eeamt = it_file-pct_gross.
*Pre-Tax Contribution Percentage
v_eepct = v_eeamt / 10.
v_begda = it_file-datchngd .
*Appending into header (these all are the required filed in my case )
it_p0169-eeamt = v_eeamt.
it_p0169-begda = v_begda.
it_p0169-eepct = v_eepct.
it_p0169-bplan = v_bplan .
CLEAR wa_p0169.
MOVE-CORRESPONDING it_p0169 TO wa_p0169.
wa_p0169-INFTY = '0169'. (not forget to pass infotype no in the header )
CONSTANTS: c_action_ins TYPE pspar-actio VALUE 'MOD', (it can be also COP for Copy , DEL for Delete , DIS for Display , MOD to Change , LIS9 to Delimit , INS to Create )
c_infty_0169 TYPE prelp-infty VALUE '0169'.
DATA: it_return TYPE bapireturn1. (as it is )
DATA: it_return TYPE bapireturn1.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RAISE enqueue_FAILED.
ENDIF.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = c_infty_0169
number = p_wa_0169-pernr
SUBTYPE = '401K'
OBJECTID =
LOCKINDICATOR =
validityend = p_wa_0169-endda
validitybegin = v_begda1
RECORDNUMBER =
record = p_wa_0169
operation = c_action_ins
TCLAS = 'A'
DIALOG_MODE = '0'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
return = it_return.
if it_return-MESSAGE is not initial .
delete it_file .
endif.
commit work .
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RAISE DEQUEUE_FAILED.
ENDIF.
Enjoy
Priyank
‎2008 Oct 29 5:50 PM
Have you checked fm call function 'HR_INFOTYPE_OPERATION'
a®
‎2008 Oct 29 5:51 PM
HR_INFOTYPE_OPERATION is the FM that will is used for uploads for almost all infotypes.
‎2008 Oct 29 5:53 PM
If you are on ECC 5.0 and + you can use DTT. SAP Best Practices. Go to SE38 and look for /HRBP/* programs.
Aman
‎2008 Oct 29 6:16 PM
I would like to use standard programs (direct input ) before going ahead with BDC / functions .
Also, I could not find any program like /HRBP/ .
There is a program to 'transfer master data' - RPUSTD00 .
It works for very few infotypes .
Could you please tell me if there are such other programs which will update infotype ex: 0021 / 0171 / 0170
Thanks
‎2008 Oct 30 5:55 AM
Please provide updates for this question:
What are the standard SAP programs to update infotypes ( Ex: 001 / 002 / 003 ) .
I will be uploading data from legacy system ( Excel / Text file ) and would like to use standard programs
before going ahead with BDC .
Thanks
Rohan
Hi Rohan ,
you can update you infotype using 'HR_INFOTYPE_OPERATION' function module .
1) transfer all your excel data into internal table .
2) loop at internal table
3) fill all the required field of that infotype .
4) lock table
5) call that functuion module .
6) unlock table
for this fallow the below code...
DATA: it_p0169 TYPE STANDARD TABLE OF pa0169 WITH HEADER LINE. (make internal table according to your requirment)
DATA: wa_p0169 TYPE p0169.
LOOP AT it_file
v_eeamt = it_file-pct_gross.
*Pre-Tax Contribution Percentage
v_eepct = v_eeamt / 10.
v_begda = it_file-datchngd .
*Appending into header (these all are the required filed in my case )
it_p0169-eeamt = v_eeamt.
it_p0169-begda = v_begda.
it_p0169-eepct = v_eepct.
it_p0169-bplan = v_bplan .
CLEAR wa_p0169.
MOVE-CORRESPONDING it_p0169 TO wa_p0169.
wa_p0169-INFTY = '0169'. (not forget to pass infotype no in the header )
CONSTANTS: c_action_ins TYPE pspar-actio VALUE 'MOD', (it can be also COP for Copy , DEL for Delete , DIS for Display , MOD to Change , LIS9 to Delimit , INS to Create )
c_infty_0169 TYPE prelp-infty VALUE '0169'.
DATA: it_return TYPE bapireturn1. (as it is )
DATA: it_return TYPE bapireturn1.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RAISE enqueue_FAILED.
ENDIF.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = c_infty_0169
number = p_wa_0169-pernr
SUBTYPE = '401K'
OBJECTID =
LOCKINDICATOR =
validityend = p_wa_0169-endda
validitybegin = v_begda1
RECORDNUMBER =
record = p_wa_0169
operation = c_action_ins
TCLAS = 'A'
DIALOG_MODE = '0'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
return = it_return.
if it_return-MESSAGE is not initial .
delete it_file .
endif.
commit work .
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RAISE DEQUEUE_FAILED.
ENDIF.
Enjoy
Priyank
‎2008 Nov 06 6:50 PM
I am using BAPI Function HR Maintain masterdata to update infotypes .
Thanks again for all the inputs .