12-03-2012 2:54 PM
Dear Gurus,
I am trying to create LSMW script for role assignment. I am facing strange issue- when I am doing recording (SU01/SU10) it is not taking role name as Parameter.
I have created n numbers of scripts with similar procedure but its not working only for this system. Please let me know if I have to do any specific setting.
Thanks
GV
12-04-2012 10:41 AM
GV,
When recording, you only need to ensure that the relevant fields are "in focus" which means that the recording recognized that this is a field that needs input.
In a SU01 screen you are allowed to enter 20 roles at one go (that's how many I know), all you will need to do is shift the focus for each row while recording, you should have 20 parameters identified.
Regards,
Avinash
12-04-2012 12:42 PM
Hi Avinash,
I am pasting only one role. Please let me know if I have to make any settings to make in focus, below is what I am getting..
SU10 User Mass Maintenance
SAPLSUID_MAINTENANCE 1051
BDC_CURSOR SUID_ST_BNAME-BNAME(0
BDC_OKCODE =CHAN
SUID_ST_BNAME-BNAME(01) USERID U
SAPLSUID_MAINTENANCE 1100
BDC_OKCODE =ACTG
BDC_SUBSCR SAPLSUID_MAINTENANCE
BDC_CURSOR GS_ADDR_OTHERS-COMP_N
SAPLSUID_MAINTENANCE 1100
BDC_OKCODE =UPD
BDC_SUBSCR SAPLSUID_MAINTENANCE
GS_NODE_ROLES_X-ADD X
You can see user name is coming as parameter but no role name.
Regards,
Gaurav
12-04-2012 11:01 AM
Hi Gaurav,
Are you following the below steps while recording?
1. Go to SU10 (this is the most suitable transaction for role assignment through scripts).
2. Type in or CTRL+V user ids and hit enter.
3. Click on the Change icon and move to the Role Assignment tab
4. Type or CTRL+V role names and their validity date and hit enter (please do not F4 and select roles).
5. Click on Save button or press CTRL+S
If you still don't find role field in the recording, try clicking on the manually add screen field button on the top and check if the role field is available there.
PS: LSMW scripts doesn't work efficiently in CUA systems.
Thanks,
Deb
12-04-2012 12:44 PM
12-05-2012 12:42 PM
Hi,
Why is this screen field coming up? Are you doing this is CUA system?
GS_NODE_ROLES_X-ADD X
Can you run the above script in Foreground and see what's happening? Is it just skipping the sreen for Roles addition and saving data?
Thanks,
Deb
12-05-2012 10:02 PM
Hi Gaurav,
A single LSMW script to create users and assign them roles will be tricky to create. I would suggest to split into two separate scripts.
Thanks,
Varun Jain
02-19-2013 12:17 PM
Hi Gaurav,
I too faced the same issue when creating some LSMW scripts. I wrote a separate script for new user creation and a separte 1 for assigning roles. Since the role field was not reflecting when i used su01 or su10 tcode, i tried to use the pfcg tcode. Yes, it works with pfcg
02-19-2013 6:54 PM
Hi
You might as well assign using PFCG instead of LSMW in that case. For multiple roles (and different per user) LSMW after SU01 user creation LSMW should work fine. SU10 for role assignment - see LOTS of threads for this so search first! 🙂
Cheers
David