‎2007 Apr 23 7:28 PM
Hello Friends,
I need some help in creating logic.
Requirement : User enters transaction and report should show list of all ROLES which contain that tcode. Remember to consider Mannually added tcodes under S_TCODE e.g it could be A* or range T* to Z* or only RZ11.
i had created small program to extract data, but I am unable to build logic to get required result.
Please help.
REPORT YTEST .
TABLES : AGR_1251.
DATA ITAB LIKE AGR_1251 OCCURS 0 WITH HEADER LINE.
PARAMETER TCODE LIKE AGR_1251-LOW .
SELECT * FROM AGR_1251 INTO TABLE ITAB WHERE OBJECT = 'S_TCODE' AND
FIELD = 'TCD' '.
LOOP AT ITAB.
IF ITAB-LOW CP '*'.
ELSE.
DELETE ITAB WHERE LOW(1) <> TCODE(1).
ENDIF.
ENDLOOP.
WRITE : / 'ITAB-AGR_NAME', 30'ITAB-OBJECT', 'ITAB-FIELD', 'ITAB-LOW',
'ITAB-HIGH'.
LOOP AT ITAB.
WRITE : / ITAB-AGR_NAME, ITAB-OBJECT, ITAB-FIELD, ITAB-LOW, ITAB-HIGH.
ENDLOOP.
‎2007 Apr 23 7:45 PM
Kindly advice I am unable to get logic to resolve issue, although I know where is data.
So if user give SMLG, how to find whether it is in a given range or not
Message was edited by:
satinder ghuman
‎2007 Apr 23 8:26 PM
hi Satinder,
if u want to find roles in a range of t-code u need to use Select-options instead of parameters.
<b>TABLES : AGR_1251.
DATA ITAB LIKE AGR_1251 OCCURS 0 WITH HEADER LINE.
SELECT-OPTIONS: TCODE FOR AGR_1251-LOW.
SELECT * FROM AGR_1251 INTO TABLE ITAB WHERE OBJECT = 'S_TCODE' AND
FIELD = 'TCD' AND LOW IN TCODE.
WRITE : / 'ITAB-AGR_NAME', 30'ITAB-OBJECT', 'ITAB-FIELD', 'ITAB-LOW',
'ITAB-HIGH'.
LOOP AT ITAB.
WRITE : / ITAB-AGR_NAME, ITAB-OBJECT, ITAB-FIELD, ITAB-LOW, ITAB-HIGH.
ENDLOOP.</b>
Regards
SAB
‎2007 Apr 23 8:17 PM
Hello Satinder
Are you sure that neither of the many reports available in transaction <b>SUIM </b>are suitable for your inquiries?
For example, if you call Report <b>User Information System -> Roles -> By Transaction Assignment</b> the result shows all roles that have the selected transaction(s) assigned.
Regards
Uwe
‎2007 Apr 23 8:23 PM
Hi,
Have you looked standard program RSUSR070?
In this program, you can enter a given transaction and system willl display all role(s) involved.
Regards,
Ferry Lianto
‎2007 Apr 24 2:58 AM
Thanks for replying.
Using RSUSR070 was the first thing I did. But it was rejected.
So now all I need is a logic in the said program.
Hello Syed,
Sorry this logic did not work as we can give range like P* to Y*. So we have to keep track of both LOW as well as HIGH.
Any other suggestion please, will be greatly appreaciated.
‎2007 Apr 24 8:48 AM
Hello Guys,
Please advice.
Do we have a developer who can help me in ABAP logic for this issue.
regards,
Message was edited by:
satinder ghuman