‎2008 Dec 22 4:44 AM
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
‎2008 Dec 22 4:59 AM
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
‎2008 Dec 22 4:51 AM
hi,
use any of these statements after your error message.
CALL SELECTION-SCREEN 1000.
LEAVE PROGRAM.
or
Leave list-processing.
‎2008 Dec 22 4:54 AM
‎2008 Dec 22 4:55 AM
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
‎2008 Dec 22 4:56 AM
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'.
‎2008 Dec 22 4:59 AM
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
‎2008 Dec 22 5:05 AM
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?!?!?!
‎2008 Dec 22 5:09 AM
hi,
give messgae as
MESSAGE 'Incomplete fields.' TYPE 'I' DISPLAY LIKE "E'.
LEAVE LIST-PROCESSING.
Rgds.,
subash
‎2008 Dec 22 5:12 AM
‎2008 Dec 22 5:09 AM
Try, If Sy-Subrc ne 0.
Error Message.
Endif.
Because u might get subrc value other then 4, then ur condition will fail.
Vikas.