Thursday, 25 January 2024

IW32 Change User Status SVO - BDC

 


wait up to seconds.

  data objnr like  jsto-objnr.
  data stat like    jstat-stat.
  data  t_stone like  tj30-stonr.

  concatenate 'OR' g_aufnr into objnr.
  stat 'E0018'.

  call function 'STATUS_CHANGE_EXTERN'
    exporting
*   CHECK_ONLY                = ' '
     client                    sy-mandt
      objnr                     objnr
      user_status               stat
      set_inact                 'X'
*   SET_CHGKZ                 =
*   NO_CHECK                  = ' '
   importing
     stonr                     t_stone
* EXCEPTIONS
*   OBJECT_NOT_FOUND          = 1
*   STATUS_INCONSISTENT       = 2
*   STATUS_NOT_ALLOWED        = 3
*   OTHERS                    = 4
            .
  if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

  call function 'BAPI_TRANSACTION_COMMIT'
    exporting
      wait 'X'.

  wait up to seconds.

No comments:

Post a Comment

Visitor

Code Syntax Try...Endtry

  Code : Report Try. Parameters  NUMBER  type  I . data  RESULT  type  P  decimals  2 . data  OREF  type  ref  to  CX_ROOT . data  TEXT  typ...