Application Development 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: 

RH_INSERT_INFTY

Former Member
0 Kudos

Hello Gurus,

I have created a new position for Infotype HRP1000 with function RH_OBJECT_CREATE, then I relate this new position with the employee using function RH_INSERT_INFTY.


So I have what can be see in the picture attached.

thanks a lot.

DATA: li_position TYPE HRP1000-OBJID.

CALL FUNCTION 'RH_OBJECT_CREATE'

  EXPORTING

   LANGU                      = SY-LANGU

    PLVAR                     = '01'

    OTYPE                     = 'S'

*   EXT_NUMBER                = '00000000'

    SHORT                      = 'JEFE'

    STEXT                     = 'JEFEDES'

    BEGDA                     = SY-DATUM

    ENDDA                     = '99991231'

    OSTAT                     = '1'

    "VTASK                     = 'D'

*   GUID                      =

*   KEEP_LUPD                 = ' '

IMPORTING

   OBJID                     = li_position

* EXCEPTIONS

*   TEXT_REQUIRED             = 1

*   INVALID_OTYPE             = 2

*   INVALID_DATE              = 3

*   ERROR_DURING_INSERT       = 4

*   ERROR_EXT_NUMBER          = 5

*   UNDEFINED                 = 6

*   OTHERS                    = 7

          .

ls_new_p1001-otype  = 'P'.
ls_new_p1001-objid  = '65000083'.
ls_new_p1001-plvar  = '01'.
ls_new_p1001-rsign  = 'B'.
ls_new_p1001-relat  = '008'.
ls_new_p1001-istat  = '1'.
"ls_new_p1001-begda  = sy-datum.
ls_new_p1001-endda  = sy-datum - 1.
ls_new_p1001-varyf  = 'S 503819 74'.
ls_new_p1001-infty  = '1001'.
ls_new_p1001-sclas  = 'S'.
ls_new_p1001-sobid  = "li_position.
ls_new_p1001-prozt  = '100'.
APPEND ls_new_p1001 TO lt_new_p1001.

   CALL FUNCTION 'RH_INSERT_INFTY'
  EXPORTING
    vtask               = 'S'
    commit_flg          = 'X'
  TABLES
    innnn               = lt_new_p1001
  EXCEPTIONS
    no_authorization    = 1
    error_during_insert = 2
    repid_form_initial  = 3
    corr_exit           = 4
    begda_greater_endda = 5
    OTHERS              = 6.
   IF sy-subrc <> 0.
  WRITE: / sy-subrc .
   ENDIF.
*ENDIF.

3 REPLIES 3

former_member194739
Active Participant
0 Kudos

Dear Enrique,

What is your exact requirement or any issue?

Regards,

Abbas.

0 Kudos

Hi,

Thanks for answer, My requeriment is, the user has a file Excel with all the new positions for all employee, I have made a program that créate the new positions and also make a relation ship between the employee with the new position.

The only thing that I pending to do is to finish with ennda date the previous position (in the screen attached there are two entries, the last one is the new one position I have created), both have the endda date 31.12.9999


thanks for your time .

0 Kudos

BDC would help here with no issues.

However if you continiue with your approach, try to delimit the existing 008 first with FM RH_CUT_INFTY  and then update A008 using your FM or RH_RELATION_MAINTAIN.