2007 Jul 26 7:35 AM
Hello Experts,
I am facing a strange problem in BADI.
The requirement is that the user should not be allowed to change the plant field
on the screen of standard MM transctions for PO/PR amendment.
I have written the code in separate BADIs for PO and PR.
I am displaying an error message if the user tries to change the field.
For PO, it is working fine.But for PR, the same code is not working.
The control is going over to the BADI for PR and rest of the code is working fine.
But the error message is not getting displayed for PR amendment.
Can anybody please suggest the possible cause of problem and some solution to it.
Thanks in advance.
Hello Experts,
I am facing a strange problem in BADI.
The requirement is that the user should not be allowed to change the plant field
on the screen of standard MM transctions for PO/PR amendment.
I have written the code in separate BADIs for PO and PR.
I am displaying an error message if the user tries to change the field.
For PO, it is working fine.But for PR, the same code is not working.
The control is going over to the BADI for PR and rest of the code is working fine.
But the error message is not getting displayed for PR amendment.
Can anybody please suggest the possible cause of problem and some solution to it.
Thanks in advance.
2007 Jul 26 7:47 AM
Hi,
In BADI u cannt raise Error Messages but u can Post the Messages to Application Logs, So u have to Update ur messages to CT_LOG.
Regards
2007 Jul 26 7:47 AM
Hi
See the sample BADI code for PR which raises an exceptions and do accordingly
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 26 12:09 PM
Hello Radhika,
Which BADI are you using for validating your PR? Anyway, I believe you can use ME_PROCESS_REQ_CUST~PROCESS_ITEM In here, you can trigger messages.
But you must have the include:
INCLUDE mm_messages_mac.Then to call your message you can use this:
mmpur_message_forced <Message type>
<Message ID>
<Message No>
<sy-msgv1>
<sy-msgv2>
<sy-msgv3>
<sy-msgv4>.Hope this helps...
Best regards,
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |