2013 Oct 21 11:42 AM
Hi ,
Please help me to provide inputs for updating 0759 infotype , i have a requirement to update below fields :
Effective Date, Status of Process , Compensation Amount
2013 Oct 21 12:31 PM
You can use FM
* For performance reasons refresh buffer
call function 'HR_PSBUFFER_INITIALIZE'.
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0759'
number = "employee ID
subtype = "Subtype
objectid = "object ID - u can keep it blank
lockindicator = "Lock indicator - u can keep it blank
validityend = "end date
validitybegin = "begin Date
recordnumber = "Sequence Number
record = "Put the record
operation = 'MOD'
nocommit = ' '
importing
return = v_return.
Here you can take structure: L_0759
1) DATA: L_0759 like P0759.
2) You can fill all the details of IT0759, which ever is required in each field of L_0759. Make sure mandatory fields are populated.
3) You can use structure L_0759 in the respective parameter of "HR_INFOTYPE_OPERATION"
4) Make sure you Lock and Unlock the employee when Infotype Data is updated. Use function 'BAPI_EMPLOYEET_ENQUEUE' and 'BAPI_EMPLOYEET_DEQUEUE' for this purpose.
Hi ,
Please help me to provide inputs for updating 0759 infotype , i have a requirement to update below fields :
Effective Date, Status of Process , Compensation Amount
2013 Oct 21 12:00 PM
For Updating Compensation amount use FM : HR_ECM_CHANGE_CPAMT_PERCENT
For Status use FM : HR_ECM_CHANGE_PROC_STATUS
2013 Oct 21 12:31 PM
You can use FM
* For performance reasons refresh buffer
call function 'HR_PSBUFFER_INITIALIZE'.
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0759'
number = "employee ID
subtype = "Subtype
objectid = "object ID - u can keep it blank
lockindicator = "Lock indicator - u can keep it blank
validityend = "end date
validitybegin = "begin Date
recordnumber = "Sequence Number
record = "Put the record
operation = 'MOD'
nocommit = ' '
importing
return = v_return.
Here you can take structure: L_0759
1) DATA: L_0759 like P0759.
2) You can fill all the details of IT0759, which ever is required in each field of L_0759. Make sure mandatory fields are populated.
3) You can use structure L_0759 in the respective parameter of "HR_INFOTYPE_OPERATION"
4) Make sure you Lock and Unlock the employee when Infotype Data is updated. Use function 'BAPI_EMPLOYEET_ENQUEUE' and 'BAPI_EMPLOYEET_DEQUEUE' for this purpose.
2013 Oct 24 2:36 PM
I am able to update the infotype ..but i am not able to update the text field ...to insert text in the maintain text editor (clicking on F9), in infotype 0759.
2013 Oct 21 12:51 PM
H Shilpi,
To change the compensation process status use the FM HR_ECM_CHANGE_PROC_STATUS or execute the report RHECM_CHANGE_PROC_STATUS.
http://help.sap.com/erp2005_ehp_04/helpdata/EN/6a/1288e9373efc4b997b4bd4b64f831f/content.htm
To change the amount, execute the report RHECM_ADJUST_0759
http://help.sap.com/erp2005_ehp_06/helpdata/en/48/d8b79d99e64da5e10000000a421937/content.htm
Also check this link.
http://help.sap.com/erp2005_ehp_04/helpdata/EN/a7/82d5796f5c6b4f8b06784b924a8d4d/content.htm
Once activated, the additional off-cycle payment infotype 0267 is created with the amount, effective date and reason for the payment.
http://adept-consultancy.com/category/sap-enterprise-compensation-management/
Another option would be to use the FMs HR_ECM_READ_INFOTYPE (Get infotype data) and HR_ECM_MODIFY_INFOTYPE (modify infotype data).
2013 Oct 23 11:24 AM
added this logic for changing status ...getting return eq X but nothg changed
CREATE OBJECT pernr_message_handler.
SELECT SINGLE * FROM pa0759 INTO ls_pa0759 WHERE pernr = '00570858' AND endda >= sy-datum.
MOVE-CORRESPONDING ls_pa0759 TO ls_p0759.
ls_pa0759-cstat = '2'.
ls_p0759-infty = '0759'.
CALL METHOD cl_hrpa_infotype_0759=>set_activation_allowed
EXPORTING
activation_allowed = true.
CALL FUNCTION 'HR_ECM_INITIALIZE_BUFFER'
EXPORTING
message_handler = pernr_message_handler.
CALL FUNCTION 'HR_ECM_ENQUEUE_PERNR'
EXPORTING
pernr = ls_p0759-pernr
message_handler = pernr_message_handler
IMPORTING
is_ok = c_x.
CALL METHOD cl_hrecm00_process=>check_activation_allowed
EXPORTING
iv_pernr = ls_p0759-pernr
iv_citem = ls_p0759-citem
io_message_handler = pernr_message_handler
IMPORTING
ev_process_allows_activation = gv_activation_allowed
ev_is_ok = gv_is_ok.
CALL FUNCTION 'HR_ECM_CHANGE_PROC_STATUS'
EXPORTING
p0759 = ls_p0759
new_cstat = ls_pa0759-cstat
message_handler = pernr_message_handler
IMPORTING
is_ok = c_x.
* call function 'HR_ECM_MODIFY_INFOTYPE'
* exporting
* pnnnn = ls_p0759
* old_pskey = ls_p0759-pskey
* message_handler = pernr_message_handler
* importing
* is_ok = gv_is_ok.
CALL FUNCTION 'HR_ECM_DEQUEUE_PERNR'
EXPORTING
pernr = p0759-pernr
message_handler = pernr_message_handler
IMPORTING
is_ok = c_x.
CALL METHOD cl_hrpa_infotype_0759=>set_activation_allowed
EXPORTING
activation_allowed = false.
IF c_x EQ true.
CALL FUNCTION 'HR_ECM_ADD_MESSAGE'
EXPORTING
message_handler = pernr_message_handler
msgty = 'S'.
* msgid = hrecm00masterdata
* msgno = '021'
* msgv1 = wa_p0759-citem.
ENDIF.
2013 Oct 23 11:33 AM
2013 Oct 23 12:24 PM
2013 Oct 23 1:18 PM
Hi Shilpi,
Please refer to given link: "http://help.sap.com/erp2005_ehp_04/helpdata/EN/a7/82d5796f5c6b4f8b06784b924a8d4d/content.htm"
Here in the given link, it is clearly mentioned the following note.
Note:
Activation cannot be performed manually. Once activated by means of report Change Compensation Process Status, no changes should be allowed. You can change the status manually however (for example to Approved), but the changes in the secondary infotypes are not reverted.
If still you have problem then please make sure the passing parameters.
And still you have problem then you can first "Delete" the existing record and "Insert" latest record using 'HR_INFOTYPE_OPERATION'.
Please note: 'HR_INFOTYPE_OPERATION' is not a BAPI, it is a function module which doesn't check screen validations.
Thanks & Regards,
Tushar Trivedi.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |