cancel
Showing results for 
Search instead for 
Did you mean: 

updating HRP tables

Former Member
0 Kudos

Can anybody tell me is there any standard FM to update the HR tables :

HRP1048, HRP1002,HRP1001,HRP1000 efficiently?

I have to delimit and delete the records and I dont want to do direct update on HR tables.

thanks

Tanisha

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

The best way is a batch input in PP02 transaction. These tables are infotype tables.

When you update one infotype not only update his table ,also update other infotypes or tables

shafiq_rehman3
Active Contributor
0 Kudos

You can use 'RH_OBJECT_CREATE' to create a new object & 'RH_RELATION_MAINTAIN' to create relationships for that object.

To delete, try these FMs:

RH_OBJECT_DELETE

RH_DELETE_INFTY_DIRECT

Former Member
0 Kudos

Tanisha,

1.Use the FM RH_RELATION_MAINTAIN to maintain HRP1001-Relationship.

Change the FCODE to do various options such as create,delete,display,delimit etc.,

For eg.,

*Relate account to project

IF WA_MAINTAIN-OTYPE = 'O' AND WA_MAINTAIN-SCLAS = 'O'.

WA_MAINTAIN-RSIGN = 'B'.

WA_MAINTAIN-RELAT = '002'.

*Relate position to project

ELSEIF WA_MAINTAIN-OTYPE = 'O' AND WA_MAINTAIN-SCLAS = 'S'.

WA_MAINTAIN-RSIGN = 'B'.

WA_MAINTAIN-RELAT = '003'.

*Relate job to position

ELSEIF WA_MAINTAIN-OTYPE = 'S' AND WA_MAINTAIN-SCLAS = 'C'.

WA_MAINTAIN-RSIGN = 'B'.

WA_MAINTAIN-RELAT = '007'.

*Relate employee to position

ELSEIF WA_MAINTAIN-OTYPE = 'S' AND WA_MAINTAIN-SCLAS = 'P'.

WA_MAINTAIN-RSIGN = 'A'.

WA_MAINTAIN-RELAT = '008'.

ENDIF.

WA_MAINTAIN-ENDDA = '99991231'.

*FM to create relationship

CALL FUNCTION 'RH_RELATION_MAINTAIN'

EXPORTING

ACT_FCODE = WA_MAINTAIN-FCODE

ACT_PLVAR = WA_MAINTAIN-PLVAR

ACT_OTYPE = WA_MAINTAIN-OTYPE

ACT_OBJID = WA_MAINTAIN-OBJID

ACT_ISTAT = WA_MAINTAIN-ISTAT

ACT_RSIGN = WA_MAINTAIN-RSIGN

ACT_RELAT = WA_MAINTAIN-RELAT

ACT_SCLAS = WA_MAINTAIN-SCLAS

ACT_SOBID = WA_MAINTAIN-SOBID

ACT_BEGDA = WA_MAINTAIN-BEGDA

ACT_ENDDA = WA_MAINTAIN-ENDDA

ACT_PROZT = WA_MAINTAIN-PROZT

EXCEPTIONS

MAINTAINANCE_FAILED = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • WRITE : WA_INPUT-OBJID.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

2.Use the FM RH_OBJECT_CREATE for maintaing hrp1000-Object ID creation.

Use the FM RH_DELETE_OBJECT for deletion of object ID.

For eg.,

CALL FUNCTION 'RH_OBJECT_CREATE'

EXPORTING

LANGU = SY-LANGU

PLVAR = '01'

OTYPE = 'O'

SHORT = V_NEWPROJECT

STEXT = V_PROJECTDESC

BEGDA = V_DATE

ENDDA = '99991231'

IMPORTING

OBJID = W_OBJID

EXCEPTIONS

TEXT_REQUIRED = 1

INVALID_OTYPE = 2

INVALID_DATE = 3

ERROR_DURING_INSERT = 4

ERROR_EXT_NUMBER = 5

UNDEFINED = 6

OTHERS = 7.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards

Thyagu

Edited by: Thyagu on Sep 18, 2008 11:31 AM

Edited by: Thyagu on Sep 18, 2008 11:34 AM

Former Member
0 Kudos

Hi Tanisha,

What data would you like to delete ?