Application Development 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: 

How to delete specific roles of a user

Former Member
0 Kudos

Hi Experts,

Please provide me if any FM or Bapi is available to delete a specific role of a user.

Thanks in Advance.

Regards

brahma

8 REPLIES 8

former_member181966
Active Contributor
0 Kudos

Try "BAPI_USER_ACTGROUPS_DELETE"

Good Luck

^Saquib

0 Kudos

Hi Saquib,

Thanks for your replay.

It seems This FM deletes all the roles of a user.

But my requirement is i want to delete specific roles [Not all the roles] of the user.

If you have any idea to resolve this please provide.

Thanks

brahma

0 Kudos

Look at program "SAPLSUU5" logic ( T-code su01 ) .. how it is deleting single role .. debug it .

^Saquib

0 Kudos

Hi

IF u want to delete role asigned to a BP ,

Former Member
0 Kudos

Hi brahma,

Follow this code,it will solve ur problem.

REPORT z_ran_table_control.

CONTROLS rowdeleting type TABLEVIEW USING SCREEN 100.

data : itab type TABLE OF zdetails WITH HEADER LINE,

ok_code like sy-ucomm,

MAK TYPE C VALUE 'X'.

call SCREEN 100.

MODULE STATUS_0100 OUTPUT.

SET PF-STATUS 'TEST'.

IF MAK EQ 'X'.

SELECT * FROM ZDETAILS INTO CORRESPONDING FIELDS OF TABLE ITAB.

ENDIF.

ENDMODULE.

MODULE INITCHECK INPUT.

modify itab INDEX rowdeleting-current_line.

ENDMODULE.

MODULE USER_COMMAND_0100 INPUT.

CASE OK_CODE.

WHEN 'BACK'.

LEAVE PROGRAM.

WHEN 'DELE'.

DELETE ITAB WHERE PICK EQ 'X'.

MAK = 'C'.

ENDCASE.

ENDMODULE.

======================================================================

PROCESS BEFORE OUTPUT.

module status_0100.

LOOP AT itab WITH CONTROL rowdeleting

CURSOR rowdeleting-current_line.

ENDLOOP.

PROCESS AFTER INPUT.

LOOP AT itab.

CHAIN.

  • FIELD itab-name.

  • FIELD itab-addres.

  • FIELD itab-contactno.

FIELD itab-PICK MODULE initcheck.

ENDCHAIN.

ENDLOOP.

MODULE USER_COMMAND_0100.

Regards,

Ranjith C.

Former Member
0 Kudos

Hi

Try using BAPI_BUPA_ROLE_REMOVE by exporting

BUSINESSPARTNER = <BP id>

BUSINESSPARTNERROLE = '<role code>'

call bapi_transaction_commit after this FM.

Hope this would help.

Thanks

Swapna

Former Member
0 Kudos

Hi

Try FM BAPI_USER_ACTGROUPS_DELETE to delete te specific role for users

Thanks

Swapna