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

Selection screen & Message

Former Member
0 Likes
1,171

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,141

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

10 REPLIES 10
Read only

Former Member
0 Likes
1,141

AT SELECTION-SCREEN.

IF SY-UCOMM = 'ONLI'.

" Fetching data into ITAB

IF ITAB[] IS INITIAL.

MESSAGE 'No data found' TYPE 'E'.

ENDIF.

ENDIF.

Read only

Former Member
0 Likes
1,141

Hi,

Please use this message in the event

AT SELECTION-SCREEN.

<SELECT QUERY TO CHECK DATA EXISTENCE>

<MESSAGE CODE>

Regards,

Ameet

Read only

Former Member
0 Likes
1,141

did u write your condition in START-OF-SELECTIOn event?

Regards

Mohan

Read only

Former Member
0 Likes
1,141

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

Read only

Former Member
0 Likes
1,141

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,141

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

Read only

Former Member
0 Likes
1,141

hi you write..

at selection-screen.

*RETRIVE DATA IN ITAB

IF ITAB[] IS INITIAL.

MESSAGE EOO1(MSGCALSS).

ENDIF.

Read only

Former Member
0 Likes
1,141

example

IF itab[] IS INITIAL.

MESSAGE e001(38) WITH 'Please Enter Transporter'.

ENDIF

Read only

Former Member
0 Likes
1,142

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

Read only

Former Member
0 Likes
1,141

thanks