on 2023 May 25 7:18 PM
Hi everyone,
* Fist for assignment of approval we need to ensure to execute
* only during the automatic case creation mode
IF determine_creation_mode( im_case ) = abap_true.
* Set the attributes during creation mode
TRY. " Person Responsible
im_case->set_single_attribute_value(
im_srmadid = lc_responsible
im_value = CONV #( lv_person_resp_grp ) ).
CATCH cx_srm_framework .
CATCH cx_scmg_case_attribute .
ENDTRY.
TRY. " Approver 1
im_case->set_single_attribute_value(
im_srmadid = lc_dcd_approver1
im_value = CONV #( lv_one_approver_grp ) ).
CATCH cx_srm_framework .
CATCH cx_scmg_case_attribute .
ENDTRY.
TRY. " Approver 2
im_case->set_single_attribute_value(
im_srmadid = lc_dcd_approver2
im_value = CONV #( lv_two_approver_grp ) ).
CATCH cx_srm_framework .
CATCH cx_scmg_case_attribute .
ENDTRY.
ELSE. " Case Change mode
TRY. "Check if changed?
IF im_case->is_changed( ) = abap_true.
* Check if current user is not in approval hierarchy group
IF ( lv_person_resp_grp IS NOT INITIAL
AND sy-uname NOT IN lt_person_resp_grp ) " Person Responsible
OR ( lv_one_approver_grp IS NOT INITIAL
AND sy-uname NOT IN lt_one_approver_grp ) " Approver 1
OR ( lv_two_approver_grp IS NOT INITIAL
AND sy-uname NOT IN lt_two_approver_grp )." Approver 2
* Display message that user not authorized to save changes
MESSAGE i025(z0000fi).
TRY.
* Undo attribute changes if changed
im_case->undo_attribute_changes( ).
CATCH cx_srm_framework .
ENDTRY.
ENDIF.
ENDIF.
CATCH cx_srm_framework .
ENDTRY.
ENDIF.
Request clarification before answering.
User | Count |
---|---|
10 | |
5 | |
4 | |
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.