Генерация Where условий относительно полномочий
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
DATA(o_auth) = cl_auth_objects_to_sql=>create_for_open_sql( ). o_auth->add_authorization_object( iv_authorization_object = 'S_CARRID' it_activities = VALUE #( ( auth_field = 'ACTVT' value = '03' ) ) it_field_mapping = VALUE #( ( auth_field = 'CARRID' view_field = VALUE #( table_ddic_name = 'SFLIGHT' field_name = 'CARRID' ) ) ) ). IF abap_true = o_auth->is_authorized( ). DATA(lv_where_cond) = o_auth->get_sql_condition( ). IF lv_where_cond IS INITIAL. cl_demo_output=>write_data( 'Все полномочия' ). ELSE. cl_demo_output=>write_data( |Ограниченные полномочия: { lv_where_cond }| ). ENDIF. SELECT * INTO TABLE @DATA(it_sflight) FROM sflight WHERE (lv_where_cond). cl_demo_output=>write_data( it_sflight ). cl_demo_output=>display( ). ENDIF. |
Подробнее в документации.