cancel
Showing results for 
Search instead for 
Did you mean: 

MSS leave request rejection reason mandatory

0 Kudos

Hi to all,

we are using NWBC on our EhP6 System for ESS/MSS. I managed to configure leave request with custom workflow (just copy of the standard one with 2 extra mail steps). Now i'm trying to implement the following functionality:

The manager should not be able to reject selected leave request without typing a reason (see image below).

Which classes and BaDIs should be enhanced to implement this functionality?

Thanks in advance for the help.

Regards,

Yanko

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

check pt_abs_req  badi  if this is not suitable proceed in the following way

you can enhance the class CL_HRESS_PTARQ_LEAVREQ_GUIBBF IF_FPM_GUIBB_FORM~GET_DATA  method .  In that approve or rejcet event you can handle, if notes(CURR_NOTICE) is empty you can raiser error message.

If require more details let me know.

Regards

suri

0 Kudos

Hi Suri,

thanks for the hint. So i enhanced the class CL_HRESS_PTARQ_LEAVREQ_GUIBBF IF_FPM_GUIBB_FORM~GET_DATA method. I've managed to raise message but this error message doesn't stop the process of rejecting the request (see image below).

Do you have an idea how to raise properly an error message that interrupts the process?

former_member182426
Active Contributor
0 Kudos

you can implement the BADI  PT_ABS_REQ  for method IF_EX_PT_ABS_REQ~SIMULATE_VIA_BLOP

Other wise in simple way at application level make that field as mandatory.

0 Kudos

Hi Shankar,

i've implemented the BADI PT_ABS_REQ and tried to raise an error with the message handler but had no success. Here is my coding:

     ls_message-id = 'ZHR_XSS'.
     ls_message-number = '001'.
     ls_message-type = 'E'.

     CALL METHOD message_handler->add_message
       EXPORTING
         im_type         = ls_message-type    " Meldungstyp: S Success, E Error, W Warning, I Info, A Abort
         im_number       = ls_message-number
         im_cl           = ls_message-id
         im_context      = ''
         im_subcontext   = ''
         im_classname    = 'ZCL_PT_ARQ_REQ_EXIT'
         im_methodname   = 'SIMULATE_VIA_BLOP'.

As of your second hint. Could you please name me the WDC at application level? I've searched hours but it seems to be generated "on the fly" by FPM.


former_member182426
Active Contributor
0 Kudos

Application name: HRESS_A_PTARQ_LEAVREQ_APPL

Configuration name: HRESS_AC_PTARQ_LEAVREQ

0 Kudos

Hi Shankar,

HRESS_A_PTARQ_LEAVREQ_APPL: HRESS_AC_PTARQ_LEAVREQ > OVP: HRESS_CC_PTARQ_LEAVREQ > Form UIBB: HRESS_CC_GUIBBF_LEAVREQDIALOG


as you can see in the following screenshot there is no property for the field CURR_NOTICE which will set this field as a mandantory.

So do you have other ideas?

Former Member
0 Kudos

Hi,

If you put at applcation level check mandatory it will  check at initiator level also i.e. while sending request.

I think the requirement is when Rejecting only its mandatory so no need of putting at application level.

You can handle in process event reject method.

Regards

suri

Former Member
0 Kudos

Hi,

For that you need to do following way.

Now what you need to do is dont enhance get_data method.

Approve and Reject events handling in process event.

In process event.

fpm event : cl_hress_ptarq_communicator=>gc_lrf_appr_reject

in this event  it is calling reject method.

in reject method of class CL_HRESS_PTARQ_LEAVREQ_GUIBBF  you need to enhace for

curr_notice field .

if that field is initial fill ct_messages table as error message type 'E'.

Even though it will not stop flow of execution unit unless you have to set this attribute  mv_lrf_error_detected  eq abap_true.

Regards

suri

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I used below method to achieve this requirement.

Go to Class: CL_HRESS_PTARQ_LEAVREQ_GUIBBF

Method: REJECT

Create an Implicit Enhancement at the Top of the Standard Code, and use below Code in It.

Please Note: I have used my Message class: ZHR

and Maintained the error message in it with ID: 033.

data: mt_messages_fpm1 type FPMGB_S_T100_MESSAGE.

  if ms_request-curr_notice is initial.

       mv_lrf_error_detected = abap_true.

clear: mt_messages_fpm1.

CLEAR: Ct_message[].

                 MT_MESSAGES_FPM1-MSGID = 'ZHR'.

                 MT_MESSAGES_FPM1-msgno = '033'.

                 MT_MESSAGES_FPM1-severity = 'E'.

   APPEND MT_MESSAGES_FPM1 TO CT_MESSAGE.

   CLEAR mt_messages_fpm1.

return.

       ENDIF.

Regards.

former_member182426
Active Contributor
0 Kudos

you can implement the BADI PT_ABS_REQ