This website is not affiliated with, sponsored by, or approved by SAP AG.

Dump "insert duprec" in SU01 [Solved]

SAP Security

Moderators: Snowy, thx4allthefish, jurjen

Dump "insert duprec" in SU01 [Solved]

Postby thx4allthefish » Thu Sep 19, 2013 3:33 am

Hello again, all - long time no see.

So, I had this dump "insert duprec" in SU01 when copying a user to an ID that had (at one point in time) existed, but was eventually deleted. Recreating the user is no longer possible since we have some major incosistencies on table ESDUS (personalization).

I opened a call at SAP :shock:

They pointed me to note note 1597172.... which itself points to note 197012 which delivers a correction report that mostly doesn't work, because:

Code: Select all
SELECT * FROM esdus INTO TABLE lt_data
           WHERE uname IN so_uname
             AND ( action LIKE 'MEPO%'                      "#EC *
                OR action LIKE 'MIGO%'                      "#EC *
                OR action LIKE 'MEOUT%'                     "#EC *
                OR action LIKE 'PurchaseOrder'              "#EC *
                OR action LIKE 'PurchaseRequisition'        "#EC *
                OR action LIKE 'OutlineAgreent' ).          "#EC *


that's what's coded, but you probably have entries in ESDUS with action AC03, MIRO, ME23N. ML81N ... just to name a few. So after several days of ping-pong with SAP they gave me another report. It covers all the possible actions, only NOW you can run it for just one user at a time.

Needless to say, I have 439 users that no longer exist in the system but still have personalization data in ESDUS.

Here's the coding of the report they don't give to you freely - working on one user at a time:

Code: Select all
*&---------------------------------------------------------------------*
*& Report  ZDELESDUS
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zzdelesdus_modified.

*--------------------------------------------------------------------*
* define types
*--------------------------------------------------------------------*
TYPE-POOLS icon.

TYPES:
type_v_icon TYPE c LENGTH 40,
type_t_data TYPE SORTED TABLE OF esdus WITH NON-UNIQUE KEY uname action.
TYPES:
BEGIN OF type_s_outtab,
icon TYPE type_v_icon,
uname TYPE esdus-uname,
action TYPE esdus-action,
element TYPE esdus-element,
active TYPE esdus-active,
END OF type_s_outtab.
TYPES:
type_t_outtab TYPE STANDARD TABLE OF type_s_outtab WITH DEFAULT KEY.
*--------------------------------------------------*
* define data objects
*--------------------------------------------------*
DATA: lv_green TYPE type_v_icon,
lv_red TYPE type_v_icon,
lv_info TYPE icont-quickinfo,
ls_outtab TYPE type_s_outtab,
lt_data TYPE type_t_data,
lt_outtab TYPE type_t_outtab,
lo_alv TYPE REF TO cl_salv_table,
lo_sort TYPE REF TO cl_salv_sorts,
lo_functions TYPE REF TO cl_salv_functions_list,
lo_columns TYPE REF TO cl_salv_columns,
lo_alv_top TYPE REF TO cl_salv_form_layout_grid.
FIELD-SYMBOLS:
<ls_data> TYPE esdus.
*--------------------------------------------------*
* define screen elements
*--------------------------------------------------*
SELECT-OPTIONS:
so_uname FOR sy-uname OBLIGATORY.
PARAMETERS:
p_test AS CHECKBOX DEFAULT 'X'.

START-OF-SELECTION.
* pre-conditions
  IF so_uname IS INITIAL.
    RETURN.
  ENDIF.
* create icons
  lv_info = 'Update successful'.                            "#EC *
  CALL FUNCTION 'ICON_CREATE'
    EXPORTING
      name                  = icon_green_light
      info                  = lv_info
    IMPORTING
      result                = lv_green
    EXCEPTIONS
      icon_not_found        = 0
      outputfield_too_short = 0
      OTHERS                = 0.
  lv_info = 'Update failed'.                                "#EC *
  CALL FUNCTION 'ICON_CREATE'
    EXPORTING
      name                  = icon_red_light
      info                  = lv_info
    IMPORTING
      result                = lv_red
    EXCEPTIONS
      icon_not_found        = 0
      outputfield_too_short = 0
      OTHERS                = 0.
*--------------------------------------------------*
* data base fetch
*--------------------------------------------------*
  SELECT * FROM esdus INTO TABLE lt_data
  WHERE uname IN so_uname.
*
  IF lines( lt_data ) GE 1.
* prepare data for display
    LOOP AT lt_data ASSIGNING <ls_data>.
      MOVE-CORRESPONDING <ls_data> TO ls_outtab.
      ls_outtab-icon = lv_green.
      INSERT ls_outtab INTO TABLE lt_outtab.
    ENDLOOP.
  ELSE.
    ls_outtab-icon = lv_red.
    ls_outtab-uname = sy-uname.
    INSERT ls_outtab INTO TABLE lt_outtab.
  ENDIF.
  IF p_test IS INITIAL.
    DELETE esdus FROM TABLE lt_data.
    COMMIT WORK.
  ENDIF.
  cl_salv_table=>factory( IMPORTING r_salv_table = lo_alv
  CHANGING t_table = lt_outtab ).
  lo_functions = lo_alv->get_functions( ).
  lo_functions->set_default( abap_false ).
  lo_columns = lo_alv->get_columns( ).
  lo_columns->set_optimize( abap_true ).
  lo_sort = lo_alv->get_sorts( ).
  lo_sort->add_sort( 'UNAME' ).                             "#EC *
  lo_sort->add_sort( 'ACTION' ).                            "#EC *
  CREATE OBJECT lo_alv_top
    EXPORTING
      columns = 2.
  IF p_test EQ abap_false.
    lo_alv_top->create_header_information(
    row = 1
    column = 1
    text = 'Production Run'                                 "#EC *
    tooltip = 'Run with Commit Work' ).                     "#EC *
  ENDIF.
* output result
  lo_alv->set_top_of_list( lo_alv_top ).


So, my lovelies - can one of the abapers please modify this thing for me, so I will be able to delete all entries in ESDUS for all the 439 users in my system in one go?

Thank you a lot in advance.
curiousorange wrote:I give up. Humanity isn't worth saving. Why is there never a Vogon Constructor Fleet around when you really need one?
thx4allthefish
 
Posts: 5694
Joined: Sat Oct 26, 2002 6:18 pm
Location: barolo barrel

Re: Dump "insert duprec" in SU01

Postby Gothmog » Thu Sep 19, 2013 3:57 am

Err... it should work on several users at once already?
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Dump "insert duprec" in SU01

Postby thx4allthefish » Thu Sep 19, 2013 4:04 am

Gothmog wrote:Err... it should work on several users at once already?


Err, no? If I want to go to the tab where I can copy multiple users from the clipboard, it doesn't let me go there?

EDIT: this is NW 7.31.
curiousorange wrote:I give up. Humanity isn't worth saving. Why is there never a Vogon Constructor Fleet around when you really need one?
thx4allthefish
 
Posts: 5694
Joined: Sat Oct 26, 2002 6:18 pm
Location: barolo barrel

Re: Dump "insert duprec" in SU01

Postby thx4allthefish » Thu Sep 19, 2013 4:13 am

thx4allthefish wrote:
Gothmog wrote:Err... it should work on several users at once already?


Err, no? If I want to go to the tab where I can copy multiple users from the clipboard, it doesn't let me go there?

EDIT: this is NW 7.31.


EDITEDIT: aw, that was too easy. "Obligatory". I fell for it. So, you have to insert one UserID in the selection-field, then expand to multiple, then delete the entered line and then copypasta all your users from an excel or something. Bwah. My fault, clearly.

Thanks, Gothmog :D
curiousorange wrote:I give up. Humanity isn't worth saving. Why is there never a Vogon Constructor Fleet around when you really need one?
thx4allthefish
 
Posts: 5694
Joined: Sat Oct 26, 2002 6:18 pm
Location: barolo barrel

Re: Dump "insert duprec" in SU01 [Solved]

Postby Gothmog » Thu Sep 19, 2013 4:22 am

Oh, yeah, these 'obligatory' select-options are always a pain in the ass.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Dump "insert duprec" in SU01 [Solved]

Postby Sharpshooter » Thu Sep 19, 2013 6:32 am

Gothmog wrote:Oh, yeah, these 'obligatory' select-options are always a pain in the ass.

And generally useless. Unless some special check is coded, entry of '*' satisfies the obligation.
Dave
Good luck!
Sharpshooter
 
Posts: 1171
Joined: Wed Mar 17, 2010 12:01 pm
Location: In the dark

Re: Dump "insert duprec" in SU01 [Solved]

Postby os » Sat Dec 28, 2013 3:25 pm

Nice to see use of personalizations.

Goes to show that you only need to use something for bugs to show up.. :)
os
 
Posts: 469
Joined: Wed Dec 21, 2005 10:51 am


Return to SAP Security

Who is online

Users browsing this forum: No registered users and 6 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.