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: 

SAP Standard ABAP Class for User Management?

former_member118192
Participant
0 Kudos

Hi,

I have a small and simple query, have you ever come across any SAP Standard Class dealing with users created in SAP. For example: lock, unlock, reset password etc

Man, I am fed of all these FMs and BAPIs. Any class? I used one: CL_CFX_USERS I guess, but that doesn't seem to be working.

Any suggestions?

1 ACCEPTED SOLUTION

matt
Active Contributor

You should use the BAPIs - those are the official APIs. If you use the classes behind, you'll be using parts of the standard code base that are not intended for use by customers. You do that at your own risk. If you manage to screw it up, SAP will charge you a fortune to fix.

So do what I did. Write a wrapper class to handle all user account management tasks, that hides away all those nasty BAPIs.

18 REPLIES 18

isaias_freitas
Advisor
Advisor

Hi,

I believe these can help you:

  • BAPI_USER_CHANGE
  • BAPI_USER_UNLOCK / BAPI_USER_LOCK
  • SUSR_USER_CHECK_EXISTENCE

Regards,

Isaías

0 Kudos

I am not looking for BAPIs. I need a Class, an ABAP Class.

0 Kudos

Why? BAPIs are the official SAP-supported API.

nabheetscn
Active Contributor

Hello Mansoor

If you look inside BAPI_USER_CHANGE you will see all classes for example cl_identity, cl_suid_tools, cl_identity_tools etc. Just have a look at source code you will get all the classes.

Thanks

Nabheet

0 Kudos

I got the classes but these are not returning me what I exactly require. Like get user data, lock user, unlock user, reset password.

Any ideas?

matt
Active Contributor
0 Kudos

Yes. As community moderator, I must require you to answer the following questions, otherwise I will lock this question:

Nabheet Madan yesterday

Any reason for hating them so much:)

Matthew Billingham 13 hours ago

Why do you have to avoid the BAPIs?

Mike Pokraka 2 days ago

Why? BAPIs are the official SAP-supported API.

0 Kudos

My question isn't that bad. I got -5 for this. I guess the query is a legit one. Lol

well... I suggested to use BAPIs and got downvotes... Matthew suggested to use BAPIs and got several upvotes... I guess "that's life" 😛 lol

matt
Active Contributor

You should use the BAPIs - those are the official APIs. If you use the classes behind, you'll be using parts of the standard code base that are not intended for use by customers. You do that at your own risk. If you manage to screw it up, SAP will charge you a fortune to fix.

So do what I did. Write a wrapper class to handle all user account management tasks, that hides away all those nasty BAPIs.

0 Kudos

Thank you for the response, I have already done that via wrapper class but needed to avoid those BAPIs instead.

nabheetscn
Active Contributor

Any reason for hating them so much:)

matt
Active Contributor

Why do you have to avoid the BAPIs?

Jelena
Active Contributor

Curious about this too. I can only guess that this could be some twisted logic like "SAP wants us to do OOP, so everything must be a class".

0 Kudos

There is no such reason for hating these. Actually I was wondering that there are factory classes available for PO PR SES etc. So, I was guessing that there must be one for processing user details.

That's it. If there isn't any, I can't do anything about them. Was just looking OOAD approach.

I hope this clears up the clutter.

matt
Active Contributor

The OOAD approach is to write your own class. With factory methods if you like. 😁

pokrakam
Active Contributor
0 Kudos

Nobody is going to learn anything from a baseless "how can I do it in a non-standard way" question if you keep repeating over and over that you don't want to use the API but refuse to explain the reasons.

So to me this is a pointless question as it stands right now and gets a downvote.

former_member118192
Participant
0 Kudos

That was harsh! Actually, you did not get the BASELESS question, what I am asking for. Looking for a STANDARD way without BAPIs. Any factory class anything?

pokrakam
Active Contributor

Nothing harsh, at least I took the time to explain why I downvoted.

Baseless: Not having an underlying basis or foundation, groundless; unjustifiable. (Oxford English Dictionary)

You provide no basis or justification for your question, despite repeated queries. Why no BAPI? What are you trying to accomplish? What problem are you trying to solve? What do you, or anyone on this forum, gain from doing this particular task without BAPIs?

The official API that SAP provides and supports is the "STANDARD way" that most of us use. You should not avoid them without a good reason. If you just want to know how SAP does it internally, debug it. If you do have another reason not to use the BAPI, share it.

People, including myself, are trying to help. Sometimes there is a good reason not to use a BAPI, and then we try to find a solution to address that problem. That's what this community is about. But if you don't answer people's queries we can't do that, and it ends up wasting people's time instead. Five people were put off enough by it to downvote. If the reason is just for your own curiosity then that's also perfectly valid, but then please say so.