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

Purchase Requisition

Former Member
0 Likes
743

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

4 REPLIES 4
Read only

Former Member
0 Likes
695

hi, try to look for anyuser exit and then chek in that exit .....

Read only

0 Likes
695

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

Read only

Former Member
0 Likes
695

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

Read only

0 Likes
695

Hi,

I need a solution to be implemented in SAP 4.6 Version, so BADI would not be available there

Thanks,

Atin