Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using function module PT_ARQ_REQUEST_EXECUTE to approve leave requests

christine_evans
Active Contributor
0 Likes
2,115

I'm building a screen to approve or reject multiple leave requests using function module PT_ARQ_REQUEST_EXECUTE as the SAP standard program RPTARQAPP does, and this seems to be working fine. However, I also need to include a note from the approver which is a bit of long text that ends up in table PTREQ_NOTICE. This is something that RPTARQAPP does not do.

I cannot find any way of passing this text into PT_ARQ_REQUEST_EXECUTE. The only way I can find of doing this is to call FM PT_ARQ_REQUEST_PREPARE first (command = PREPARE_APPROVE), update the CURR_NOTICE field it sends back in structure EX_REQUEST, then pass the changed EX_REQUEST structure into FM PT_ARQ_REQUEST_CHECK (command = CHECK_APPROVE) and then call PT_ARQ_REQUEST_EXECUTE (command = EXECUTE_APPROVE). This works fine for a single leave request, but when I try to use this process to approve two leave requests the CHECK FM gives me an error on the second record with a message referring to a time conflict with the first message even though the dates on each are not the same.

I've searched and there are a few posts about these FMs, but I still can't fix this problem. Has anyone ever dealt with this situation before and found a solution?

4 REPLIES 4
Read only

christine_evans
Active Contributor
0 Likes
1,489

I've replaced the call to FM PT_ARQ_REQUEST_CHECK with the following and it seems to work pretty well. Though of course it will need a lot more testing.

STATICS:
    request TYPE REF TO if_pt_req_request.

  CALL METHOD ca_pt_req_header=>agent->get_request
      EXPORTING
        im_request_id     = p_im_request_id
      IMPORTING
        ex_request        = request
      EXCEPTIONS
        request_not_found = 1.

  CALL METHOD request->set_notice
      EXPORTING
        IM_NOTICE               = p_approver_text.

Read only

0 Likes
1,489

hi can u explain little more on this

Thanks and Regards,

Thirukumaran. R

Read only

Former Member
0 Likes
1,489

how did u solve that issue can u share the solution me too.,.,

Thanks and regards,

Thirukumaran. R

Read only

Former Member
0 Likes
1,489

HI ,

  Am also facing same issue . While approving or rejecting time i have to pass message to

ptarq_notice tabble.

How ypu resolved this issue?