Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Delete transaction codes from a role

Former Member
0 Likes
1,869

Hi,

I want to delete 20 percent of the transaction codes from a role and I have to carry out this exercise for 20 to 30 roles, please let me know how to go about it.

I know that I can go to the each role and delete each transaction by transaction but this process appears to be very tedious and time consuming, kindly let me know if there is any other alternative for this.

Please help.

Thanks

Suresh

Resolved

5 REPLIES 5
Read only

Former Member
0 Likes
1,065

Hello Suresh,

First create single column internal table, for example ROLES which will hold all the ROLES for which you want to delete transaction codes. Read all the required ROLES into ROLES table.

Now, You can create internal table, for example ITAB1 for ROLES and TRANSACTION CODES and read required roles and transactikon code from AGR_TCODES table.

Now loop at ROLES.

Move all the records from ITAB1 to ITAB2 where AGR_NAME = ROLES. --> as ROLES is single column table.

DESCRIBE TABLE ITAB2 LINES <count>.

Now find 20 % of the total <count>.

Now use delete table with from 1 to <result after %age>

..... Go for next ROLE.

endloop.

For example:

If total transaction cod efor particular ROLE are 10 then

20% of 10 will be 2 transaciton codes.

so you can delete table <table> name from 1 to 2.

Hope this helps.

Thanks,

Augustin.

Read only

Former Member
0 Likes
1,065

Hi,

Thanks for your reply.

What I meant by 20 percent of the transaction codes is an example i.e I need to delete few individual transaction codes eg.mm01,fb01,xk01,and etc from multiple transction codes.

Thanks

Suresh

Read only

0 Likes
1,065

Hi Suresh,

To delete cetain tcodes means removing the authorization codes for that particular entities.So for this it is always good to have knowledge about the authrization object related to the entries you want to restrict but you can take the help of the table to get those enteries role with authrization.

User master authorization profiles USR10

User Master Authorization Values USR12

Role definition AGR_DEFINE

By going to PFCG transcode you can access roles authorization with various approaches and not by role .Hope your query resolves soon.

Have a best day ahead.

Edited by: Srivastava.G on Jul 17, 2009 12:58 PM

Read only

0 Likes
1,065

Hello Suresh,

In that case you can maintain single column internal table for transaction code which will hold all the transaction code you want to delete.

Then instead of calculating percentage in previous code you can use directly delete statement on itab2.

DELETE FROM ITAB2 WHERE TCODE IN TCODE_TAB --> here tcode_tab is single column internal table consist of all the transaction code that you want to delete.

Check this out!

Thanks,

Augustin.

Read only

Former Member
0 Likes
1,065

Resolved