Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[ABAP] Modify Infotype

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
METHOD operate_it.
 
    DATA ls_return TYPE bapireturn1.
    DATA key       TYPE bapipakey.
 
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
      EXPORTING
        number = is_2002-pernr
      IMPORTING
        return = ls_return.
    IF ls_return IS NOT INITIAL.
      RAISE EXCEPTION TYPE zcx_xxx MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number.
    ENDIF.
 
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        infty         = '2002'
        number        = is_2002-pernr
        subtype       = is_2002-subty
        objectid      = is_2002-objps
        lockindicator = is_2002-sprps
        validityend   = is_2002-endda
        validitybegin = is_2002-begda
        recordnumber  = is_2002-seqnr
        record        = is_2002_chg
        operation     = iv_actio          "MOD,INS,DEL
        tclas         = 'A'
        dialog_mode   = '0'
      IMPORTING
        return        = ls_return
        key           = key.
    IF ls_return IS NOT INITIAL.
      RAISE EXCEPTION TYPE zcx_xxx MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number.
    ENDIF.
 
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
      EXPORTING
        number = is_2002-pernr.
 
ENDMETHOD.

Leave a Reply

Your email address will not be published. Required fields are marked *