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: 

User exit for ME21N

Former Member
0 Kudos

Hi Everyone,

My requirement is to implement a user exit which gives out an error if the plants on different line items are different. All the line items should have the same plant as line item '10'. If line item 20 has a different plant other than line item 10, then should be an error message popping up.

Anyone has any ideas of a user exit which will help me to do this??

Thanks

Kumar.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try enhancement MM06E005 -> EXIT_SAPMM06E_012.

In which you can use table TEKPO.

i think this will help you....

10 REPLIES 10

former_member188685
Active Contributor
0 Kudos

check the BADI ME_PO_PROCESS_CUST. search with this BADI name in this forum.

Former Member
0 Kudos

Try going for some implicit enhancements

you can go for dat by going fo enchancement mode and checking possible enhancements and inserting your code

The logic should be some thing liek dis

Check out the Internal table/Go for enw one which gets all data and loop it up

and check plant name for all line items

if possible try using flags

thanks

shiva

Former Member
0 Kudos

Hi,

The procedure to find a badi for a transaction is

1) Go to the transaction SE37 to find your function module.

2) Locate the function SXV_GET_CLIF_BY_NAME.

3) Put a breakpoint there.

4) Now open a new session.

5) Go to your transaction.

6) At that time, it will stop this function.

7) Double click on the function field EXIT_NAME.

😎 That will give you name of the BADI that is provided in your transaction.

And check user exits in smod for ME package.

Rhea.

Former Member
0 Kudos

Hi,

Try enhancement MM06E005 -> EXIT_SAPMM06E_012.

In which you can use table TEKPO.

i think this will help you....

0 Kudos

I have the used the BADI as Vijay suggested and the concept is working for ME21N. But still I can go and change the plant in ME22N which defeats the whole purpose.

Can anyone suggest anything here??

Thanks

Kumar.

0 Kudos

Hi Kumar ,

may be u need to recheck ur code , for more info , please ref vijays's posting on the same issue , how to set Item to Invalid in case of any errros .

or check the sample code of those methods.

SE18->definition->display->GOTO->sample code-.display->here u select of which method u want to see the sample code.

regards

Prabhu

0 Kudos

you need to restrict the same for ME22N also. may be you have coded for ME21 transaction alone. Just debug and find what is happening.

0 Kudos

@Vijay

The problem is:

If I use the BADI, and change the plant of line item 20, only that line item is being populated in get_item internal table and hence I cannot compare it with line item 10.

If I use the user exit for my enhancement, I get both line items 10 and 20 but WERKS still has the previous value and not the changed value in tekpo internal table. So I am not able to use this either.

Thanks

Kumar.

0 Kudos

ok, in this case some how you need to capture the item details, you can capture the records using the field-symbols or using the database (only incase of ME22N transaction)

0 Kudos

I would suggest using the check method instead. From the header you can get the list of items and then loop into each item and get data, and then compare the plants.

A similar scenario was dsicussed in one other thread. Check for Uwe answer in this thread: