‎2009 Apr 30 9:17 PM
HI,
I had to build two method's
1. Method that bring user name for specific ID and one that bring .
2. Method that bring all the user when it execute.
I want to build it in OO ,any tips for good design will be helpful.
Best Regards
Nina
‎2009 May 01 2:11 PM
As described above, you can only achieve this by creating a single method.
Create method, GET_USER_INFO
Signature
Importing R_USERID (Range of User ID)
Exporting IT_USER_INFO (Table to hold the user Info)
When you call this method, pass I EQ user_name in the range to get only one User Info. Leave it blank when you want all user info.
Regards,
Naimesh Patel
‎2009 Apr 30 10:41 PM
Check Forum & Google for Code optimizations, Performace Tuning and similar words. You will get lots of helpful replie.
Always search the forum before posting the query.
‎2009 Apr 30 10:46 PM
HI
I don't want help with the code i want help to do code design,
For that i need something specific not generic.
‎2009 May 01 6:44 AM
Hi Nina,
I think, there is no need to use two methods for your requirement.
You should use one method instead of two.
Design that in this way.
If you pass User ID parameter value -
> displays corresponding user only.
If you won't pass any User ID value -
> displays all users.
it should work with minor changes to your logic in the same method.
by
Prasad gvk.
‎2009 May 01 7:26 AM
Hi Nina,
You need to create only one method.
with 4 parameters
First parameter = single user id
second par = low range
third par = high range
fourth par = 'X' (Note: mark it X to work with single id and leave it blank for range of ids.)
hope this will solve your problem.
‎2009 May 01 2:11 PM
As described above, you can only achieve this by creating a single method.
Create method, GET_USER_INFO
Signature
Importing R_USERID (Range of User ID)
Exporting IT_USER_INFO (Table to hold the user Info)
When you call this method, pass I EQ user_name in the range to get only one User Info. Leave it blank when you want all user info.
Regards,
Naimesh Patel
‎2009 May 01 8:47 PM
HI Naimesh,
U think for this I need to build interface or just use class ?
BR
Nina
‎2009 May 03 3:09 PM
Hello Nina,
If you require this method to be redefined in different classes, then it makes sense to define an interface for it. So you could add your interface in the different classes and this would enable you to have a generic calling method for the different implementations of the same method.
However if you have only one implementation then I would suggest you define it in your class only.
Thank you,
Ramneek
‎2009 May 01 2:27 PM
Hello Nina,
You can achive this in one method, though you need two methods for this just follow as below.
GET_USER_RECORD
with parameters as below.
IMPORTING
ID and TYPE <DataelementType>
EXPORTING
DETAILS_REC TYPE <StructureType Of USER RECORD>
and implement this method by retriving from table.
GET_USER_RECORDS
EXPORTING
USER_DETAILS TYPE <Table Type Of USER RECORD>
and implement the menthod where you need to assign the records to this intername table USER_DETAILS
Thats it..and use it as per your requirement.
Regards,
Prasanna