Skip to Content
Jan 03, 2012 at 04:39 AM

Validation for Select-Option - Issue


Hi Experts!!

I have a select-option s_field on which I have written a validation under AT SELECTION-SCREEN. Now, the problem is that, if validation fails in second line of s_field, then to change it when we click on Extension, it's not allowing to enter but is throwing error message again and again as AT SELECTION-SCREEN is called.

Suppose, I have entered 2 single values as C001 and F001. s_field will have 2 entries. Now, C001 is a valid value but F001 is not. PFB my code:

LOOP AT s_field.

  FROM ztable INTO ls_field
  WHERE field EQ s_field-low.

IF sy-subrc NE 0.
 " Error Message


Now, for C001, sy-subrc will be 0. But for F001 sy-subrc is 4 and hence will throw an error. Now, to correct this, I am trying to enter into extension, but as this will be called again, I am unable to. Hope I explained it clearly.

I do not see any possibility to correct this. Can anybody please suggest if any workaround can be implemented?

Your help is highly appreciable.