Application Development and Automation 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: 
Read only

Field exits

Former Member
0 Likes
402

Hi All,

I have created a field exit for data element(MATKL) and inside the field exit function module i have done a validation and raised an error message.

When i m exectuing the transactions such as MM01/02 or any other transaction, the error message is triggering and the field exit is working fine.

Now i have a requirement that this validation should neglect/not consider one particular transaction(eg: OMSF or ME21 assume) and allow me to enter any value for MATKL field in that particular tranascation.

I tried to add my validation inside the field exit function module by checking sy-tcode...

i.e

***********************************************************

check not sy-tcode='ME21'

........<My field exit validation>........

end function.

*******************************************************

but in this case the sy-tcode value is alwasys SE37 as i m validating inside the FM.

Please help me to exclude a particular transaction(s) while validating the field exit

Regards

Shiva

Hi All,

I have created a field exit for data element(MATKL) and inside the field exit function module i have done a validation and raised an error message.

When i m exectuing the transactions such as MM01/02 or any other transaction, the error message is triggering and the field exit is working fine.

Now i have a requirement that this validation should neglect/not consider one particular transaction(eg: OMSF or ME21 assume) and allow me to enter any value for MATKL field in that particular tranascation.

I tried to add my validation inside the field exit function module by checking sy-tcode...

i.e

***********************************************************

check not sy-tcode='ME21'

........<My field exit validation>........

end function.

*******************************************************

but in this case the sy-tcode value is alwasys SE37 as i m validating inside the FM.

Please help me to exclude a particular transaction(s) while validating the field exit

Regards

Shiva

2 REPLIES 2
Read only

messier31
Active Contributor
0 Likes
377

Hi Shiva,

What i think can be done is in transaction ME21. Try to find some user exit which is called very early in me21 ( may be in pbo ..befor user enters any data on screen).

Now in this user exit make use of SET PARAMETER to assign some value like transaction code to some variable. this will be stored in SAP memory...

Now in ur field exit validation .. mke use of GET PARAMETER to retirve value of the variable u assigned some value in ME21 userexit..

For transaction ME21 it will contain some value and for all other transaction it will be initial.. thus you can distinguish between different transaction and mae necessary validtion...

Hope this helps ..let me know if need more inputs on this...

Enjoy SAP.

Pankaj Singh.

Read only

Former Member
0 Likes
377

Hi,

I see no problem in checking sy-tcode within a fieldexit.It always works.When executing txn ME21 it should always show the value of sy-tcode as ME21.

Have you assigned the pgm & dynpro correctly ?

Can you send your source code ?

I think the better option is to code this within an userexit/ BAdI.There are numerous userexits/BAdIs in MM01/MM02.

Pravat.