Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Infotype MOD operation.

Former Member
0 Likes
1,073

Hi all.

I am using HR_INFOTYPE_OPERATION to delimit the record in my infotype.. I want to modify the ENDDA = sy-datum - 1 in the existing record... But that FM is itself is not working.... is there any alternative to this FM?? Please reply me.. Its very urgent..

My code..

l_enddate = sy-datum - 1.

wa_read_pernr-endda = l_enddate.

CLEAR ls_return.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '9035'

number = wa_read_pernr-pernr

subtype = wa_read_pernr-subty

objectid = wa_read_pernr-objps

lockindicator = wa_read_pernr-sprps

validityend = enddate

validitybegin = wa_read_pernr-begda

recordnumber = wa_read_pernr-seqnr

record = wa_read_pernr

operation = 'MOD'

tclas = 'A'

dialog_mode = dialog_mode

nocommit = space

IMPORTING

return = ls_return

key = wa_key.

4 REPLIES 4
Read only

Former Member
0 Likes
654

Hi Elan,

1. When calling the FM, in the parameter enddate,

make sure you are passing the OLD/EXISTING value

(which is there in the PA table)

for the ENDDA field.

2. I also assume you are locking the employee before

calling this FM.

one sample code as below :

3.



Report abc.



*----------------- Data
DATA : P0015 LIKE P0015.
DATA : RETURN LIKE BAPIRETURN1.
DATA : KEY LIKE BAPIPAKEY.
DATA : RETURNE LIKE BAPIRETURN1 .

*------------- Values (Change as per Requirement)

P0015-PERNR = '1'.
P0015-BEGDA = '2061101'.
P0015-ENDDA = '2061101'.
P0015-LGART = '3075'.
P0015-PREAS = '01'.
P0015-WAERS = 'INR'.
P0015-BETRG = '2500'.


*----- First Enqu

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = p0015-pernr
IMPORTING
RETURN = RETURNE.


*------------- Update

CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0015'
NUMBER = P0015-PERNR
SUBTYPE = P0015-SUBTY
OBJECTID = P0015-OBJPS
LOCKINDICATOR = P0015-SPRPS
VALIDITYEND = P0015-ENDDA
VALIDITYBEGIN = P0015-BEGDA
RECORDNUMBER = P0015-SEQNR
RECORD = P0015
OPERATION = 'INS'
TCLAS = 'A'
DIALOG_MODE = '0'
IMPORTING
RETURN = RETURN
KEY = KEY.

IF RETURN IS NOT INITIAL.
WRITE :/ 'Error Occurred'.
ENDIF.

*--------- Dequeue
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = P0015-PERNR
.

regards,

amit m.

Read only

0 Likes
654

Thanku for ur reply.

Ya. I am locking the PERNR.

I checked for the existing value(validity begin) in the Infotype.

Every thing i have cheked!

In my program i am using READ_INFOTYPE func Mod. here i can retrieve the data into one itab.. but when i go to debug mode inside HR_INFOTYPE_OPERATION, standard READ_INFOTYPE is not retreiving my data..

ie. The parameter SELTAB (debug mode inside that FM).. is not filled. I dont know why? Please help me to come out of this problem.. its very urgent.. give u full points...

I am getting error message like.. No data updated to Table for the selected period range.

Read only

0 Likes
654

Hi again,

1. The reason why the infotype is not able

to read the existing record is bcos (probably)

the values which we have supplied to the FM

as export parameters, do not match

with the values in the table.

2. Make sure, ALL VALUES are as per existing record.

infty = '9035'

number = wa_read_pernr-pernr

subtype = wa_read_pernr-subty

objectid = wa_read_pernr-objps

lockindicator = wa_read_pernr-sprps

validityend = enddate <----


validitybegin = wa_read_pernr-begda

recordnumber = wa_read_pernr-seqnr

record = wa_read_pernr

3. Can u tell which error you are getting.

regards,

amit m.

Read only

b_deterd2
Active Contributor
0 Likes
654

Hi,

The FM is correct but you can't change the end date with MOD.

You can create a new record with INS. The end date of the previous record is the changed to the startdate of the new record.

Regards,

Bert