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 Output 'NO DATA'

former_member602116
Participant
0 Kudos

Hi Experts,

So I am using FM_REUSE_ALV_GRID_DISPLAY to display the ALV data into my report output. The internal table that contains data to be displayed is not initial which means it actually has data(per debugging). However, 'No Data' is displayed in the ALV output. Sy-subrc after going through the FM is 0, so also no program error there.

Can you please point out what's wrong with my code? I have also tried using cl_salv_table but still 'No Data' is shown. Also, I have tried manually adding data by passing strings to lt_final and passed it to the FM instead of lt_results and it worked but if data is real data obtained from program processing, 'No Data' is displayed.

ls_final-hyper_team = 'LOGISTICS'.
ls_final-hyper_task = 'DDL'.
ls_final-results = 'THIS IS ONLY A TEST PLS'.
APPEND ls_final TO lt_final.

Below is only a snippet of my code I didn't show how lt_results was populated because it was only an exporting parameter from a class I also made but here's a screenshot from the debugger.

TYPES:
  BEGIN OF ty_data,
    hyper_team   TYPE /txn/t_hyper_cls-hyper_team,
    hyper_task   TYPE /txn/t_hyper_cls-hyper_task,
    results(300),
  END OF ty_data.
DATA:
  lt_results   TYPE STANDARD TABLE OF ty_data
  lt_final     TYPE STANDARD TABLE OF ty_data,
  ls_final     TYPE ty_data,


DATA: lt_field_catalog TYPE slis_t_fieldcat_alv.
DATA: ls_field_catalog TYPE slis_fieldcat_alv.

ls_field_catalog-fieldname = 'HYPER_TEAM'.
ls_field_catalog-seltext_l  = 'Team'.
APPEND ls_field_catalog TO lt_field_catalog.
ls_field_catalog-fieldname = 'HYPER_TASK'.
ls_field_catalog-seltext_l  = 'Class'.
APPEND ls_field_catalog TO lt_field_catalog.
ls_field_catalog-fieldname = 'RESULTS'. 
ls_field_catalog-seltext_l  = 'Result'.
APPEND ls_field_catalog TO lt_field_catalog.
CALL FUNCTION 'FM_REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    it_fieldcat   = lt_field_catalog
  TABLES
    t_outtab      = lt_results
  EXCEPTIONS
    program_error = 1
    OTHERS        = 2.
IF sy-subrc EQ 0.
  "Do Nothing
ENDIF.

12 REPLIES 12

AllanGarcia55
Participant
0 Kudos

Hi Katherine,

Try to pass also the parameter below also:

i_callback_program = sy-repid

is_layout = s_layout (optional)

Sandra_Rossi
Active Contributor

Why do you use this unsupported function module?

Instead, use REUSE_ALV_GRID_DISPLAY !

Anyway, you'd see that the following little program outputs something so the issue is a bug in your program:

REPORT.
SELECT * FROM t000 INTO TABLE @DATA(itab).
cl_salv_table=>factory( IMPORTING r_salv_table = DATA(salv) CHANGING t_table = itab ). salv->display( ).

Or please explain in which context you obtain "no data".

(NB: you have maybe a default ALV layout variant with filter of rows which excludes all rows)

former_member1716
Active Contributor

kdarunday,

Can you please explain how this No data error message is being displayed?

Check if there is any default layout assigned for the report and inspect the attributes of the layout if any.

As rightly suggested by Sandra, considering this is your test program kindly avoid using this FM.

Regards!

former_member701348
Discoverer
0 Kudos

Hey, Katherine!

Have you tried populating the field "tabname" in the "ls_field_catalog"?

ls_field_catalog-tabname  = 'LT_RESULTS'.

0 Kudos

Hi Guilherme,

Already did but still same output 'No Data'.

Regards,

Kath

former_member602116
Participant
0 Kudos

Here's a screenshot when I used CL_SALV_TABLE. Same output with the FM, still No data.

mateuszadamus
Active Contributor
0 Kudos

Hello kdarunday

I just tried, and the code works on my system. If the LT_RESULTS has records.

Are you 100% sure that the table you're providing for ALV has records?

Kind regards,
Mateusz

Edit: the image with "No data" message shows a Spool resulting page. How are you executing the report? In the background?

0 Kudos

Hi Mateusz,

Yes, lt_results has records as can be seen in below screenshot.

I am actually executing it in background.

0 Kudos

here's the correct screenshot

0 Kudos

Okay, and what happens if you run the report in foreground? Do you still get the "No data" message?


Kind regards,
Mateusz

0 Kudos

Yeah, according to mateuszadamus the code is fine. I also tried and it works.

Maybe the table isn't being filled when you execute it in background. As you said, the data comes in a exporting parameter from a class. The class maybe is returning no data in this case.

Are you debugging the report while executing in background?

I don't think the problem is the report, but the class that fetchs the data.

Regards,

Sandra_Rossi
Active Contributor
0 Kudos

The spool is weird. Why do you have the 3rd column empty?