Deactivate password from users by admin

ABAP, Data, System September 29th, 2008

When you have to deactivate the pasword of a large list of userts, you could use this script. For a smaller set of users you can also use Trx SU10.

First of all you need a list of all users…

Then you can copy paste all values of BNAME into this report.

  1. REPORT  Z_USERS_DEACTIVATE.
  2.  
  3. TABLES: USR02.
  4. DATA: lv_username TYPE BAPIBNAME-BAPIBNAME,
  5. wa_logondata TYPE BAPILOGOND,
  6. wa_logondatax TYPE BAPILOGONX,
  7. lt_return TYPE BAPIRET2_T,
  8. lt_usr02 TYPE TABLE OF USR02,
  9. wa_usr02 TYPE USR02.
  10.  
  11. SELECT-OPTIONS: p_usids FOR USR02-BNAME.
  12.  
  13.  
  14. SELECT * FROM USR02 INTO TABLE lt_usr02 WHERE BNAME IN p_usids.
  15.  
  16. LOOP AT  lt_usr02 INTO  wa_usr02.
  17.  
  18.   lv_username = wa_usr02-BNAME.
  19.   wa_logondata-codvn  = 'X'.
  20.   wa_logondatax-codvn = 'X'.
  21.   CALL FUNCTION 'BAPI_USER_CHANGE'
  22.     EXPORTING
  23.       username   = lv_username
  24.       logondata  = wa_logondata
  25.       logondatax = wa_logondatax
  26.     TABLES
  27.       return     = lt_return.
  28.  
  29.   DELETE lt_return WHERE TYPE <> 'E'.
  30.   IF lt_return IS INITIAL.
  31.     WRITE: / 'Deactivated password:' , lv_username .
  32.  ELSE.
  33.     WRITE: / 'ERROR:' , lv_username  .
  34.   ENDIF.
  35. ENDLOOP.

Creating a BP for each organisational unit by admin

Data May 16th, 2008

If you want to create a business partner for each organisational unit you must specify this in customising.
After defining this setting, a BP will be created automatically when you create an OU.

You can find the menu in customizing:

In the first item you can define wether you want to create a BP for each organisation unit.

If you have already units in you organisational plan, you can use the second item in the menu to synchronise them. You can do this one by one or in bulk.

When you execute the query you can see all the units in your plan when a status(red/green). For the ones with a red light there is no BP defined. If you select the record and use the “start repair” button, a new business partner will be created for that ou.

the relation between a business partner and the organisational unit by admin

Data May 14th, 2008

In SAP CRM we made a reflection of company devisions into organisational units. You can define this with transaction PPOMW.

If you want to find out to wich position a BP belongs to, you can query the table HRP1001.

HRP1001