05-29-2014 7:42 AM
Hi,
I am in ABAP HR. I want to update one existing record for info type 0583. Basically I want to add wage type and amount for an existing employee and new update would be reflected in table PA0583 table.
How to make this requirement? Is there any HR function module to make this requirement?
Kindly provide sample code for this requirement.
Thanks in advanced..
Regards,
Arindam Samanta.
05-29-2014 7:48 AM
Hi Arindam,
To update the Infotype Use the below mentioned FM,
BAPI_EMPLOYEE_ENQUEUE
HR_INFOTYPE_OPERATION
-In this FM you have to use the appropriate code for update for the "OPERATION "
COP Copy
DEL Delete
DIS Display
EDQ Lock/unlock
INS Create
LIS9 Delimit
MOD Change
INSS Create for Actions is not converted to Change
BAPI_EMPLOYEE_DEQUEUE
Regards,
Sindhuja
05-29-2014 7:48 AM
Hi Arindam,
To update the Infotype Use the below mentioned FM,
BAPI_EMPLOYEE_ENQUEUE
HR_INFOTYPE_OPERATION
-In this FM you have to use the appropriate code for update for the "OPERATION "
COP Copy
DEL Delete
DIS Display
EDQ Lock/unlock
INS Create
LIS9 Delimit
MOD Change
INSS Create for Actions is not converted to Change
BAPI_EMPLOYEE_DEQUEUE
Regards,
Sindhuja
05-29-2014 9:34 AM
Hi Sindhuja,
Thanks for your reply.
I have another question. Using FM ' HR_READ_INFOTYPE' I want to display the record. For that, my code is below -
DATA: lv_inftyp TYPE prelp-infty VALUE '0583',
it_infty_tab TYPE STANDARD TABLE OF PA0583.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = im_pernr
infty = lv_inftyp
begda = '20061215'
endda = '99991231'
TABLES
infty_tab = it_infty_tab.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
I have made this code in my custom class method. So I want to export it_infty_tab in the method.
The code is -
infty_tab = it_infty_tab.
So in my method I have created an export parameter with type PA0583. But in this case I am getting one error -
The type of IT_INFTY_TAB can not be converted to the type of INFTY_TAB.
Why this error is coming?
So how can I make one export parameter as PA0583 in my class method?
Thanks in advanced.
Regards,
Arindam Samanta.
05-29-2014 9:41 AM
Hi Arindam,
Give IT_INFTY_TAB as TYPE TABLE OF P0583.
Reason :
This may occur due to the structure of PA0583 will be with MANDT as 1st and in infty_tab there will be no MANDT, since it is of the type P0583.
Regards,
Sindhuja.
05-29-2014 9:54 AM
Hi Sindhuja,
As you suggested, I made the changes -
Inside method, - it_infty_tab TYPE TABLE OF P0583 and in export parameter of the method I assigned as type P0583.
But still error is coming.
Regards,
Arindam Samanta.
05-29-2014 10:00 AM
Hi Arindam,
Could u attach the error screenshot? Is it still the error regarding to type ?
REPORT ZTESTT.
INFOTYPES : 0001,0002,0003,0008,9004.
TABLES : PERNR .
DATA : LV_INF TYPE PRELP-INFTY VALUE '0002'.
DATA : GIT TYPE TABLE OF P0002.
START-OF-SELECTION.
GET PERNR.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS = 'A'
PERNR = pernr-pernr
INFTY = lv_inf
BEGDA = pnpbegda
ENDDA = pnpendda
* BYPASS_BUFFER = ' '
* LEGACY_MODE = ' '
* IMPORTING
* SUBRC =
TABLES
INFTY_TAB = GIT
* EXCEPTIONS
* INFTY_NOT_FOUND = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
END-OF-SELECTION.
Regards,
Sindhuja
05-29-2014 10:31 AM
Hi Sindhuja,
I sharing one screen shot.
Could you please suggest to remove this error?
Thanks in advance.
Regards,
Arindam Samanta.
05-29-2014 10:35 AM
05-29-2014 10:50 AM
Hi Sindhuja,
I have checked with p0583 and pa0583. In both case same error is coming.
Regards,
Arindam Samanta.
05-29-2014 11:47 AM
Hi Arindam,
There are two ways to solve your problem.
1. Please create TABLE type in Types (Tab) and assign to your export parameter. else
2. You need to create table type in SE11 and assign to your export parameter.
Please find below screen shot.
1 step:
2nd:
3ed:
try this..!
Code:
data: lv_inftyp type prelp-infty value '0583',
it_inf_tab type table of pa0583.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
* TCLAS = 'A'
PERNR = pernr
INFTY = lv_inftyp
BEGDA = '18000101'
ENDDA = '99991231'
* BYPASS_BUFFER = ' '
* LEGACY_MODE = ' '
* IMPORTING
* SUBRC =
TABLES
INFTY_TAB = it_inf_tab
EXCEPTIONS
INFTY_NOT_FOUND = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
INFY_TAB[] = it_inf_tab[].
output of the class:
05-29-2014 12:17 PM
Hi Akshath,
It's now working. You reply working for me.
Regards,
Arindam Samanta.