Application Development 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: 

ALV display.

Former Member
0 Kudos
140

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.

8 REPLIES 8

Former Member
0 Kudos
116

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.

0 Kudos
116

Could you please explain how?

Presently though the internal table is empty,I don't get the message.

Thanks,

Sandeep.

Former Member
0 Kudos
116

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

former_member223537
Active Contributor
0 Kudos
116

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

Former Member
0 Kudos
116

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

S0025444845
Active Participant
0 Kudos
116

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

Former Member
0 Kudos
116

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

Former Member
0 Kudos
116

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.