10-05-2007 5:05 PM
Hi,
could somebody tell me the difference between FM BAPI_USER_ACTGROUPS_ASSIGN and BAPI_USER_LOCACTGROUPS_ASSIGN?
What is "CUA Central System"?
Thanks,
Mate Bartalos
10-05-2007 5:12 PM
Hi Mate,
Check out the FM Documentation to know the difference between these FM's.
Regards,
Santosh
10-05-2007 5:12 PM
Hi Mate,
Check out the FM Documentation to know the difference between these FM's.
Regards,
Santosh
10-05-2007 6:48 PM
We have a CUA which provides a couple of R/3 daughter systems/clients. Further we have a HR system stand-alone-system which is also integrated in our CUA.
I tried to create a ABAP on the HR system which is changing the user masta data (especially the roles of a user) on the CUA system via RFC BAPI´s on a regular basis. Unfortunately it´s doesn´t works, because I don´t know the correct BAPI´s to change die CUA data. BAPI_USER_ACTGROUPS_ASSIGN changes only the locale R/3 user roles...
In my opinion the CUA specific user roles are in table USLA04 - which will be doesn´t changed.
Maybe somebody had the same requirements in the past and can help me? Thank you in advance!
My coding so far:
REPORT zzh_t_role_change_zbv.
PARAMETER: i_pernr TYPE pernr-pernr DEFAULT '90000007',
i_usrid TYPE sy-uname DEFAULT 'SCHEFFLM',
i_date TYPE sy-datum DEFAULT sy-datum.
DATA: lt_bapi_return TYPE STANDARD TABLE OF bapiret2,
lt_profiles TYPE STANDARD TABLE OF bapiprof,
lt_activitygroups TYPE STANDARD TABLE OF bapiagr.
DATA: ls_bapi_return TYPE bapiret2,
ls_profiles TYPE bapiprof,
ls_activitygroups TYPE bapiagr.
DATA: lv_zbv_sysid TYPE sy-sysid,
lv_zbv_clnt TYPE sy-mandt,
lv_zbv_logsys TYPE uszbvlndsc-sendsystem,
lv_zbv_rfc_dest TYPE rfcdes-rfcdest,
lv_usrid_zbv_get(10).
lv_usrid_zbv_get = i_usrid.
--- Zentrale Benutzerverwaltung: Zentralsystem des Users ermitteln ---
CALL FUNCTION 'SUSR_ZBV_CENTRALSYSTEM_GET'
EXPORTING
delivery_model = lv_usrid_zbv_get
IMPORTING
central_system_sysid = lv_zbv_sysid
central_system_clnt = lv_zbv_clnt
central_system_logsys = lv_zbv_logsys
central_system_rfc_dest = lv_zbv_rfc_dest
EXCEPTIONS
duplicate_central_system = 1
new_system = 2
OTHERS = 3.
Errorhandling
IF sy-subrc NE 0.
ENDIF.
--- Existenz des Benutzers prüfen ---
CLEAR: ls_bapi_return.
CALL FUNCTION 'BAPI_USER_EXISTENCE_CHECK' DESTINATION lv_zbv_logsys
EXPORTING
username = i_usrid
IMPORTING
return = ls_bapi_return.
Errorhandling
IF ls_bapi_return-id EQ '088'. "Benutzer existiert nicht
close RFC connection
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
destination = lv_zbv_logsys.
EXIT.
ENDIF.
--- Rollenzuordnungem zum Benutzer lesen ---
CLEAR: lt_bapi_return.
***************SUSR_ZBV_ROLES_RESOLVE
CALL FUNCTION 'BAPI_USER_GET_DETAIL' DESTINATION lv_zbv_logsys
EXPORTING
username = i_usrid
IMPORTING
ADDRESS =
LASTMODIFIED =
ISLOCKED =
TABLES
profiles = lt_profiles
activitygroups = lt_activitygroups
return = lt_bapi_return.
Errorhandling
LOOP AT lt_bapi_return INTO ls_bapi_return.
ENDLOOP.
IF ( ls_bapi_return-type EQ 'A' ) OR
( ls_bapi_return-type EQ 'E' ).
close RFC connection
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
destination = lv_zbv_logsys.
EXIT.
ENDIF.
Gültigkeitszeitraum von Rollenzuordnung setzen
CLEAR: ls_activitygroups.
LOOP AT lt_activitygroups INTO ls_activitygroups.
ls_activitygroups-to_dat = i_date.
MODIFY lt_activitygroups FROM ls_activitygroups.
CLEAR: ls_activitygroups.
ENDLOOP.
--- gesamte Aktivitätsgruppenzuordnung ändern (zeitlich abgrenzen) ---
CLEAR: lt_bapi_return.
*SUSR_USER_LOCAGR_ACTGROUPS_ADD
*SUSR_USER_CHANG
*CALL FUNCTION 'BAPI_USER_ACTGROUPS_ASSIGN' DESTINATION lv_zbv_logsys
EXPORTING
username = i_usrid
TABLES
activitygroups = lt_activitygroups
return = lt_bapi_return.
*--->SUSR_USER_LOCAGR_ACTGROUPS_PUT
*--->SUSR_USER_PROFS_BUFFER_SAVECHK
*--->SUSR_ZBV_USER_SYSTEM_SAVE
*--->SUSR_USER_BUFFERS_TO_DB
*--->SUSR_USER_GROUP_BUFFERS_TO_DB ????
*--->SUSR_USER_PROFS_BUFFER_TO_DB ????
*--->SUSR_USER_LOCPRO_BUFFER_TO_DB ????
*--->SUSR_UM_USR_AGR_BUFFERS_TO_DB ????
*--->SUSR_UM_USR_SYS_BUFFERS_TO_DB ????
*--->SUSR_USER_AGR_BUFFER_TO_DB ????
*--->SUSR_USER_LOCAGR_BUFFER_TO_DB ????
*Anmerkung: Profile werden nicht berücksichtigt, da diese eigentlich nicht
*mehr in Verwendung sein sollten (nur noch Rollen)
--- Rückverteilung der geänderten Userdaten an Tochtersysteme ---
*SUSR_ZBV_USER_SINGLE_SEND
*SUSR_ZBV_USER_SEND_BACK
*SUSR_USER_DISTRIBUTE
close RFC connection
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
destination = lv_zbv_logsys.
Please give me reward points if it is useful
Thanks
Murali Poli