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

Creating new Infotype

Former Member
0 Likes
505

I created a new infotype 9015. It works and posts correctly. Then I tried adding a module within the 9015 code to generate an infotype 0014. So the end result should be a 9015 and a 0014 record. While Im in PA30 I can see the expected results but if I leave PA30 and come back in the records are gone. Looks like some type of commit issue but I have tried adding code to COMMIT and it doesnt help.

Here is the additional IT0014 code.

move GV_RETIRE-wage_type_ee to gt_pa0014-SUBTY.

move GV_RETIRE-wage_type_ee to gt_pa0014-LGART.

move GV_RETIRE-ee_percent to gt_pa0014-ANZHL.

move p9015-endda to gt_pa0014-endda.

move p9015-begda to gt_pa0014-begda.

move p9015-pernr to gt_pa0014-pernr.

move '0014' to gt_pa0014-INFTY.

Append gt_pa0014.

CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = p9015-pernr

IMPORTING

RETURN = gt_return.

  • CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'

  • EXPORTING

  • NUMBER = p9015-pernr

  • VALIDITYBEGIN = p9015-begda

  • IMPORTING

  • RETURN = gt_return.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = gt_pa0014-INFTY

number = gt_pa0014-pernr

subtype = gt_pa0014-subty

validityend = gt_pa0014-endda

validitybegin = gt_pa0014-begda

record = gt_pa0014

operation = 'INS'

tclas = 'A'

dialog_mode = '0'

nocommit = ''

IMPORTING

return = lstr_bapireturn

key = lstr_bapikey.

IF NOT lstr_bapireturn-number = 0.

lv_bapierror = lstr_bapireturn-message.

lv_failed = abap_true.

ENDIF.

  • CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'

  • EXPORTING

  • NUMBER = p9015-pernr

  • VALIDITYBEGIN = p9015-begda

  • IMPORTING

  • RETURN = gt_return.

CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = p9015-pernr

IMPORTING

RETURN = gt_return.

CALL FUNCTION 'RH_UPDATE_DATABASE'

EXPORTING

VTASK = 'V'.

commit work.

I created a new infotype 9015. It works and posts correctly. Then I tried adding a module within the 9015 code to generate an infotype 0014. So the end result should be a 9015 and a 0014 record. While Im in PA30 I can see the expected results but if I leave PA30 and come back in the records are gone. Looks like some type of commit issue but I have tried adding code to COMMIT and it doesnt help.

Here is the additional IT0014 code.

move GV_RETIRE-wage_type_ee to gt_pa0014-SUBTY.

move GV_RETIRE-wage_type_ee to gt_pa0014-LGART.

move GV_RETIRE-ee_percent to gt_pa0014-ANZHL.

move p9015-endda to gt_pa0014-endda.

move p9015-begda to gt_pa0014-begda.

move p9015-pernr to gt_pa0014-pernr.

move '0014' to gt_pa0014-INFTY.

Append gt_pa0014.

CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = p9015-pernr

IMPORTING

RETURN = gt_return.

  • CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'

  • EXPORTING

  • NUMBER = p9015-pernr

  • VALIDITYBEGIN = p9015-begda

  • IMPORTING

  • RETURN = gt_return.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = gt_pa0014-INFTY

number = gt_pa0014-pernr

subtype = gt_pa0014-subty

validityend = gt_pa0014-endda

validitybegin = gt_pa0014-begda

record = gt_pa0014

operation = 'INS'

tclas = 'A'

dialog_mode = '0'

nocommit = ''

IMPORTING

return = lstr_bapireturn

key = lstr_bapikey.

IF NOT lstr_bapireturn-number = 0.

lv_bapierror = lstr_bapireturn-message.

lv_failed = abap_true.

ENDIF.

  • CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'

  • EXPORTING

  • NUMBER = p9015-pernr

  • VALIDITYBEGIN = p9015-begda

  • IMPORTING

  • RETURN = gt_return.

CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = p9015-pernr

IMPORTING

RETURN = gt_return.

CALL FUNCTION 'RH_UPDATE_DATABASE'

EXPORTING

VTASK = 'V'.

commit work.

1 REPLY 1
Read only

suresh_datti
Active Contributor
0 Likes
441

You can try to split the update tasks ie Put the 0014 logic inside a custom function module.. make sure to set the 'Update Module' Processing Type in its Attributes. & then call this custom function IN UPDATE TASK fom 9015.

~Suresh