Application Development 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: 

Infotype data insert problem

Former Member
0 Kudos

Hi Experts,

I have created an Infotype(IT9009).

I am trying to insert a record in this infotype(IT9009) using HR_INFOTYPE_OPERATION

Function module. here all fileds data has been inserted except only one field ie., Action field.

If i include the Action field the following message would be displayed.

No data stored for Separation in the selected period

Message no. PG009

if i did not include the field data the new record will be inserted.

Could you please let me know soultion to my problem ?

My Code :

DATA : lt_p9009 TYPE TABLE OF p9009,

wa_p9009 TYPE p9009,

wa_bapireturn LIKE bapireturn1,

lt_key LIKE bapipakey.

wa_p9009-pernr = '40000014'.

wa_p9009-begda = '20080901'.

wa_p9009-resign_initiated = 'X'.

wa_p9009-sepation_type = 'Resignaion'.

wa_p9009-ardate = '20081030'.

wa_p9009-ecomments = 'Please approve my resignation Request'.

wa_p9009-rrdate = '20081005'.

wa_p9009-reason = 'Career Growth'.

wa_p9009-ACTION = 'relieved'.

wa_p9009-RMANAGER = '40000007'.

wa_p9009-RMNAME = 'Prabhu Arumugam'.

wa_p9009-RMRRDATE = '20081005'.

wa_p9009-RCOMMENTS = 'Approved' .

wa_p9009-AMANAGER = '40000001'.

wa_p9009-AMNAME = 'Raja'.

wa_p9009-AMRDATE = '20081015'.

wa_p9009-ACOMMENTS = 'Yes. Approved'.

wa_p9009-HMANAGER = '40000004'.

wa_p9009-HRMNAME = 'Balamanikandan'.

wa_p9009-HRMRDATE = '20081015'.

wa_p9009-HCOMMENTS = 'Employee Retained'.

APPEND wa_p9009 TO lt_p9009.

  • If not P9009 is INITIAL.

LOOP AT lt_p9009 INTO wa_p9009.

CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'

EXPORTING

number = wa_p9009-pernr

IMPORTING

return = wa_bapireturn.

IF wa_bapireturn-number = '000'.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '9009'

number = wa_p9009-pernr

  • SUBTYPE = '2'

  • VALIDITYEND = '20080817' "'20080821'

validitybegin = wa_p9009-begda "

  • RECORDNUMBER =

record = wa_p9009 "lt_p9009

operation = 'INS'

tclas = 'A'

dialog_mode = '1'

IMPORTING

return = wa_bapireturn

key = lt_key

.

ENDIF.

CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'

EXPORTING

number = wa_p9009-pernr

IMPORTING

return = wa_bapireturn.

ENDLOOP.

Thanks in advance,

Regards,

Sivakumar.A

10 REPLIES 10

Former Member
0 Kudos

Hi,

Make sure that the action is already exist.

If not,Insert the action in the Action base table first,And then try to work as usual.

Regards,

Rama.

0 Kudos

Hi,

My PA9009 table has following fields.

h2 PA9009

.INCLUDE PS9009 STRU 0

RESIGN_INITIATED CHAR1 CHAR 1

SEPATION_TYPE TEXT20 CHAR 20

ARDATE KONDT DATS 8

ECOMMENTS CHAR200 CHAR 200

RRDATE KONDT DATS 8

REASON CHAR50 CHAR 50

ACTION TEXT20 CHAR 20

RMANAGER PERSNO NUMC 8

RMNAME EMNAM CHAR 40

RMRRDATE KONDT DATS 8

RCOMMENTS CHAR200 CHAR 200

AMANAGER PERSNO NUMC 8

AMNAME EMNAM CHAR 40

AMRDATE KONDT DATS 8

ACOMMENTS CHAR200 CHAR 200

HMANAGER PERSNO NUMC 8

HRMNAME EMNAM CHAR 40

HRMRDATE KONDT DATS 8

HCOMMENTS CHAR200 CHAR 200

Regards,

Sivakumar.A

Former Member
0 Kudos

Hi ,

Modify ur code as:-

IF wa_bapireturn-number = '000'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '9009'
number = wa_p9009-pernr


SUBTYPE = '2' 
VALIDITYEND = '20080817' "'20080821' 
validitybegin = wa_p9009-begda "

RECORDNUMBER = 
record = wa_p9009 "lt_p9009
operation = 'INS'
tclas = 'A'
dialog_mode = '1'
IMPORTING
return = wa_bapireturn
key = lt_key
.
ENDIF.

DATA : lt_p9009 TYPE TABLE OF p9009,
wa_p9009 TYPE p9009,
wa_bapireturn LIKE bapireturn1,
lt_key LIKE bapipakey.

wa_p9009-pernr = '40000014'.
wa_p9009-begda = '20080901'.

wa_p9009-resign_initiated = 'X'.
wa_p9009-sepation_type = 'Resignaion'.
wa_p9009-ardate = '20081030'.
wa_p9009-ecomments = 'Please approve my resignation Request'.
wa_p9009-rrdate = '20081005'.
wa_p9009-reason = 'Career Growth'.

wa_p9009-ACTION = 'relieved'.


wa_p9009-RMANAGER = '40000007'.
wa_p9009-RMNAME = 'Prabhu Arumugam'.
wa_p9009-RMRRDATE = '20081005'.
wa_p9009-RCOMMENTS = 'Approved' .

wa_p9009-AMANAGER = '40000001'.
wa_p9009-AMNAME = 'Raja'.
wa_p9009-AMRDATE = '20081015'.
wa_p9009-ACOMMENTS = 'Yes. Approved'.

wa_p9009-HMANAGER = '40000004'.
wa_p9009-HRMNAME = 'Balamanikandan'.
wa_p9009-HRMRDATE = '20081015'.
wa_p9009-HCOMMENTS = 'Employee Retained'.

APPEND wa_p9009 TO lt_p9009.



If not P9009 is INITIAL. 
LOOP AT lt_p9009 INTO wa_p9009.

CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = wa_p9009-pernr
IMPORTING
return = wa_bapireturn.



CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = wa_p9009-pernr
IMPORTING
return = wa_bapireturn.
ENDLOOP.

Luck,

Bhumika

0 Kudos

Dear Bhumika,

Thank you for your reply. I am getting the same message still

( No data stored for Separation in the selected period).

my record is not inserted into PA9009. if the action filed added in wrok area.

could you please give any other suggestion ?

Regards,

Sivakumar.A

Former Member
0 Kudos

HI,

Please check the start and end date in pa30 for the employee..It seems some data has to be maintained to process.

-Bhumika

0 Kudos

hi,

I checked in PA30.

The employee(40000013)

Start date 2008.07.01

Endda 9999.12.31

Regards,

Sivakumar.A

Former Member
0 Kudos

Siva,

Actually,i was working on some object & was getting the same error.On checking with the functional guy,i found that some data has to be maintained in pa30,which was missing.

Please tell me what do you have in Infotype 9009(i think it is a customised infotype).

Luck,

Bhumika

0 Kudos

hi Bhumika,

This a custom infotype which was created by me for Exit interview process.

Regards,

Sivakumar.A

Former Member
0 Kudos

Siva,

Please check with the functional guy & see what is going wrong.

-Bhumika

0 Kudos

Hi ,

Please check the time constraints for the infotype created.

This might be the reason for not accepting the complete data.

not sure even though