Skip to Content
0
Jul 15, 2008 at 01:23 PM

VTASK problem in RH_UPDATE_DATABASE

848 Views

Hi Experts,

I'm using RH_OBJECT_CREATE to create new position and RH_RELATION_WRITE to create relation of position to Org.Unit and using RH_UPDATE_DATABASE after both...but using VTASK as 'S'.

This is not showing any exception but sends a SAP Mail as 'Update was terminated '...same happens if i use VTASK as 'V'.

It creates all object if I use VTASK as 'B' but doesnt update in database, 'D' updates the database, but I want to trigger this process in Background..

Please Help..Please check my below code if I'm wrong somewhere. Thanks

CALL FUNCTION 'RH_OBJECT_CREATE'

EXPORTING

LANGU = SY-LANGU

PLVAR = '01'

OTYPE = 'S'

  • EXT_NUMBER = '00000000'

SHORT = SHORT

STEXT = STEXT

BEGDA = BEGDA

ENDDA = '99991231'

  • OSTAT = '1'

VTASK = 'B'

  • GUID =

  • KEEP_LUPD = ' '

IMPORTING

OBJID = OBJID

EXCEPTIONS

TEXT_REQUIRED = 1

INVALID_OTYPE = 2

INVALID_DATE = 3

ERROR_DURING_INSERT = 4

ERROR_EXT_NUMBER = 5

UNDEFINED = 6

OTHERS = 7

.

RELATION-MANDT = SY-MANDT.

RELATION-PLVAR = '01'.

RELATION-BEGDA = BEGDA.

RELATION-ENDDA = '99991231'.

RELATION-INFTY = '1001'.

RELATION-ISTAT = '1'.

RELATION-RELAT = '003'.

RELATION-RSIGN = 'A'.

RELATION-OTYPE = 'S'.

RELATION-OBJID = OBJID.

RELATION-SCLAS = 'O'.

RELATION-SOBID = SOBID.

RELATION-VARYF(2) = 'O '.

RELATION-VARYF+2(8) = SOBID.

APPEND RELATION.

CALL FUNCTION 'RH_RELATION_WRITE'

EXPORTING

VTASK = 'B'

TABLES

RELATION = RELATION

EXCEPTIONS

NO_AUTHORITY = 1

RELATION_NOT_ALLOWED = 2

OBJECT_NOT_FOUND = 3

WRONG_DATE_FORMAT = 4

TIME_NOT_VALID = 5

ERROR_DURING_INSERT = 6

UNDEFINED = 7

OTHERS = 8.