cancel
Showing results for 
Search instead for 
Did you mean: 

Document not released in UKM_CASE after implementi

0 Kudos
436

Hi everyone,


We are using BAdI SCMG_CHNG_BFR_STR_C for assignment and validation of certain fields in UKM_DCD_ATTRIB.

In our case to be specific we needed to set the attributes for the approval process based on the custom threshold which we define separately (custom table), also a check is made in our code to see if this is in change mode and the current system user is not part of the custom approval hierarchy then we revert the changes. Everything works perfectly until the changes are released and we notice that during release this BAdI is not called and somehow after the release message the document status is still 'Blocked'.

Can anyone please suggest what might be needed to align with the release process?

* 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.

Accepted Solutions (0)

Answers (0)