Application Development 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: 

error message

Former Member
0 Kudos

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

10 REPLIES 10

Former Member
0 Kudos

Hi,

Use message of type 'E'.

like Message 'Enter value' type 'E'.

Thanks & Regards,

Navneeth K.

Former Member
0 Kudos

Hi

You can try to use POP UP Function modules

Regards

Madhan

naveen_inuganti2
Active Contributor
0 Kudos

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

0 Kudos

it is screen programming

Former Member
0 Kudos

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 ..

Former Member
0 Kudos

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

naveen_inuganti2
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

thanks people.