09-21-2005 3:39 PM
Hello everybody,
i'm trying to make in transactions ME51N/ME52N/ME53N and autorisation check on account assignment(as cost center).
I used method PROCESS_ITEM of interface IF_EX_ME_PROCESS_REQ_CUST as in note 611175, and programmed the authorisation check with the corresponding authorisation object, and added an error message if the check isn't OK.
The problem is that even if i get the error message ( no authorisation for cost center XXXXX) i can save the purchase req . It's like the document is considered as valid with no error in spite of the error message i added.
Is there any way to force this error message or other way to flag the document as invalid???
thanks a lot.
AL Mahdi BENABDESSELAM
09-21-2005 3:46 PM
Why dont you use method "CHECK" called at save of req.
See below from note ( PARAMETER CH_FAILED will help you )
Method CHECK
o Functions
This method is called if the purchase requisition is posted or if
the user selects function 'Check'. Typically, the overall check
of the purchase requisition as well as the derivation of
dependent data that is not necessary during processing in
PROCESS_HEADER and so on or would deteriorate the performance
there is carried out here.
In the CHECK method, you can define enhancements for the overall
check or a separate overall check for the purchase requisition.
o Parameter
- IM_HEADER - PReq header
The interface reference is of type IF_PURCHASE_REQUISITION.
You can use all methods defined there.
- IM_HOLD - hold
The user has selected function 'Hold'.
- CH_FAILED - transaction/event failed
When checking, if you have detected an error that makes
further processing of the purchase requisition impossible, you
can fill this parameter with 'X'. Then, processing is not
continued. Then, processing is not continued. You must make
Page 9
09-21-2005 3:46 PM
Why dont you use method "CHECK" called at save of req.
See below from note ( PARAMETER CH_FAILED will help you )
Method CHECK
o Functions
This method is called if the purchase requisition is posted or if
the user selects function 'Check'. Typically, the overall check
of the purchase requisition as well as the derivation of
dependent data that is not necessary during processing in
PROCESS_HEADER and so on or would deteriorate the performance
there is carried out here.
In the CHECK method, you can define enhancements for the overall
check or a separate overall check for the purchase requisition.
o Parameter
- IM_HEADER - PReq header
The interface reference is of type IF_PURCHASE_REQUISITION.
You can use all methods defined there.
- IM_HOLD - hold
The user has selected function 'Hold'.
- CH_FAILED - transaction/event failed
When checking, if you have detected an error that makes
further processing of the purchase requisition impossible, you
can fill this parameter with 'X'. Then, processing is not
continued. Then, processing is not continued. You must make
Page 9
09-23-2005 4:13 PM
use MEREQ001 and in that use EXIT_SAPLMEREQ_005 function module and had the logic or do checking whatever you want and if you want to flash error message write a message statement with error type e so that will leave RFQ has error one.revert back for fruther clarifications if any
regards