2007 Jul 24 11:18 AM
Hi Friends,
While creating a purchase requisition , one has to enter the <u>Des Vendor</u>. Now the requirement is that if that vendor belongs to a particular Vendor Type 'ZZZZ' then the purchase requisition should prompt a message, and the purchase Requisition should not get created.
Points will be rewarded , for helpful answers.
Thanks
Atin
Hi Friends,
While creating a purchase requisition , one has to enter the <u>Des Vendor</u>. Now the requirement is that if that vendor belongs to a particular Vendor Type 'ZZZZ' then the purchase requisition should prompt a message, and the purchase Requisition should not get created.
Points will be rewarded , for helpful answers.
Thanks
Atin
2007 Jul 24 11:27 AM
hi, try to look for anyuser exit and then chek in that exit .....
2007 Jul 24 11:36 AM
Hi,
I have been looking into several user exits, but could not find the one that fits the situation.
Can someone give a more accurate solution.
Thanks,
Atin
2007 Jul 24 12:09 PM
Hi
Use the BADI
ME_REQ_POSTED and chek for the Vendor type field and based on that field save the PR or not.
see the sample code
BAdI Name: ZPUR_RFQ (Implementation name) Purchase Requisitions
Definition Name: ME_REQ_POSTED
Interface Name : IF_EX_ME_REQ_POSTED
Implementing Class: ZCL_IM_PUR_REQ
Method : POSTED
************************************************************************
METHOD if_ex_me_req_posted~posted .
DATA : v_mtart TYPE mtart.
DATA l_s_eban TYPE ueban.
LOOP AT im_eban INTO l_s_eban.
IF l_s_eban-estkz NE 'B'.
CLEAR v_mtart.
SELECT SINGLE mtart INTO v_mtart FROM mara WHERE matnr = l_s_eban-matnr.
IF v_mtart EQ 'ZERS' OR v_mtart EQ 'FHMI' OR v_mtart EQ 'UNBW'.
MESSAGE e000(zm_msg) WITH 'You are not allowed' 'to create PR for stock items'.
ENDIF.
ENDIF.
IF l_s_eban-knttp NE 'F' OR l_s_eban-pstyp NE '9'.
IF l_s_eban-knttp NE 'A'.
IF ( l_s_eban-pstyp NE '9' AND l_s_eban-pstyp NE 'D' ) AND l_s_eban-matnr EQ space.
MESSAGE e000(zm_msg) WITH 'You cannot create' 'a PR without material number'.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
<b>Reward points for useful Answers</b>
Regards
Anji
2007 Jul 24 12:15 PM
Hi,
I need a solution to be implemented in SAP 4.6 Version, so BADI would not be available there
Thanks,
Atin