
METHOD get_instance_authorizations.
DATA: update_requested type abap_bool,
update_grtanted TYPE abap_bool.
READ ENTITIES OF zi_student_5000 IN LOCAL MODE
ENTITY Student
FIELDS ( Status ) WITH CORRESPONDING #( keys )
RESULT DATA(studentadmitted)
FAILED failed.
CHECK studentadmitted is not initial.
update_requested = COND #( WHEN requested_authorizations-%update = if_abap_behv=>mk-on OR
requested_authorizations-%action-Edit = if_abap_behv=>mk-on THEN
abap_true ELSE abap_false ).
loop at studentadmitted ASSIGNING FIELD-SYMBOL(<lfs_studentadmitted>).
if <lfs_studentadmitted>-Status = abap_false.
if update_requested = abap_true.
update_grtanted = is_update_allowed( ).
if update_grtanted = abap_false.
APPEND VALUE #( %tky = <lfs_studentadmitted>-%tky ) to failed-student.
APPEND VALUE #( %tky = keys[ 1 ]-%tky
%msg = new_message_with_text(
severity = if_abap_behv_message=>severity-error
text = 'No Authorization to update status!!!'
)
) to reported-student.
ENDIF.
endif.
endif.
endloop.
ENDMETHOD.


You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 22 | |
| 19 | |
| 12 | |
| 11 | |
| 11 | |
| 10 | |
| 9 | |
| 9 | |
| 8 | |
| 8 |