2007 May 29 10:57 AM
Hi,
I am using an ALV grid display for a report output.
I want to display a text in the grid stating that "No records found".
Is it possible to display a text in the ALV grid as such? If yes,then how cab we do it?
Please help.
Thanks,
Sandeep.
2007 May 29 11:01 AM
Hi,
by default u will get the message "no records found" if there is no data in the alv grid.
u don't need to write any code for that.
rgds,
bharat.
2007 May 29 11:05 AM
Could you please explain how?
Presently though the internal table is empty,I don't get the message.
Thanks,
Sandeep.
2007 May 29 11:02 AM
Hi Sandeep ,
If you want it this way , then you need to create another internal table , this internal table will contain the error message and then call the ALV using this interna table. So in this case you will have two catalogs and internal tables , one when data is there and the other when no data is selected.
Regards
Arun
2007 May 29 11:04 AM
Hi,
Do it this way. Say i_output is the internal table which has all the data to be displayed in ALV.
then,
if not i_output[] is initial.
call function 'REUSE_ALV_GRID_DISPLAY'.
else.
message 'No Records found !!' type i.
endif.
Best regards,
Prashant
2007 May 29 11:06 AM
Hi sandeep
Sorry just now i understood ur problem then its best to go as said above
as declaring function module and then typing an error msg in the next statement
Regards
Pavan
Message was edited by:
pavan praveen
2007 May 29 11:23 AM
Hi,
It should be done this way only
if it_out is final output internal table then
if not i_out[] is initial.
call function 'REUSE_ALV_GRID_DISPLAY'.
else.
message 'No Records found !!' type 'I'.
endif.
regards,
Sudha
2007 May 29 11:27 AM
Hi,
Check the sample program in the following link:
http://www.sap-img.com/abap/example-of-a-simple-alv-grid-report.htm
Regards,
Bhaskar
2007 May 29 11:47 AM
hi sandeep,
just do as follows,
if not <itab>[] is initial.(this is final internal table which is passed into FM list display)
call function 'reuse_alv_list_display'
-
-
-
-
-
esle.
message i001(message class)."no records found
endif.
regards,
seshu.
endif.