2009 Jan 28 4:31 PM
Hi Gurus
How can we get a line in the alv grid saying "No data selected!" in the alv grid when the table i pass to reuse_alv_grid is empty...
He wants the field catalog every thing as usuall... but need a satetment, where data would have been there...
Thanks..
2009 Jan 28 4:35 PM
Hi,
IF it_outtab(u r final inrenal table) is initial.
create to another fieldcatalog with the one empty line.
then call reuse alv grid once again with this fieldcatalog other wise.
endif.
Thanks,
Hi Gurus
How can we get a line in the alv grid saying "No data selected!" in the alv grid when the table i pass to reuse_alv_grid is empty...
He wants the field catalog every thing as usuall... but need a satetment, where data would have been there...
Thanks..
2009 Jan 28 4:35 PM
Hello J@Y,
Can you not use END_OF_LIST for this purpose. Just an idea, i have to try & see.
BR,
Suhas
2009 Jan 28 4:35 PM
Hi,
IF it_outtab(u r final inrenal table) is initial.
create to another fieldcatalog with the one empty line.
then call reuse alv grid once again with this fieldcatalog other wise.
endif.
Thanks,
2009 Jan 28 4:35 PM
Try with
APPEND INITIAL LINE TO itab.It will dsiplay only one empty line.
Regards
Marcin
Sorry I misunderstood your query
Edited by: Marcin Pciak on Jan 28, 2009 5:39 PM
2009 Jan 28 4:36 PM
You could use one big text field already present to put a "No Data selected" and append a record to the empty table if it had no data.
2009 Jan 28 4:39 PM
SAP Std reports does that.... I dont want to go alternative methods(use other table/use append and all)... If I am right, there should be some event we can use....
2009 Jan 28 4:43 PM
Hi,
If you want to display the message if the internal table is empty. then you need to write the code.
END-OF-SELECTION.
IF NOT itab[] IS INITIAL.
CALL SCREEN 100. " Display alv if internal table has data
ELSE.
MESSAGE I016(PN) WITH 'No Date selected'.
EXIT.
ENDIF.
2009 Jan 28 4:49 PM
2009 Jan 28 4:55 PM
Hello Jay,
Does this fit your bill?
IF fp_it_final IS INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_html_end_of_list = 'END_OF_LIST'
is_layout = fp_st_layout
it_fieldcat = fp_it_fieldcat
it_sort = fp_it_sort
i_save = 'A'
TABLES
t_outtab = fp_it_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Error in calling Standard ALV Functional Module
MESSAGE i036. "Error Occured in ALV Function Module
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
ENDFORM. " F_DISPLAY_ALV
*&---------------------------------------------------------------------*
*& Form END_OF_LIST
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM end_of_list USING cl_dd TYPE REF TO cl_dd_document.
CALL METHOD cl_dd->add_text
EXPORTING
text = 'This table is Initial'
sap_style = cl_dd_area=>heading
sap_fontsize = cl_dd_area=>large
sap_color = cl_dd_area=>list_heading_int.
ENDFORM. "END_OF_LIST
Plz revert back.
BR,
Suhas
2009 Jan 28 5:49 PM
Hi...
Not exactly...I am expecting the line just under the Header of ALV.. but it was helpful..thanks.
example: BCALV_TEST_LIST_FIELDS
2009 Jan 28 6:28 PM
2009 Mar 05 8:40 AM
u can display message simply as 'no data selected'
message id 'id' type 'I' number '000' or message id with ' no data selected'
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |