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

FM to validate input

Former Member
0 Likes
1,509

hi

Can anybody suggest me with FM to validate given input( field should accept input form the table) and throw an error incase user has entered worng data.

<removed_by_moderator>

regards,

Saipriya.

Edited by: Julius Bussche on Aug 26, 2008 1:03 PM

5 REPLIES 5
Read only

Former Member
0 Likes
884

Hi supriya,

To validate the field you can give F4 help to it and pass the internal table to it, which has valid entries. or

you can put a SELECT SINGLE <> to the entry from that table, if sy-subrc eq 0 then data is valid.

hope its helpfull.

<removed_by_moderator>

Amresh

Edited by: Julius Bussche on Aug 26, 2008 1:03 PM

Read only

Former Member
0 Likes
884

Hi,

Please mention which fields you want to validate.

regards

jana

Read only

Former Member
0 Likes
884

Hi,

There is no function module available. You can validate in

AT SELECTION-SCREEN ON <field> event.

Regards,

Bhaskar

Read only

Former Member
0 Likes
884

Hi,

parameters:

P_carrid type s_carr.

at selection-screen.

select single

carrid

into w_carrid

where carrid = p_carrid.

if sy-subrc ne 0.

ur error message

endif.

Hope it helps you.

Regards

Manjari..

Read only

Former Member
0 Likes
884

hiii

there is no such FM which can validate entered value..but yes you can enter some already validated values by using following FM

F4_FIELD_ON_VALUE_REQUEST

F4IF_FIELD_VALUE_REQUEST

F4IF_INT_TABLE_VALUE_REQUEST

F4IF_START_VALUE_REQUEST

and you can also validate entered value by using select query for that entered value like

CHECK s_matnr IS NOT INITIAL.

  SELECT matnr
    INTO w_matnr
    FROM mara
    UP TO 1 ROWS
    WHERE matnr IN s_matnr.
  ENDSELECT.

  CHECK sy-subrc NE 0.

  SET CURSOR FIELD 'S_MATNR'.
  MESSAGE e010(zmsg).                  " Invalid Material

regards

twinkal