‎2008 Oct 20 8:03 AM
i want to throw an error message based on the values of a field
now if the field is wrong value then the user should get an error message
but the user should be able to correct the value and proceed and not procceed withoud correcting
the error message should not throwhim out of the transaction
‎2008 Oct 20 8:06 AM
Hi,
Use message of type 'E'.
like Message 'Enter value' type 'E'.
Thanks & Regards,
Navneeth K.
‎2008 Oct 20 8:09 AM
‎2008 Oct 20 8:09 AM
Hi..,
User can use Type 'E' message and Type 'W' messags.
But let me know..,
Is it in Report selection screen or In screen programming?
Thanks,
Naveen.I
‎2008 Oct 20 8:22 AM
‎2008 Oct 20 8:14 AM
hi,
use MESSAGE with MESSAGE TYPE 'E'.
like:
paameters p_name type string.
if p_name is initial.
message 'please enter name' type 'E'.
endif.
if one don't enter ny value in the field p_name then message 'please enter name' will occur and once the error is corrected th code will execute ..
‎2008 Oct 20 8:15 AM
Hi Sushant,
If you want to correct the value entered in that case u need to give an information message type 'I' bcoz error message will not let u to correct the entered value.
Thanks & Regards
Ashu Singh
‎2008 Oct 20 8:15 AM
Hi
Anyway If it is the report use this validation part in AT SELECTION_SCREEN event.
Check following sample code:
data: p_data(4).
parameters: s_data like p_data.
at SELECTION-SCREEN.
if s_data = 'TEST'.
write:/ 'User entered TEST as input'.
else.
message 'Enter the correct input' type 'E'.
endif.Thanks,
Naveen.I
‎2008 Oct 20 8:17 AM
If you are using it in module pool programming. You have to code in under Chain..Endchain Statement. So that the field doesnt get grayed out and is available for input in edit mode.
For example:
In PAI write:
Chain.
field f1 module validate.
Endchain.
in Validate module give error message.
‎2008 Oct 20 8:31 AM
Hi,
plz check the following code
AT SELECTION-SCREEN.
IF FLD_VAL = 'X'.
MESSAGE E001(ZSDC).
ENDIF.
START-OF-SELECTION.
IF FLD_VAL = 'X'.
MESSAGE E001(ZSDC).
LEAVE LIST-PROCESSING.
ENDIF.
‎2008 Oct 20 8:31 AM