‎2007 Oct 15 11:17 AM
hi all,
i'm new to abap, plz guide, i've one selection field on selection screen but that field is not existing in database, i declared it as data type p in my simple report , now i've to display error message using se91 if entry in that field is 0 or any invalid character , i'm not getting syntax what to write in report.
‎2007 Oct 15 11:19 AM
Hi,
If there is already a message defined in the Message class using SE91, then u need to write the following code:
AT SELECTION-SCREEN on FIELD1.
if field1 = 0.
message e000(0k) with 'Invalid data'.
endif.
Here 000 is the message number and 0k is the message class. If u have a message defined in a message class, then u can use that.
Regards,
Himanshu
‎2007 Oct 15 11:19 AM
Hi,
If there is already a message defined in the Message class using SE91, then u need to write the following code:
AT SELECTION-SCREEN on FIELD1.
if field1 = 0.
message e000(0k) with 'Invalid data'.
endif.
Here 000 is the message number and 0k is the message class. If u have a message defined in a message class, then u can use that.
Regards,
Himanshu
‎2007 Oct 15 12:09 PM
Message <text> type 'A'.
Example:
Message 'This value not allowed' type 'A'.
‎2007 Oct 15 12:13 PM
Hi
if you want display t he error messages then follw this procedure
use message class in ur program like this
REPORT ZNNR_REPORT NO STANDARD PAGE HEADING <b>MESSAGE-ID ZNNR</b> LINE-SIZE 100 LINE-COUNT 65(4).
diplsying messages like this
***************SCREEN VALIDATIONS *****************
at selection-screen.
SELECT SINGLE *
FROM EKKO
INTO EKKO
WHERE EBELN IN S_EBELN.
<b> IF SY-SUBRC <> 0.
SET CURSOR FIELD 'S_EBELN-LOW'.
MESSAGE E999 WITH TEXT-005.
ENDIF.</b>
********end of screen validation*****************
you can write any type eror messages here
<b>Reward if usefull</b>
‎2007 Oct 15 12:19 PM
Hi,
Sample code
select hkont from bseg
into v_hkont
up to 1 rows
where hkont = o_hkont.
endselect.
if sy-subrc <> 0.
message e000 with 'G/L Account does not exist'(001).
endif.
Reward if useful.
‎2007 Oct 15 2:23 PM
Hi,
If you are selecting some records into internal table at that
you can check tht if there are no records then you can display like this.
IF SY-SUBRC <> 0.
MESSAGE 'NO RECORDS FOUND' TYPE 'E'.
ENDIF.
Regards,
Dhruv Shah