Quantcast
Channel: SCN: Message List - Security
Viewing all articles
Browse latest Browse all 5338

Re: Change log of field USERTYP

$
0
0

Hi Jaroslav

 

Sorry for late reply

 

Standard table USR06 change log is not there as there is no particular object maintained for recording log not allowed as technical settings. Below are some selected of US category for which you can search  change log.

USLA04

USR21

USRACL

USREFUS

USOBT

USOBX

USOBT_C

USOBX_C

USMD120C

USMD120C

USR41

 

Sorry, can't help with standard available

 

But I have checked there is one Program which you can add in your system and that will help to record the changes in future.

 

for your reference program code is as below.

 

REPORT  ZUSER_LICENSES_LOG.

TYPE-POOLS: ICON, ABAP, SLIS.

TABLES: ADCP,
        USR02,
        USR06,
        USR21,
        PA0002.

TYPES: BEGIN OF USER_TABLE,
         PERSNUMBER TYPE USR21-PERSNUMBER,
         BNAME      TYPE USR21-BNAME,
         VORNA      TYPE PA0002-VORNA,
         NACHN      TYPE PA0002-NACHN,
         LIC_TYPE   TYPE USR06-LIC_TYPE,
         FUNCTION   TYPE ADCP-FUNCTION,
         GLTGB      TYPE USR02-GLTGB,
         USTYP      TYPE USR02-USTYP,
         CLASS      TYPE USR02-CLASS,
         UFLAG      TYPE USR02-UFLAG,
         PWDSTATE   TYPE USR02-PWDSTATE,
         USRID      TYPE PA0105-USRID,
         PERNR      TYPE PA0105-PERNR,
         LICENSE_AX TYPE I,
         LICENSE_AY TYPE I,
         LICENSE_AZ TYPE I,
         LICENSE_BA TYPE I,
         LICENSE_BK TYPE I,
         LICENSE_OT TYPE I,
       END OF USER_TABLE.

DATA: IT_P2    TYPE STANDARD TABLE OF PA0002 WITH HEADER LINE,
      IT_P0105 TYPE STANDARD TABLE OF PA0105 WITH HEADER LINE,
      IT_TAB   TYPE TABLE OF USER_TABLE WITH HEADER LINE,
      WA_TAB   LIKE LINE OF IT_TAB,
      ITAB     TYPE TABLE OF USER_TABLE.

DATA: GR_ALV        TYPE REF TO CL_SALV_TABLE,
      GR_FUNCTIONS  TYPE REF TO CL_SALV_FUNCTIONS_LIST,
      GR_DISPLAY    TYPE REF TO CL_SALV_DISPLAY_SETTINGS,
      GR_COLUMNS    TYPE REF TO CL_SALV_COLUMNS_TABLE,
      GR_COLUMN     TYPE REF TO CL_SALV_COLUMN_TABLE,
      GR_LAYOUT     TYPE REF TO CL_SALV_LAYOUT,
      GR_SELECTIONS TYPE REF TO CL_SALV_SELECTIONS,
      GR_EVENTS     TYPE REF TO CL_SALV_EVENTS_TABLE,
      GR_LINES      TYPE REF TO CL_SALV_FORM_LAYOUT_GRID,
      G_LAYOUT      TYPE SALV_S_LAYOUT_INFO,
      KEY           TYPE SALV_S_LAYOUT_KEY,
      S_KEY         TYPE SALV_S_LAYOUT_KEY,
      COLOR         TYPE LVC_S_COLO,
      RIGHT_ALIGNED TYPE SALV_DE_ALIGNMENT,
      LARGE_HEAD    TYPE SALV_DE_HEADER_SIZE.

DATA: USER          TYPE SY-UNAME,
      USER_SALON    TYPE SY-UNAME,
      LIST_TITLE    TYPE LVC_TITLE VALUE 'Multiple UPC Codes per Article'.

INITIALIZATION.

  KEY = SY-REPID.
  RIGHT_ALIGNED = 2.   "1=left, 2=right, 3=centered. Must be TYPEd as SALV_DE_ALIGNMENT.
  USER = SY-UNAME+0(3).
  USER_SALON = SY-UNAME+3(4).

  SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-001.
  SELECT-OPTIONS S_BNAME FOR USR21-BNAME.
  SELECT-OPTIONS S_LTYPE FOR USR06-LIC_TYPE.
  SELECT-OPTIONS S_TERM  FOR USR02-GLTGB.
  PARAMETERS P_VARI TYPE SLIS_VARI.
  SELECTION-SCREEN END OF BLOCK BLOCK1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
  G_LAYOUT = CL_SALV_LAYOUT_SERVICE=>F4_LAYOUTS(
             S_KEY    = KEY
             RESTRICT = IF_SALV_C_LAYOUT=>RESTRICT_NONE ).
  P_VARI = G_LAYOUT-LAYOUT.


START-OF-SELECTION.

  SELECT USR21~PERSNUMBER USR21~BNAME USR06~LIC_TYPE ADCP~FUNCTION USR02~GLTGB
         USR02~USTYP USR02~CLASS USR02~UFLAG USR02~PWDSTATE "PA0105~USRID PA0105~PERNR
    INTO CORRESPONDING FIELDS OF TABLE IT_TAB
    FROM ( ( ( USR21
    INNER JOIN ADCP
            ON ADCP~PERSNUMBER EQ USR21~PERSNUMBER )
    INNER JOIN USR02
            ON USR02~BNAME  EQ USR21~BNAME )
    INNER JOIN USR06
            ON USR06~BNAME  EQ USR21~BNAME )
*    INNER JOIN PA0105
*            ON PA0105~USRID EQ USR21~BNAME )
    WHERE USR21~BNAME       IN S_BNAME
      AND USR06~LIC_TYPE    IN S_LTYPE
      AND USR02~GLTGB       IN S_TERM.

  IF SY-SUBRC = 0.

    SORT IT_TAB BY BNAME LIC_TYPE ASCENDING.

    CLEAR ITAB.
    CLEAR WA_TAB.

    LOOP AT IT_TAB INTO WA_TAB.

      SELECT SINGLE * FROM PA0105
        INTO IT_P0105
        WHERE USRID = WA_TAB-BNAME.

      IF SY-SUBRC = 0.
        WA_TAB-PERNR = IT_P0105-PERNR.
      ENDIF.

      SELECT SINGLE * FROM PA0002
        INTO IT_P2
        WHERE PERNR EQ WA_TAB-PERNR
        AND ENDDA EQ '99991231'.

      IF SY-SUBRC = 0.
        WA_TAB-VORNA = IT_P2-VORNA.
        WA_TAB-NACHN = IT_P2-NACHN.
      ENDIF.

      CASE WA_TAB-LIC_TYPE.
        WHEN 'AX'.
          WA_TAB-LICENSE_AX = WA_TAB-LICENSE_AX + 1.
        WHEN 'AY'.
          WA_TAB-LICENSE_AY = WA_TAB-LICENSE_AY + 1.
        WHEN 'AZ'.
          WA_TAB-LICENSE_AZ = WA_TAB-LICENSE_AZ + 1.
        WHEN 'BA'.
          WA_TAB-LICENSE_BA = WA_TAB-LICENSE_BA + 1.
        WHEN 'BK'.
          WA_TAB-LICENSE_BK = WA_TAB-LICENSE_BK + 1.
        WHEN OTHERS.
          WA_TAB-LICENSE_OT = WA_TAB-LICENSE_OT + 1.
      ENDCASE.

      APPEND WA_TAB TO ITAB.
      CLEAR WA_TAB.
    ENDLOOP.


    TRY.
        CL_SALV_TABLE=>FACTORY(
                   IMPORTING
                     R_SALV_TABLE = GR_ALV
                   CHANGING
                     T_TABLE = ITAB ).
      CATCH CX_SALV_NOT_FOUND.
      CATCH CX_SALV_MSG.
    ENDTRY.

    TRY.
        GR_FUNCTIONS = GR_ALV->GET_FUNCTIONS( ).
        GR_FUNCTIONS->SET_ALL( ABAP_TRUE ).
        GR_DISPLAY = GR_ALV->GET_DISPLAY_SETTINGS( ).
        GR_DISPLAY->SET_VERTICAL_LINES( ABAP_TRUE ).
        GR_DISPLAY->SET_HORIZONTAL_LINES( ABAP_TRUE ).
        GR_DISPLAY->SET_STRIPED_PATTERN( CL_SALV_DISPLAY_SETTINGS=>TRUE ).
      CATCH CX_SALV_NOT_FOUND.
      CATCH CX_SALV_MSG.
    ENDTRY.

    TRY.
        GR_DISPLAY->SET_LIST_HEADER( LIST_TITLE ).
        GR_COLUMNS = GR_ALV->GET_COLUMNS( ).
        GR_COLUMNS->SET_KEY_FIXATION( ABAP_TRUE ).
      CATCH CX_SALV_NOT_FOUND.
      CATCH CX_SALV_MSG.
    ENDTRY.

    TRY.
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'PERSNUMBER' ).
        GR_COLUMN->SET_LONG_TEXT( 'Person Number' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Pers#' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Pers#' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'BNAME' ).
        GR_COLUMN->SET_LONG_TEXT( 'Login Name' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Login Name' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Login' ).
        GR_COLUMN->SET_ALIGNMENT( RIGHT_ALIGNED ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'VORNA' ).
        GR_COLUMN->SET_LONG_TEXT( 'First Name' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'First Name' ).
        GR_COLUMN->SET_SHORT_TEXT( 'F. Name' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'NACHN' ).
        GR_COLUMN->SET_LONG_TEXT( 'Last Name' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Last Name' ).
        GR_COLUMN->SET_SHORT_TEXT( 'L. Name' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'LIC_TYPE' ).
        GR_COLUMN->SET_LONG_TEXT( 'License Type' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'License Type' ).
        GR_COLUMN->SET_SHORT_TEXT( 'License' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'FUNCTION' ).
        GR_COLUMN->SET_LONG_TEXT( 'Job Description' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Job Descr' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Job Desc' ).
        GR_COLUMN->SET_ALIGNMENT( RIGHT_ALIGNED ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'GLTGB' ).
        GR_COLUMN->SET_LONG_TEXT( 'Term Date' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Term Date' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Term' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'USTYP' ).
        GR_COLUMN->SET_LONG_TEXT( 'License Type' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'License Type' ).
        GR_COLUMN->SET_SHORT_TEXT( 'License' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'CLASS' ).
        GR_COLUMN->SET_LONG_TEXT( 'Class' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Class' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Class' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'UFLAG' ).
        GR_COLUMN->SET_LONG_TEXT( 'Login Staus' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Login Staus' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Login OK' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'PWDSTATE' ).
        GR_COLUMN->SET_LONG_TEXT( 'Password Status' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Pswd Status' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Pswd OK' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'USRID' ).
        GR_COLUMN->SET_LONG_TEXT( 'Employee Login' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Empl Login' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Empl.' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'PERNR' ).
        GR_COLUMN->SET_LONG_TEXT( 'Employee Number' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'Employee#' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Empl#' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'LICENSE_AX' ).
        GR_COLUMN->SET_LONG_TEXT( 'License AX' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'License AX' ).
        GR_COLUMN->SET_SHORT_TEXT( 'AX' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'LICENSE_AY' ).
        GR_COLUMN->SET_LONG_TEXT( 'License AY' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'License AY' ).
        GR_COLUMN->SET_SHORT_TEXT( 'AY' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'LICENSE_AZ' ).
        GR_COLUMN->SET_LONG_TEXT( 'License AZ' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'License AZ' ).
        GR_COLUMN->SET_SHORT_TEXT( 'AZ' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'LICENSE_BA' ).
        GR_COLUMN->SET_LONG_TEXT( 'License BA' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'License BA' ).
        GR_COLUMN->SET_SHORT_TEXT( 'BA' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'LICENSE_BK' ).
        GR_COLUMN->SET_LONG_TEXT( 'License BK' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'License BK' ).
        GR_COLUMN->SET_SHORT_TEXT( 'BK' ).
        GR_COLUMN ?= GR_COLUMNS->GET_COLUMN( COLUMNNAME = 'LICENSE_OT' ).
        GR_COLUMN->SET_LONG_TEXT( 'License Other' ).
        GR_COLUMN->SET_MEDIUM_TEXT( 'License Other' ).
        GR_COLUMN->SET_SHORT_TEXT( 'Other' ).

        GR_LAYOUT = GR_ALV->GET_LAYOUT( ).
        KEY-REPORT = SY-REPID.
        GR_LAYOUT->SET_KEY( KEY ).
        GR_LAYOUT->SET_SAVE_RESTRICTION( CL_SALV_LAYOUT=>RESTRICT_NONE ).
        IF NOT P_VARI IS INITIAL.
          GR_LAYOUT->SET_INITIAL_LAYOUT( VALUE = P_VARI   ).
        ENDIF.
        GR_ALV->DISPLAY( ).
      CATCH CX_SALV_NOT_FOUND.
      CATCH CX_SALV_MSG.
    ENDTRY.


  ENDIF.


Viewing all articles
Browse latest Browse all 5338

Trending Articles