10-20-2008 3:56 PM
How do I update an employee with HR_INFOTYPE_OPERATION?
This is my code, but it returns error "Fill in all required entry fields"...
DATA: P0002 like p0002 occurs 0 with header line.
DATA: RC1 TYPE BAPIRETURN1.
DATA: RC3 TYPE BAPIRETURN1.
P0002-NACHN = NACHN.
P0002-VORNA = VORNA.
P0002-GESCH = GESCH.
P0002-GBDAT = GBDAT.
P0002-PERID = PERID.
*Lock Employee
*-------------
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = PERNR
IMPORTING
return = RC3.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0002'
NUMBER = PERNR
* SUBTYPE =
* OBJECTID =
* LOCKINDICATOR =
VALIDITYEND = '99991231'
VALIDITYBEGIN = '19780625'
* RECORDNUMBER =
RECORD = P0002
OPERATION = 'MOD'
* TCLAS = 'A'
* DIALOG_MODE = '0'
* NOCOMMIT =
* VIEW_IDENTIFIER =
* SECONDARY_RECORD =
IMPORTING
RETURN = RC1
* KEY =
.
*Unlock Employee
*---------------
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = PERNR.
What am I doing wrong?
Thanks in advance.
10-20-2008 4:14 PM
Go to PA30 transaction with the same employee and see what is the mandatory information you have to pass for the infotype 0002. this way you can cross check what you are missing. and supply the information which you are missing.
10-20-2008 4:14 PM
Go to PA30 transaction with the same employee and see what is the mandatory information you have to pass for the infotype 0002. this way you can cross check what you are missing. and supply the information which you are missing.
10-21-2008 7:19 AM
Go to PA30 transaction with the same employee and see what is the mandatory information you have to pass for the infotype 0002. this way you can cross check what you are missing. and supply the information which you are missing.
I've tried this and there is no mandatory info missing
10-21-2008 7:31 AM
10-21-2008 7:54 AM
try to pass BEGDA and ENDDA in p0002 structure and see.
That was also my idea, but no luck
Try to use the Function module HR_MAINTAIN_MASTERDATA
How do I need to use this if IT0000 and IT0001 don't need to be changed?
Which MASSN do I need to use then?
Which other parameters do I need to pass?
10-21-2008 8:00 AM
do one thing, just select the record from pa0002 directly into p0002 structure, now override the values what ever you want. and call the function and see.
10-21-2008 8:04 AM
Hi
HR_MAINTAIN_MASTERDATA if you open and see the definiton of this function module then you can observer that all the import parameters are OPTIONAL Either you can send or you may not but what evr the values that you pass those values are considered and its default INFOTYPE ACTION is INSERT all you have to write MOD and coming to the tables part it is mandartory to pass the PROPOSED_VALUES it is of type structure PROP so all you need to pass is the field name(FNAME) and fieldvalue(FVAL)
10-21-2008 8:19 AM
do one thing, just select the record from pa0002 directly into p0002 structure, now override the values what ever you want. and call the function and see.
Then I get a dump... :'-(
ASSIGN_BASE_TOO_SHORT
ROW 271 in HR_INFOTYPE_OPERATION
10-21-2008 8:31 AM
the error may be because of your select, since pa0002 and p0002 is different in structures. so the fields will be shifted, so you get wrong data to p0002 structure.
select * from pa0002
into corresponding fields of p0002
where....
try this way and se..
10-21-2008 8:41 AM
the error may be because of your select, since pa0002 and p0002 is different in structures. so the fields will be shifted, so you get wrong data to p0002 structure.
select * from pa0002 into corresponding fields of p0002 where....
try this way and se..
Now I get "Infotype does not exist" :-s
10-21-2008 9:08 AM
HR_MAINTAIN_MASTERDATA if you open and see the definiton of this function module then you can observer that all the import parameters are OPTIONAL Either you can send or you may not but what evr the values that you pass those values are considered and its default INFOTYPE ACTION is INSERT all you have to write MOD and coming to the tables part it is mandartory to pass the PROPOSED_VALUES it is of type structure PROP so all you need to pass is the field name(FNAME) and fieldvalue(FVAL)
I've tried it this way and it works 😄
Thanks.
10-21-2008 9:08 AM
pass infotype number to the P0002 structure.
P0002-INFTY = '0002'. "mention this also..
02-10-2011 2:40 PM
10-21-2008 5:58 AM
Hi
Check how are you passing the PERNR to the fucntion module , PERNR size is 8 Numerics you need to pass the PERNR in the same format like this '00012348'.
Regards
Pavan
10-21-2008 7:22 AM
Check how are you passing the PERNR to the fucntion module , PERNR size is 8 Numerics you need to pass the PERNR in the same format like this '00012348'.
I'm passing it as type P0002-pernr and this is 8 numeric...
I have no clue what I'm doing wrong...
10-21-2008 7:31 AM
Hi
Try to use the Function module HR_MAINTAIN_MASTERDATA
Regards
Pavan
10-21-2008 8:06 AM
Hi,
*****************************************
DATA: P0002 like p0002 occurs 0 with header line.
DATA: RC1 TYPE BAPIRETURN1.
DATA: RC3 TYPE BAPIRETURN1.
data: pernr type pa0002-pernr.
P0002-NACHN = 'NACHN'.
P0002-VORNA = 'VORNA'.
P0002-GESCH = 'GESCH'.
P0002-GBDAT = 'GBDAT'.
P0002-PERID = '00000001'.
pernr = '00000001'.
*Lock Employee
*----
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = PERNR
IMPORTING
return = RC3.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0002'
NUMBER = PERNR
SUBTYPE =
OBJECTID =
LOCKINDICATOR =
VALIDITYEND = '99991231'
VALIDITYBEGIN = '19780625'
RECORDNUMBER =
RECORD = P0002
OPERATION = 'MOD'
TCLAS = 'A'
DIALOG_MODE = '0'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
RETURN = RC1
KEY =
.
*Unlock Employee
*----
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = PERNR.
****************************************
This code is working fine.
Regards,
Syed
10-21-2008 8:16 AM
I still get the "Fill in the required entry fields" with this code
DATA: P0002 like p0002 occurs 0 with header line.
DATA: RC1 TYPE BAPIRETURN1.
DATA: RC3 TYPE BAPIRETURN1.
data: pernr type pa0002-pernr.
P0002-NACHN = 'NACHN'.
P0002-VORNA = 'VORNA'.
P0002-GESCH = 'GESCH'.
P0002-GBDAT = 'GBDAT'.
P0002-PERID = '00000001'.
pernr = '00000001'.
*Lock Employee
*-------------
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = PERNR
IMPORTING
return = RC3.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0002'
NUMBER = PERNR
VALIDITYEND = '99991231'
VALIDITYBEGIN = '19780625'
RECORD = P0002
OPERATION = 'MOD'
IMPORTING
RETURN = RC1
*Unlock Employee
*---------------
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = PERNR.