‎2008 May 19 1:57 PM
Hi,
I want to validate one of the field in ME21n transaction .
How is it possible by using filed-exit(program RSMODPRF).
what are the prereqisition for filedexit.i have created filed exit for data element BEDNR .but it was not getting triggered whil i was executing trasaction me21n and entering the value.can u please help me in this regard.
Regards,
Sunil.K
‎2008 May 19 2:29 PM
Hi Sunil,
1.Enter the tcode SE38
2.In the ABAP Editor enter the program name RSMODPRF
3.Execute
4.Then you will get a screen with Data Element and Number of Field Exit
Here enter the Data Element(as per your requirement for example MATNR for material no.) and
enter 0 to 9 or A to Z in the second field(I am taking 0 in my example)
5. Execute
6.Then you will be navigated to the Function Builder screen(se37) with FM name FIELD_EXIT_MATNR_0
The FM name contains the Data Element(MATNR) and No. of Field Exit (0) (in this case)
7.Then click on CREATE.
8.Give the Fun. Grp name and SAVE
9.It will take youn to the Source code wherein ypu have to write the code asb per your requirement
For Example:
FUNCTION FIELD_EXIT_MATNR.
IF INPUT BETWEEN 125 AND 150.
MESSAGE E000(ZMM) WITH "Material not allowed".
ENDIF.
ENDFUNCTION.
10.Then if you try to enter the values in MM01 for Material no.,this effect comes into picture
If you enter Material no between 125 and 150 you will get "Material not allowed".
or
One more way to do this is goto tcode CMOD.
Enter PRFB in the command prompt and press ENTER
In the screen select the menu Field exit --> Create and follow the same procedure as above.
****Reward points if found useful
Regards,
Naresh
‎2008 May 19 2:04 PM
Hi,
Check these links:
https://forums.sdn.sap.com/click.jspa?searchID=11931235&messageID=4069010
https://forums.sdn.sap.com/click.jspa?searchID=11931235&messageID=3035499
Regards,
Shiva Kumar
‎2008 May 19 2:29 PM
Hi Sunil,
1.Enter the tcode SE38
2.In the ABAP Editor enter the program name RSMODPRF
3.Execute
4.Then you will get a screen with Data Element and Number of Field Exit
Here enter the Data Element(as per your requirement for example MATNR for material no.) and
enter 0 to 9 or A to Z in the second field(I am taking 0 in my example)
5. Execute
6.Then you will be navigated to the Function Builder screen(se37) with FM name FIELD_EXIT_MATNR_0
The FM name contains the Data Element(MATNR) and No. of Field Exit (0) (in this case)
7.Then click on CREATE.
8.Give the Fun. Grp name and SAVE
9.It will take youn to the Source code wherein ypu have to write the code asb per your requirement
For Example:
FUNCTION FIELD_EXIT_MATNR.
IF INPUT BETWEEN 125 AND 150.
MESSAGE E000(ZMM) WITH "Material not allowed".
ENDIF.
ENDFUNCTION.
10.Then if you try to enter the values in MM01 for Material no.,this effect comes into picture
If you enter Material no between 125 and 150 you will get "Material not allowed".
or
One more way to do this is goto tcode CMOD.
Enter PRFB in the command prompt and press ENTER
In the screen select the menu Field exit --> Create and follow the same procedure as above.
****Reward points if found useful
Regards,
Naresh