cancel
Showing results for 
Search instead for 
Did you mean: 

Reject or Approve

Former Member
0 Kudos

Hi,

I am working on a MSS (Special Payment), initiator starts the request and hit Check and Send button, this will trigger Do-Operation method in the badi. The request can be submitted in next page if no error occurred.

During Approver stage -

Approver can either reject or approve, I noticed that when approver hit the reject or approve button, it doesn't trigger the same method anymore.

Please advice why the Reject button is not configured to trigger Do-Operation method in the badi but Check and Send button is?

Thanks

Regards,

Justin

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey Justin,

When you click on the check and send button, this is giving you the opportunity to do any kind of validation checking that you need to do before submitting the form to workflow (null fields, incorrect values...).

When you click an approve or reject button,this is triggering events for the workflow. These buttons (Approval) are used to submit the form through workflow to finish any kind of submission, or (Reject) terminate the workflow. If you are wanting an approver to be able to change information in the form, or be able to do some kind of validation, you would have to change the sequence of events in the workflow to accomodate that. What will happen is when an approver opens up a form, they will be able to edit the form, and then do a check and send. The only problem with this, is that they will not be able to approve the form right there. They will have to re-send the form, check the workflow inbox, and then open the form to have the Approve and Reject buttons in there. The only thing that can be changed in the Approve and Reject stage is the New Comments field, everything should be read only.

Hope this helps...

Cheers,

Kevin

Former Member
0 Kudos

Dear Kevin,

Thanks for your reply.

Yes, you are right.

When we hit Check and Send button, it will trigger method (IF_HRASR00GEN_SERVICE~DO_OPERATIONS) of the Badi. This is where all my validations being done.

My problem is that - I need to add-on a validation to make sure the approver enters a comment when they hit REJECT button. If no comment is entered by the approver, an instant error message "Please enter a comment" should be returned on the screen.

Your suggestion to use workflow event to accomodate will not be able to return the error message on the spot. Do you have any alternative way that I can use to trigger the method (IF_HRASR00GEN_SERVICE~DO_OPERATIONS) when I hit REJECT button?

Please advice.

Thanks

Regards,

Justin

Former Member
0 Kudos

Hey Justin,

That's a good question. I'm not sure if there is anyway that you can trigger the DO_OPERATION event during a REJECT call. I'm not even sure if the is BAdI is referenced after the button is selected. There might be a way of forcing a call to the BAdI from the Workflow.

Sorry I can't help much more than this.

Cheers,

Kevin

Former Member
0 Kudos

Hi Kevin,

Not a problem. Thanks for all the replies.

I knew that method (IF_HRASR00GEN_SERVICE~GET_SPECIAL_FIELDS) will be called when the REJECT button is hit.

But this method is originally empty with no code, I am wondering whether I can add some code over here like below:

CALL METHOD me->IF_HRASR00GEN_SERVICE~DO_OPERATIONS

EXPORTING

special_fields = special_fields

SERVICE_OPERATIONS = SERVICE_OPERATIONS

no_auth_check = no_auth_check

message_handler = message_handler

CHANGING

help_datasets = relevant_help_datasets

SERVICE_DATASETS = relevant_service_datasets.

I am not sure how to use the "Call method me->",

I am still figuring out what values to be passed into the DO_OPERATION method. When the code runs into that method, I wish that I can use "If formscenario_stage = Approve" and "processing_status = reject" then_ do the comment field validation in the method.

Thanks

Regards,

Justin