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: 

Help needed in displaynig error message

Former Member
0 Kudos
114

Hi to all kind souls, i am having problem with displaying error message when a invalid field is being input.

The following is my codings:

FORM insert_data.

TABLES z112_work2.

INSERT z112_work2.

IF sy-subrc = 4.

MESSAGE 'Invalid ID.' TYPE 'E'.

ELSE.

MESSAGE 'Inserted Successfully.' TYPE 'I'.

ENDIF.

ENDFORM.

i needed help on the " IF sy-subrc = 4.

MESSAGE 'Invalid ID.' TYPE 'E'. " part as when i activated it, i tried to enter a invalid value on the 1st field it worked but i couldnt enter any value at the rest of the following fields.

Edited by: yingzi huang on Dec 22, 2008 5:44 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos
87

Hi,

When you give message type 'E' then when you enter the invalid value, as the message type is 'E' the rest of the fields on the selection fields gets diabled...

Regards

Akshay

9 REPLIES 9

GauthamV
Active Contributor
0 Kudos
87

hi,

use any of these statements after your error message.


CALL SELECTION-SCREEN 1000.
LEAVE PROGRAM.

or

Leave list-processing.

Former Member
0 Kudos
87

Thx for ur offer anyway My problem is solved.

Former Member
0 Kudos
87

hi,

use MESSAGE 'Invalid ID.' TYPE 'I' Display Like 'E'.

leave list-processing.

Use above format, then other fields will be enabled for input..

Rgds.,

subash

Former Member
0 Kudos
87

Do u want to continue with the processing after the display of the message also.

with type i that is not possible.

after display of error message, processing will stop.

So try like this

Message "Ur message" type 'I' DISPLAY LIKE 'E'.

Former Member
0 Kudos
88

Hi,

When you give message type 'E' then when you enter the invalid value, as the message type is 'E' the rest of the fields on the selection fields gets diabled...

Regards

Akshay

0 Kudos
87

erm.. my problem is still exist aft i tried inserting the coding in:

IF sy-subrc = 4.

MESSAGE 'Incomplete fields.' TYPE 'E'.

LEAVE LIST-PROCESSING.

ELSE.

MESSAGE 'Inserted Successfully.' TYPE 'I'.

ENDIF.

i added the " LEAVE LIST-PROCESSING."

CAN ANYONE HELP ME?!?!?!

0 Kudos
87

hi,

give messgae as

MESSAGE 'Incomplete fields.' TYPE 'I' DISPLAY LIKE "E'.

LEAVE LIST-PROCESSING.

Rgds.,

subash

0 Kudos
87

Thanks alot! the problem is solved.=DDD

Former Member
0 Kudos
87

Try, If Sy-Subrc ne 0.

Error Message.

Endif.

Because u might get subrc value other then 4, then ur condition will fail.

Vikas.