2013 Oct 29 5:29 AM
Hello everyone,
I have a requirement where I want to upload the role changes from excel file. Hence the role should should get updated from the values in Excel file.
Following will be the format of excel file.
Role Name | Role Text | Object | Authorization | Field | Low | High | Action (Insert/Delete/Change) |
I understand that I need to use the following function modules in sync to update the role.
PRGN_1250_READ_AUTH_DATA
PRGN_1250_SAVE_AUTH_DATA
PRGN_1251_READ_FIELD_VALUES
PRGN_1251_SAVE_FIELD_VALUES
PRGN_1252_READ_ORG_LEVELS
PRGN_1252_SAVE_ORG_LEVELS
PRGN_UPDATE_DATABASE
But in spite of these function modules there is a lot more going on inside the code when I try to debug the profile generation in PFCG. I am watching function pool 'SAPLSUPRN' ad it seems there are endless number of function modules and includes in there. Can anyone help me out how to use the SAP built in functionality of profile generation to my advantage?
Best Regards,
Jagraj Singh.
2013 Nov 11 6:05 AM
Hi,
The f.m to generate the authorization profile is 'SUPRN_PROFILE_BATCH'. I have successfully generated the profile also. Will update this thread with proper steps when I finish my development.
Best Regards,
Jagraj Singh.
Hello everyone,
I have a requirement where I want to upload the role changes from excel file. Hence the role should should get updated from the values in Excel file.
Following will be the format of excel file.
Role Name | Role Text | Object | Authorization | Field | Low | High | Action (Insert/Delete/Change) |
I understand that I need to use the following function modules in sync to update the role.
PRGN_1250_READ_AUTH_DATA
PRGN_1250_SAVE_AUTH_DATA
PRGN_1251_READ_FIELD_VALUES
PRGN_1251_SAVE_FIELD_VALUES
PRGN_1252_READ_ORG_LEVELS
PRGN_1252_SAVE_ORG_LEVELS
PRGN_UPDATE_DATABASE
But in spite of these function modules there is a lot more going on inside the code when I try to debug the profile generation in PFCG. I am watching function pool 'SAPLSUPRN' ad it seems there are endless number of function modules and includes in there. Can anyone help me out how to use the SAP built in functionality of profile generation to my advantage?
Best Regards,
Jagraj Singh.
2013 Oct 29 5:49 AM
Hi Jagraj,
look inside the PFCG trans. you could export / import the role/profil. If you go in detail it works like a direct input. You just have to understand the structure of the file.
Search a little bit in the forum and if you don't find I will give you the function (I remember I already gives this functions here)
regards
Fred
2013 Oct 29 3:51 PM
So look PRGN_EXECUTE_UPLOAD ( or PRGN_UPLOAD_AGR and PRGN_DOWNLOAD_AGR for more infiormations )
Also read Frédéric Girod's anwers in create a program to mass change ACTVT to '03' in sap roles.
.
Regards,
Raymond
2013 Nov 08 10:33 AM
Thank you Frederic and Raymond. I wasn't aware of these F.Ms. However I need this specific layout of the excel sheet due to client's requirement. I am able to update the database using the above function modules. Can anyone tell me which Function module is used to generate the Authorization Profile?
Using f.m PRGN_UPDATE_DATABASE only updates the database and authorization profile. But the profile is not generated.
Please help.
Best Regards,
Jagraj Singh.
2013 Nov 08 10:41 AM
Hi Jagraj,
to generate :
CALL FUNCTION 'PRGN_AUTO_GENERATE_PROFILE_NEW'
EXPORTING
activity_group = lv_agr_name
profile_name = lv_profil
profile_text = lv_profilt
no_dialog = 'X'
rebuild_auth_data = ' '
org_levels_with_star = ' '
fill_empty_fields_with_star = ' '
* TEMPLATE = ' '
check_profgen_tables = ' '
generate_profile = 'X'
authority_check_pfcg = 'X'
EXCEPTIONS
OTHERS = 14.
to get a profile :
* ASK SAP for a Profile.
CALL FUNCTION 'PRGN_PROFILE_NAME_GET'
EXPORTING
act_objid = lv_agr_name
* text = lv_agr_title
IMPORTING
act_profile_name = lv_profil
act_prof_text = lv_profilt.
CHECK sy-subrc EQ space.
*
regards
Fred
2013 Nov 08 11:34 AM
Hello Frederic,
The F.M 'PRGN_PROFILE_NAME_GET' is used to propose/generate a Profile name. How about reading the existing profile name and text? Is there any f.m for that too?
Best Regards,
Jagraj Singh.
2013 Nov 08 12:10 PM
I think PRGN_PROFILE_NAME_GET will give you the profile corresponding to the role, and generate you a profile if there is not
but I'm not sure, that was a long time I used these functions
regards
fred
2013 Nov 08 11:43 AM
Hello,
You can use transaction SUPC for mass generation.
You can also check the program of the transaction to see how it is written.
something like:
EXPORT g_data TO DATABASE indx(pr) ID 'SAPPROFG_NEW'.
COMMIT WORK.
SUBMIT sapprofg_new AND RETURN.
Thanks.
Jim
2013 Nov 11 6:05 AM
Hi,
The f.m to generate the authorization profile is 'SUPRN_PROFILE_BATCH'. I have successfully generated the profile also. Will update this thread with proper steps when I finish my development.
Best Regards,
Jagraj Singh.
2014 Mar 24 3:46 AM
Hi Jagraj,
Do you have the steps to create a role from flat file/excel ?
I am basically looking for creating a role if I have Authorization Object, Field, Low and High values available.
Thank you.
regards,
Sanjyot
2014 Mar 24 4:03 AM
Hello,
Following are the function modules which work in conjunction to generate a new role or change the fields/org levels of the existing roles.
PRGN_1016_READ_PROFILE_NAME - Read Profile Data - i.e. data from agr_1016.
PRGN_1250_READ_AUTH_DATA - Read Authorization Data - i.e. data from agr_1250.
PRGN_1251_READ_FIELD_VALUES - Read Field Values - i.e. data from agr_1251.
PRGN_1252_READ_ORG_LEVELS - Read Org Levels - i.e. data from agr_1252.
Then you need to modify the field values of all the tables which you want to.
PRGN_1250_SAVE_AUTH_DATA - Save Authorization Data - i.e. save data to internal table similar to agr_1250 after modification.
PRGN_1251_SAVE_FIELD_VALUES - Save field values - i.e. save data to the internal table similar to agr_1251after modification.
PRGN_1252_SAVE_ORG_LEVELS - Save org values - i.e. save data to the internal table similar to agr_1251after modification.
PRGN_UPDATE_DATABASE - update database tables i.e. agr_1250, agr_1251, agr_1252, agr_1016.
PRGN_CLEAR_BUFFER - Release all the changes to the internal tables.
Please note that thefunction modules PRGN_UPDATE_DATABASE and PRGN_CLEAR_BUFFER will only update the database tables. This is like a commit-work statement. But it will not generate the role.
SUPRN_PROFILE_BATCH - This function module is used to generate the Authorization Profile.
For detailed analysis you can debug the code when you generate the role.
Best Regards,
Jagraj Singh
2015 Jul 30 10:52 AM
Hello Jagraj,
I am working on a similar task at the moment but got stuck at the following point:
How to add completely new authorizations into profile/role?
I can read and change the values in agr_1250 and agr_1251.
But when i want to add another authorization object - which has not been in the profile before - it is not working. Anyone got a solution for this?
Kind regards
Kevin
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |