‎2008 Aug 08 5:46 AM
Hi all,
I need to validate a field which has got F4 help. The field is accepting values which are in the f4 help value list.It is also accepting values other than the f4 help values(values typed by the user), which it should not. How do i make it not to accept values which are not f4 help values.
Thanks.
‎2008 Aug 08 6:12 AM
Hi
If it is a selection screen then you can add the "VALUE CHECK" addition to the PARAMETER:
Eg.. Parameters: VBELN TYPE VBAK-VBELN VALUE CHECK.
Hope it helps.
Murthy
‎2008 Aug 08 5:49 AM
Hello,
Can you tell which field you are trying to validate in the selection-screen?
BR,
Suhas
‎2008 Aug 08 5:51 AM
Hello
Try this.
*----------------------------------------------
AT SELECTION-SCREEN ON VALUE-REQUEST FOR selection_screen_field_name.
*-----------------------------------------------------------------------
*----------------------------------------------
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
object_type = 'type'
object_name = selection_screen_field_name
suppress_selection = 'X'
use_alv_grid = ''
without_personal_list = ''
IMPORTING
object_name_selected = selection_screen_field_name
EXCEPTIONS
cancel = 1.
Thanks
Anirudh Saini
‎2008 Aug 08 5:51 AM
‎2008 Aug 08 5:51 AM
Hi,
You will be selecting list of values to be populated in F4 help. populate that in to temporary internal table and validate the value selected in the screen with that of the temp internal table.
Thanks & Regards,
Madhu
‎2008 Aug 08 5:52 AM
One way is you can create dropdown but if values are many then it will be very lenthy.
Other way you can set validation in that field but of course only after entering value, I think there is no way to accept only those values from the user which are there in f4 help.
Regards
Bikas
‎2008 Aug 08 6:12 AM
Hi
If it is a selection screen then you can add the "VALUE CHECK" addition to the PARAMETER:
Eg.. Parameters: VBELN TYPE VBAK-VBELN VALUE CHECK.
Hope it helps.
Murthy
‎2008 Aug 08 6:14 AM
I would recommend you to use below method to validate screen fields.
AT-SELECTION SCREEN.
Select * From <table> where <field_name> IN <s_screen_field>.
IF sy-subrc <> 0.
message e000(ZRAM) with 'Please enter correct input'.
ENDIF.
rgds
rajesh
‎2008 Aug 08 6:25 AM
Hi,'
In such cases best to use drop down list, but if the list is too big then no point in using it.
In such case we can write a query and validate :
AT-SELECTION SCREEN.
Select *
From mara
where matnr IN s_matnr.
into table i_itab.
IF sy-subrc 0.
message e001(zz1) with 'Please enter correct input'.
ENDIF.
hope this helps you.
thanx,
dhanashri.