i have made user exit program. program logic is as follows.
we maintain a 'z' table with material code & WBS element and when ever we create a p.o with account assingment 'q'. it needs to check the 'z' table whether the material code along with wbs are maintained. for example : if material code Agg1002 & WBS element cbb.009.1 are mainteined in th table it should allow the P.O to post. But if i give a material code whcih is not maintained in table for example Agg1001 for that WBS i should get the error message as material code not maintained in the table. and once adding the material code in the 'z' table only it should allow.
Here i used a exit pgm MM06E005 and function exit EXIT_SAPMM06E_017. But i am not able to get the correct result. And the problem i am facing is whenver i give a wrong material first i am getting the error msg as "material not maintained in table" which is correct, but when i replace that material with a correct material also i am getting the same error as material not mainatined. this also happening vise-versa that is when i give a correct material code and i am getting the correct msg. but when i replace that with wrong materila code i still getting that material maintained in table.
Pls help me with this issue. If there is any other user exit programs available pls let me know. or if there is any other alternate solution pls let me know.