‎2008 Dec 05 6:09 AM
Hi Experts,
I have one requirement that if I don't have data in my internal table ITAB then I wanted to go back to my selection screen.
Also I wrote information message for the same. But the message is not getting dispaly.
Below is the code
IF ITAB[] IS INITIAL.
MESSAGE I000) WITH TEXT-M1.
ENDIF.
could u pls tell me how I can achieve this??
‎2008 Dec 05 10:32 AM
Hi,
see below code..
start-of-selection.
select ... into itab from ...where.....
If itab[] is initial.
message 'No Data exists' type 'E'.
endif.
Regards,
vinod
‎2008 Dec 05 6:11 AM
AT SELECTION-SCREEN.
IF SY-UCOMM = 'ONLI'.
" Fetching data into ITAB
IF ITAB[] IS INITIAL.
MESSAGE 'No data found' TYPE 'E'.
ENDIF.
ENDIF.
‎2008 Dec 05 6:14 AM
Hi,
Please use this message in the event
AT SELECTION-SCREEN.
<SELECT QUERY TO CHECK DATA EXISTENCE>
<MESSAGE CODE>
Regards,
Ameet
‎2008 Dec 05 6:15 AM
did u write your condition in START-OF-SELECTIOn event?
Regards
Mohan
‎2008 Dec 05 6:15 AM
hi
i think u forgot to declare the message class id in the first line.
check it as.
REPORT YSUR_AMEND MESSAGE-ID ZMESSAGE1....
.
...
... if itab[] is initial.
message i000 .
regards
suren.s
‎2008 Dec 05 6:27 AM
Hi Poonam,
You can use SET CURSOR for this issue.
Check out this sample code.
DATA : it_vbak TYPE STANDARD TABLE OF vbak INITIAL SIZE 0 WITH HEADER LINE.
PARAMETERS : p_vbeln TYPE vbeln_va.
START-OF-SELECTION.
SELECT vbeln
erdat
erzet
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE it_vbak
WHERE vbeln = p_vbeln.
IF sy-subrc NE 0.
SET CURSOR FIELD p_vbeln.
ELSE.
loop at it_vbak.
WRITE : / it_vbak-vbeln.
endloop.
ENDIF.
Cheers.
Edited by: soumya chakraborty on Dec 5, 2008 7:27 AM
‎2008 Dec 05 6:31 AM
Hello Poonam,
Did you declare Message Class at the start of the report?
IF ITAB[] IS INITIAL.
MESSAGE I000 WITH TEXT-M1.
LEAVE LIST-PROCESSING.
ENDIF.
Hope this helps.
BR,
Suhas
‎2008 Dec 05 6:34 AM
hi you write..
at selection-screen.
*RETRIVE DATA IN ITAB
IF ITAB[] IS INITIAL.
MESSAGE EOO1(MSGCALSS).
ENDIF.
‎2008 Dec 05 9:26 AM
example
IF itab[] IS INITIAL.
MESSAGE e001(38) WITH 'Please Enter Transporter'.
ENDIF
‎2008 Dec 05 10:32 AM
Hi,
see below code..
start-of-selection.
select ... into itab from ...where.....
If itab[] is initial.
message 'No Data exists' type 'E'.
endif.
Regards,
vinod
‎2008 Dec 19 3:57 AM