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

Help needed in displaynig error message

Former Member
0 Likes
958

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
Read only

Former Member
0 Likes
931

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
Read only

GauthamV
Active Contributor
0 Likes
931

hi,

use any of these statements after your error message.


CALL SELECTION-SCREEN 1000.
LEAVE PROGRAM.

or

Leave list-processing.

Read only

Former Member
0 Likes
931

Thx for ur offer anyway My problem is solved.

Read only

Former Member
0 Likes
931

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

Read only

Former Member
0 Likes
931

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

Read only

Former Member
0 Likes
932

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

Read only

0 Likes
931

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?!?!?!

Read only

0 Likes
931

hi,

give messgae as

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

LEAVE LIST-PROCESSING.

Rgds.,

subash

Read only

0 Likes
931

Thanks alot! the problem is solved.=DDD

Read only

Former Member
0 Likes
931

Try, If Sy-Subrc ne 0.

Error Message.

Endif.

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

Vikas.