2012 Dec 10 7:14 AM
Dear SAPGurus ,
I have implemented Exit MGA00001 for making validation while maintaining Profit Centre when a Material is created based on Plant.
I am maintaining Plant and Profit Centre linking in ZTABLE .
Everything is working fine while the user tries to maintain Profit Centre in the view Costing 1 of MM01.
But when the User maintains Profit Centre in the view Sales: General/Plant ( without maintaining in Costing 1 view )as shown below :
An error alert is coming with no message like shown below and the user is not allowed to proceed.
I have checked for any earlier enhancements made on MM01 . But failed to find out the reason for the same.
2012 Dec 10 9:00 AM
Hello Sijin ,
Check this portion of your code :
if wmara-mtart <> '1800'.
if wmbew-bklas eq space.
message e000(00) with 'Please maintain Valuation Class'.
endif.
endif.
I think this message will always be a blank always.
Check it.
2012 Dec 10 7:24 AM
can you please give here the code you have written in the Exit MGA00001?
2012 Dec 10 7:29 AM
Hi RITWIK ,
Very thanks for your prompt reply.
Below is my code :
TABLES: ZWERKSPRCTR.
DATA : WA_WERKSPRCTR TYPE ZWERKSPRCTR.
CLEAR : WA_WERKSPRCTR.
if wmara-mtart <> '1800'.
if wmbew-bklas eq space.
message e000(00) with 'Please maintain Valuation Class'.
endif.
endif.
IF WMARC-PRCTR IS NOT INITIAL.
SELECT SINGLE WERKS PRCTR
FROM ZWERKSPRCTR
INTO WA_WERKSPRCTR
WHERE WERKS = WMARC-WERKS
AND PRCTR = WMARC-PRCTR.
IF SY-SUBRC NE 0.
MESSAGE E001(000) WITH 'Please maintain Correct Profit Centre for Plant' WMARC-WERKS.
ENDIF.
ENDIF.
If I am deactivating the Project ( CMOD ) then this problem is not coming but if I am activating the Project the problem persists , this makes me sure that this exit is the root cause of this problem.
But debugger is not getting to this point when I am maintaining PRCTR in Sales: General/Plant view.
2012 Dec 10 7:31 AM
This makes me think that my code is not the reason for this problem instead activating the Project containing Customer Exit MGA00001 is creating the problem.
I don't know how?
2012 Dec 10 7:42 AM
Why are you using this statement -
TABLES: ZWERKSPRCTR.
Is this necessary. Please comment this and try.
2012 Dec 10 8:37 AM
2012 Dec 10 8:59 AM
Hi Sijin,
please check with this Code .
TABLES : ZWERKSPRCTR.
IF wmarc-prctr IS NOT INITIAL.
SELECT SINGLE *
FROM ZWERKSPRCTR
WHERE
werks = wmarc-werks
AND prctr = wmarc-prctr.
IF sy-subrc <> 0.
MESSAGE E001(000) WITH 'Please maintain Correct Profit Centre for Plant' WMARC-WERKS.
ENDIF.
ENDIF.
Regard's
Smruti
2012 Dec 10 9:00 AM
Hello Sijin ,
Check this portion of your code :
if wmara-mtart <> '1800'.
if wmbew-bklas eq space.
message e000(00) with 'Please maintain Valuation Class'.
endif.
endif.
I think this message will always be a blank always.
Check it.
2012 Dec 10 9:09 AM
Hello Ashish ,
Yes that code was the reason.
It was written by the earlier developer , so I was not considering that code.
Thank You All for your time.
2012 Dec 10 9:11 AM
Hai Sijin,
Just click on the Error message and find out which msg is triggering..
Then you will come to know about the statement where the problem exists...
Thanks ,
Anoop
2012 Dec 10 9:19 AM
Hello Anoop ,
I have sorted out the issue.
Actually the double click on the message was also not working.
Thanks for your reply