Rejecting a PR
Alon Raskin
araskin at 3i-consulting.com
Tue Aug 8 21:30:14 EDT 2006
I am trying to write a method that rejects a PR from Workflow. The
customer is using a decision task (for other reasons) and therefore
wants to replicate the rejection functionality on the screen.
I have written the following code
*&---------------------------------------------------------------------*
*& Report ZRASKINA_PR_REJECT *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
report zraskina_pr_reject .
data : lv_pr type ref to if_purchase_requisition,
lv_doc type mepo_document,
lv_pr_factory type mmpur_purchase_req_factory.
parameters : p_banfn like eban-banfn.
lv_doc-doc_type = `B`.
lv_doc-doc_key = p_banfn.
lv_doc-trtyp = `V`.
lv_doc-process = `REQ_PROCESS`.
break ndlew.
call function 'MEREQ_GET_FACTORY'
importing
ex_factory = lv_pr_factory.
call method lv_pr_factory->create_header
exporting
im_tcode = sy-tcode
im_document = lv_doc
importing
ex_instance = lv_pr.
call method lv_pr->if_releasable_mm~reject
exporting
im_reset = space.
call method lv_pr->check.
call method lv_pr->post
exporting im_uncomplete = space.
call method lv_pr->close.
call method lv_pr_factory->commit.
However when I call the POST method I get an abend that reads System
error (error in method if_purchase_requisition~pos)t.
Can anyone suggest an easier way or can anyone see what I am missing
here?
Alon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20060808/6ad5df3b/attachment.htm
More information about the SAP-WUG
mailing list