cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Command for deleting T-Code for roles

Former Member
0 Kudos

Hi Experts

I want to delete the transaction from the role name by using SQL Command in MS-SQL Server instead of going to /npfcg -> zwa_xyz (role name for user) and transaction code is CR01,CR01,CA01 Etc.,

I have so many transaction code which is taking time to delete one by one.

So is there any SQL Statement to delete the t-code for that rolename

Delete from tablename where t-code=xyz and rolename in ('zwa_xyz',zwa_123')

............

regards

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey,

SAP does not support executing update/insert/delete SQLs on their tables,

(the only SQL they support are select, and updates that they publish in their official site, such as notes in service.sap.com/notes)

is is probably due to the fact that sap contains about 30,000 of table,

and sometimes SAP uses cluster tables (which are difficult to handle in DB)

in addition, each and every SP adds/remove table or changes existing tables.

For example, you probably don't know that changing rule, would

create a change document (cluster table - CDHDR, CDPOS and etc),

If you want, it is very easy to get the full list of the table (and the sql) that are updated

(as I mentioned before, it is not recommended to run this sql, because it is not supported!!!)

just run transaction ST05 while deleting transaction from role,

when you display the list, press shift+F8 (or summerized trace from the menu),

and they search (Ctrl+F) the words: update or insert or delete.

You can use standard API such as BAPIs (such as BAPI_USER_*)/IDOCs(such as USERCHANGE),

and execute them from the portal and any other place (even in EXCEL or OS->meaning command line).

Here more information on executing RFCs:

1. in order to execute an RFC from excel, you should install SAP gui on the client that would execute the RFCs to the SAP, and you would have to write VBA code.

2. in order to execute an RFC from command line, this is a little bit more difficult,

sap provide RFC sdk (in service.sap.com/SWDC)

3. in order to execute an RFC from .net you can use the .net connector,

more information is here:

4. You can also, execute an RFC using Web service,

by creating web-service from the RFC in SE37.

I guess It will take more time to develop this they just executing the SQL.

If you need more information in executing an RFC,

please decide which option is your favorite,

and I would add information...