‎2014 Jul 31 4:37 PM
Hi all,
i would like to know how to create roles and its authorization objects from a program using BAPIs without using tx pfcg.
any idea?
thanks
‎2014 Jul 31 7:42 PM
Hi Gunar,
What I have here for now (that I found sometime ago) is showed below.
I used this FM on my last client and worked fine...
CALL FUNCTION 'PRGN_ACTIVITY_GROUP_ENQUEUE'
EXPORTING
activity_group = i_agr_name
EXCEPTIONS
foreign_lock = 1
transport_check_problem = 2
OTHERS = 3.
IF sy-subrc NE 0.
exit.
ENDIF.
CALL FUNCTION 'PRGN_RFC_CREATE_ACTIVITY_GROUP'
EXPORTING
ACTIVITY_GROUP = i_agr_name
ACTIVITY_GROUP_TEXT = i_agr_text
PROFILE_NAME = i_profile
ORG_LEVELS_WITH_STAR = '' NO_DIALOG = 'X'
TEMPLATE = ''
. IF SY-SUBRC <> 0. exit. ENDIF. ls_auth_data-object = 'S_RS_AUTH'. ls_auth_data-field = 'BIAUTH'. ls_auth_data-low = i_bi_auth. ls_auth_data-modifier = 'U'. append ls_auth_data to lt_auth_data. CALL FUNCTION 'SUPRN_DARK_MANIPULATE_PROFILE' EXPORTING ACTIVITY_GROUP = i_agr_name PROFILE_NAME = i_profile USE_EXTERNAL_TEMPLATE_DATA = 'X'
NO_DIALOG = 'X'
TABLES
EXTERNAL_TEMPLATE_DATA = lt_auth_data
. IF SY-SUBRC <> 0. exit. ENDIF.
CALL FUNCTION 'PRGN_ACTIVITY_GROUP_DEQUEUE'
EXPORTING
activity_group = i_agr_name.
e_ok = 'X'.
After that the Role will be created.
Save the authorizations using FM RSEC_MODIFY_AUTH.
‎2014 Jul 31 6:14 PM
Hi Gunar,
Have you tried using FM PRGN_RFC_CREATE_ACTIVITY_GROUP?
Regards.
‎2014 Jul 31 7:02 PM
hi rodolfo
could you send me an example (abap code).
thanks in advance
‎2014 Jul 31 7:42 PM
Hi Gunar,
What I have here for now (that I found sometime ago) is showed below.
I used this FM on my last client and worked fine...
CALL FUNCTION 'PRGN_ACTIVITY_GROUP_ENQUEUE'
EXPORTING
activity_group = i_agr_name
EXCEPTIONS
foreign_lock = 1
transport_check_problem = 2
OTHERS = 3.
IF sy-subrc NE 0.
exit.
ENDIF.
CALL FUNCTION 'PRGN_RFC_CREATE_ACTIVITY_GROUP'
EXPORTING
ACTIVITY_GROUP = i_agr_name
ACTIVITY_GROUP_TEXT = i_agr_text
PROFILE_NAME = i_profile
ORG_LEVELS_WITH_STAR = '' NO_DIALOG = 'X'
TEMPLATE = ''
. IF SY-SUBRC <> 0. exit. ENDIF. ls_auth_data-object = 'S_RS_AUTH'. ls_auth_data-field = 'BIAUTH'. ls_auth_data-low = i_bi_auth. ls_auth_data-modifier = 'U'. append ls_auth_data to lt_auth_data. CALL FUNCTION 'SUPRN_DARK_MANIPULATE_PROFILE' EXPORTING ACTIVITY_GROUP = i_agr_name PROFILE_NAME = i_profile USE_EXTERNAL_TEMPLATE_DATA = 'X'
NO_DIALOG = 'X'
TABLES
EXTERNAL_TEMPLATE_DATA = lt_auth_data
. IF SY-SUBRC <> 0. exit. ENDIF.
CALL FUNCTION 'PRGN_ACTIVITY_GROUP_DEQUEUE'
EXPORTING
activity_group = i_agr_name.
e_ok = 'X'.
After that the Role will be created.
Save the authorizations using FM RSEC_MODIFY_AUTH.
‎2014 Jul 31 8:41 PM
thank you very much , i will try it...
in case of doubts i will post you