Rejecting a PR
Richard V Marut
rvmarut at earthlink.net
Wed Aug 9 01:16:19 EDT 2006
Alon,
I know there is a way to set the status field eban-banpr because I've done
it before back in April but I can't find the code to do it. You could always
use function module bapi_requisition_delete as a temporary solution to flag
the line item as deleted. Just don't set the item to closed in the items
table that you pass to the module. You can reverse the deletion but I
couldn't figure out have to reverse the close.
Richard.
_____
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of
Alon Raskin
Sent: Tuesday, August 08, 2006 8:30 PM
To: SAP Workflow Users' Group
Subject: Rejecting a PR
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/20060809/a9ce605f/attachment.htm
More information about the SAP-WUG
mailing list