[Solution] 역할 XXXXX의 유형이 결정되지 않았습니다.
1. 증상 : Single Role을 복사하려는데 Information 메시지가 뜨고, 복사가 안됨
2. 해결책 : SAP Note 770358
1. 오류 메시지
2. 메시지 확인
3. SAP Note 770358
cfile9.uf.2271824654A39B6227E31F.pdf
– Note에서 제공하는 소스코드를 받아서,프로그램 만들어 실행함
[#M_소스코드|접기|
*&———————————————————————*
*& Report Z_ADD_COLL_FLAG *
*& *
*&———————————————————————*
*& This report identifies roles without an entry for FLAG_TYPE *
*& COLL_AGR in table AGR_FLAGS and adds this entry. *
*&———————————————————————*
REPORT z_add_coll_flag LINE-SIZE 90.
TABLES: agr_define, agr_flags, agr_agrs, agr_1250.
DATA: it_agr_define LIKE agr_define OCCURS 100,
wa_agr_define LIKE agr_define,
it_agr_flags LIKE agr_flags OCCURS 100,
it_agr_flgs_u LIKE agr_flags OCCURS 100,
wa_agr_flags LIKE agr_flags,
wa_agr_agrs LIKE agr_agrs,
wa_agr_1250 LIKE agr_1250.
DATA: roles_wo_flg TYPE i,
undef_roles TYPE i,
flag_val LIKE smensapnew-customized.
* Testmode
PARAMETERS: testmode AS CHECKBOX DEFAULT ‘X’.
* Selection of all roles because all roles must be checked
SELECT * FROM agr_define INTO TABLE it_agr_define.
* I) Check of all roles
LOOP AT it_agr_define INTO wa_agr_define.
SELECT SINGLE * FROM agr_flags INTO wa_agr_flags
WHERE agr_name = wa_agr_define-agr_name
AND flag_type = ‘COLL_AGR’.
IF sy-subrc NE 0.
* No COLL_AGR entry found => It must be added.
CLEAR wa_agr_flags.
wa_agr_flags-agr_name = wa_agr_define-agr_name.
wa_agr_flags-flag_type = ‘COLL_AGR’.
* Check whether it is a single or composite role
* Does the role have authorizations?
SELECT SINGLE agr_name FROM agr_1250 INTO wa_agr_1250
WHERE agr_name = wa_agr_define-agr_name.
IF sy-subrc EQ 0.
* Yes, it has! => Single role
wa_agr_flags-flag_value = space.
ELSE.
* Does the role contain single roles?
SELECT SINGLE agr_name FROM agr_agrs INTO wa_agr_agrs
WHERE agr_name = wa_agr_define-agr_name.
IF sy-subrc EQ 0.
* Yes, it has! => Composite role
wa_agr_flags-flag_value = ‘X’.
ELSE.
* No, it doesn’t! => Status unclear => It is defined as single
* role.
wa_agr_flags-flag_value = space.
APPEND wa_agr_flags TO it_agr_flgs_u.
ENDIF.
ENDIF.
APPEND wa_agr_flags TO it_agr_flags.
ENDIF.
ENDLOOP.
* II) Display of the results
DESCRIBE TABLE it_agr_flags LINES roles_wo_flg.
IF roles_wo_flg GT 0.
WRITE: / ‘Roles without flag type COLL_AGR in table AGR_FLAGS:’,
roles_wo_flg.
SKIP.
ULINE (47).
WRITE: / ‘|’, (30) ‘Role’, ‘|’, (10) ‘Role Type’, ‘|’.
ULINE (47).
LOOP AT it_agr_flags INTO wa_agr_flags.
IF wa_agr_flags-flag_value EQ space.
WRITE: / ‘|’, (30) wa_agr_flags-agr_name,
‘|’, (10) ‘Single’, ‘|’.
ELSE.
WRITE: / ‘|’, (30) wa_agr_flags-agr_name,
‘|’, (10) ‘Collective’, ‘|’.
ENDIF.
ENDLOOP.
ULINE (47).
DESCRIBE TABLE it_agr_flgs_u LINES undef_roles.
IF undef_roles GT 0.
SKIP.
WRITE: / ‘Roles defined as single due to an unclear status:’,
undef_roles.
SKIP.
LOOP AT it_agr_flgs_u INTO wa_agr_flags.
WRITE: / wa_agr_flags-agr_name.
ENDLOOP.
ENDIF.
ELSE.
WRITE: / ‘No inconsistent roles found’.
ENDIF.
* III) Database update
IF roles_wo_flg GT 0 AND testmode EQ space.
* The database update is performed role by role using function module
* PRGN_SET_COLLECTIVE_AGR_FLAG in order to get change documents.
LOOP AT it_agr_flags INTO wa_agr_flags.
IF wa_agr_flags-flag_value EQ ‘X’.
flag_val = ‘X’.
ELSE.
flag_val = space.
ENDIF.
CALL FUNCTION ‘PRGN_SET_COLLECTIVE_AGR_FLAG’
EXPORTING
activity_group = wa_agr_flags-agr_name
collective_agr_flag = flag_val.
ENDLOOP.
WRITE: / ‘Table AGR_FLAGS updated’.
ENDIF.
_M#]
4. 대상 테이블
– flag_type에 “COLL_AGR”이 없어서 에러 발생
5. 실제 수행되는 함수
– Role 이름과 Flag 넣고 실행하면 끝.