Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

about to use HR_INFOTYPE_OPERATION to create customer infotype issue:

hi

i want to create infotype use function(HR_INFOTYPE_OPERATION).

this infotype is customer infotype.

the first scenario is:

i'm be sure no data about one employee in this infotype(9004).

to call with data upload function and put data into internal table IT_PA9004.

and the table data as follow:

one line: it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',

it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'

it_pa9004-zzvalue = 50 (customer field).

two line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',

it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'

it_pa9004-zzvalue = 60 (customer field).

three line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',

it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'

it_pa9004-zzvalue = 70 (customer field).

four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',

it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'

it_pa9004-zzvalue = 80 (customer field).

i run the programme and get information is:

11022887 insert ok.

11022887 insert ok.

11022887 insert ok.

11022887 insert ok.

but i use the transation PA30 to view all data:

in database just exist one row:

four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',

it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'

it_pa9004-zzvalue = 80 (customer field).

the second scenario is:

in database the infotype have exist one row:

pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',

pa9004-begda = '20080318' , pa9004-endda = '20080318'

pa9004-zzvalue = X (customer field).

and i create another row:

line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',

it_pa9004-begda = '20080318' , it_pa9004-endda = '99991231'

it_pa9004-zzvalue = 80 (customer field)

i run the programme and get information is:

11022887 insert ok.

the three scenario is:

set HR_INFOTYPE_OPERATION of import parameter operation = 'MOD'

in any scenario will get error :not exist subtype .

what heppend about HR_INFOTYPE_OPERATION working,i had to use this function to

create other infotype of SAP owner.

and will create successfully.

so i thank it may be config Constraints about customer infotype.

is time Constraints effect?

so i want to how to check it?

and if i want to create one infotype for customer using PM01 what some thing

must be taken into account.

think you advance.

partial source code as follow:

FORM ACTION_INSERT .

DATA: P_FLAG TYPE C.

DATA: WA_LOG LIKE LINE OF DATA_LOG.

DATA: PP_ACTION TYPE PSPAR-ACTIO.

LOOP AT IT_PA9004.

CLEAR P_FLAG.

CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.

PERFORM lock_employee USING IT_PA9004-pernr CHANGING P_FLAG.

PP_ACTION = IT_PA9004-ACTION.

PERFORM HR_INFOTYPE_OPERATION USING IT_PA9004 PP_ACTION CHANGING P_FLAG.

IF P_FLAG IS INITIAL.

if test_run = space.

COMMIT WORK.

else.

ROLLBACK WORK.

endif.

write:/ it_pa9004-pernr,'insert ok'.

ELSE.

ROLLBACK WORK.

write:/ it_pa9004-pernr,'error'.

ENDIF.

PERFORM unlock_employee USING IT_PA9004-pernr .

ENDLOOP.

ENDFORM. " ACTION_INSERT

FORM LOCK_EMPLOYEE USING P_PERNR

CHANGING PP_FLAG.

CHECK PP_FLAG IS INITIAL.

CLEAR P_RETURN.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

number = P_PERNR

IMPORTING

return = P_RETURN

EXCEPTIONS

OTHERS = 01.

CALL FUNCTION 'HR_INITIALIZE_BUFFER'

EXPORTING

pernr = P_PERNR.

IF P_RETURN IS NOT INITIAL.

PP_FLAG = '1'.

ENDIF.

ENDFORM. " LOCK_EMPLOYEE

FORM HR_INFOTYPE_OPERATION USING P_PA9004 LIKE IT_PA9004

P_ACTION type PSPAR-ACTIO

CHANGING PP_FLAG.

CHECK PP_FLAG IS INITIAL.

DATA: bapipakey type bapipakey,

P_SUBTY TYPE P9004-SUBTY,

PP_9004 TYPE TABLE OF P9004 WITH HEADER LINE.

CLEAR P_RETURN.

REFRESH PP_9004.

MOVE-CORRESPONDING P_PA9004 TO PP_9004.

IF P_ACTION = 'INS'.

PP_9004-AEDTM = SY-DATUM.

PP_9004-UNAME = SY-UNAME.

ENDIF.

IF P_ACTION = 'MOD'.

PP_9004-AEDTM = SY-DATUM.

PP_9004-UNAME = SY-UNAME.

ENDIF.

APPEND PP_9004.

P_SUBTY = P_LGART.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '9004'

  • subtype = 'FQ03'

subtype = P_SUBTY

number = PP_9004-pernr

validityend = PP_9004-ENDDA

validitybegin = PP_9004-begda

  • RECORDNUMBER = pp_9004-seqnr

record = PP_9004

operation = 'INS'

  • operation = P_ACTION

nocommit = 'X'

IMPORTING

return = P_RETURN

key = bapipakey

EXCEPTIONS

OTHERS = 0.

IF P_RETURN IS NOT INITIAL.

PP_FLAG = '9'.

ENDIF.

ENDFORM. " HR_INFOTYPE_OPERATION

FORM UNLOCK_EMPLOYEE USING P_PERNR.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

number = p_pernr

IMPORTING

return = P_RETURN

EXCEPTIONS

OTHERS = 01.

ENDFORM. " UNLOCK_EMPLOYEE

Former Member
Not what you were looking for? View more on this topic or Ask a question