Application Development 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: 

Problem with Customer Exit MGA00001 ( Enhancement for MM01 )

Sijin_Chandran
Active Contributor
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

10 REPLIES 10

Former Member
0 Kudos

can you please give here the code you have written in the Exit MGA00001?

0 Kudos

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.

0 Kudos

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?

0 Kudos

Why are you using this statement -

TABLES: ZWERKSPRCTR.

Is this necessary. Please comment this and try.

0 Kudos

Hi RITWIK ,

I did as you said but the error is still there.

0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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.

former_member183835
Participant
0 Kudos

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

0 Kudos

Hello Anoop ,

I have sorted out the issue.

Actually the double click on the message was also not working.

Thanks for your reply