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

Insert record in HRP1008

Former Member
0 Likes
1,513

Hello,

I'm trying to insert a record in hrp1008 for a position (code below)

GOAL: copy bukrs and persa (and brtrl) from a specific org. unit

sy-subrc = 2

Can anyone help me with this one?

Thanks.

SELECT *
  INTO corresponding fields of it1008
  FROM HRP1008
  WHERE OTYPE = 'O' AND OBJID = Orgunitid AND PLVAR = '01'.
endselect.

clear it1008a.
it1008a-MANDT = it1008-MANDT.
it1008a-plvar = '01'.
it1008a-OTYPE = 'S'.
it1008a-OBJID = OBJ.
it1008a-istat = '1'.
it1008a-BEGDA = begda.
it1008a-endda = endda.
it1008a-infty = '1008'.
it1008a-BUKRS = it1008-BUKRS.
it1008a-PersA = it1008-PERSA.
it1008a-BTRTL  = it1008-BTRTL.
append it1008a.

call function 'RH_INSERT_INFTY'
EXPORTING
  fcode = 'INSE'
  vtask = 'D'
TABLES
  innnn = it1008a
EXCEPTIONS
  no_authorization = 1
  error_during_insert = 2
  repid_form_initial = 3
  corr_exit = 4
  begda_greater_endda = 5
  others = 6.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
1,166

Please check your authorisation. If you look into the exceptions tab you can see "Error during Insert" = sy-subrc 2 is "No authorisation".

Please put a break point in form INSERT_INFTY in Include LRHAPF0Z and check

Please check your authorisation. If you look into the exceptions tab you can see "Error during Insert" = sy-subrc 2 is "No authorisation".

Please put a break point in form INSERT_INFTY in Include LRHAPF0Z and check

5 REPLIES 5
Read only

Former Member
0 Likes
1,166

nobody?

Read only

former_member194669
Active Contributor
0 Likes
1,167

Please check your authorisation. If you look into the exceptions tab you can see "Error during Insert" = sy-subrc 2 is "No authorisation".

Please put a break point in form INSERT_INFTY in Include LRHAPF0Z and check

Read only

0 Likes
1,166

Isn't no_authorization sy-subrc = 1???

Read only

0 Likes
1,166

@Tarangini: The fm & Class you mentioned are for PA Infotypes & cannot be used for HRP1008 which is a PD Infotype.. hope you know the difference..

@Ilse:

Insert the following statement after clear it1008wa.

it1008wa = it1008.

~Suresh

Read only

tarangini_katta
Active Contributor
0 Likes
1,166

Hi,

Use this

Function Module.

HR_INFOTYPE_OPERATION

or

Classe

CL_HRPA_INFOTYPE_NNNN

It may solve u r pblm.

Thanks