cancel
Showing results for 
Search instead for 
Did you mean: 

srm 7 partial rejection V/s recalled

vinita_kasliwal
Active Contributor
0 Kudos

I am trying to make the reason of rejection mandatory for Partial rejection where the SC status is Inquired howevr

once I did the changes  found that status is also inquired for SC which are recalled 

Please can some one help me identify what to change in a code where ?

This is what I wrote

ELSEIF lv_decision = c_rejected or c_inquired ""Check if Reason for rejection is  empty

  IF lwa_header-zzreasonreject EQ space.

    CLEAR ls_mesg.

    ls_mesg-msgty     = c_e.

    ls_mesg-msgid     = c_zsrm_msg.

    ls_mesg-msgno     = '001'.

    MESSAGE e002(zsrm_msg) INTO ls_mesg-message.

    APPEND ls_mesg TO et_messages.

  ENDIF.

ENDIF.

Now coz of this the requetsor when he recalls the SC gets the field Reason for rejection greyed out and error message that reason for rejection is mandatory . Please assist ASAP

Accepted Solutions (0)

Answers (2)

Answers (2)

vinita_kasliwal
Active Contributor
0 Kudos

Hi All

I am pasting the reply below Copy this code in an include in Zreason ofrejection BADi and you shall be able to code the requirment where the reason of rejection becomes mandatory even incase of partial rejection and not incase a user recalls a SC .

loop at LTA_ITEM into lwa_items.

    If sy-subrc EQ 0.

        move lwa_items-guid to lwa_item_guid.

        append lwa_item_guid to lt_item_guid.

    endif.

  ENDLOOP.

      " Retrieve item status (decision) for each item

      /sapsrm/cl_wf_process_manager=>get_item_status(

        EXPORTING

          iv_document_guid = iv_doc_guid

          it_item_guids = lt_item_guid

        IMPORTING

          et_item_status = lt_item_status

      ).

    loop at lt_item_status into lwa_item_status.

      if sy-subrc EQ 0 and lwa_item_status-ITEM_APPROVAL_STATUS = 'REJECTED'.

        IF lwa_header-zzreasonreject EQ space.

          CLEAR ls_mesg.

          ls_mesg-msgty     = c_e.

          ls_mesg-msgid     = c_zsrm_msg.

          ls_mesg-msgno     = '001'.

          MESSAGE e001(zsrm_msg) INTO ls_mesg-message.

          APPEND ls_mesg TO et_messages.

          EXIT.

        ENDIF.

      ENDIF.

    ENDLOOP.

Kindly mark my answer as helpful / useful if helped you in anyway . Thanks

Regards

Vinita

Former Member
0 Kudos

You should be adding the new field for rejection reason in the "Field Control (SPRO)" and control it in using the dynamic classes.