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

Query Result Doesn't Display

Former Member
0 Likes
840

Hi All,

When i run the code below the query with SELECT statement display result as expected but other queries with LOOP and Object oriented running againt same table as that used in SELECT statement doesn't show anything, not even the output page. The status bar only showed the the program has complied without syntax error but no output page.

Please I need somebody to tell me why is the output not showing.

REPORT read_table_flights.

DATA: itab_flight TYPE STANDARD TABLE OF sflight,

wa_flight TYPE sflight,

alv TYPE REF TO cl_salv_table.

FIELD-SYMBOLS: <wa_comp> TYPE any.

SELECT *

FROM sflight INTO TABLE itab_flight

WHERE carrid = 'LH' AND seatsmax < 250 .

  • Alternative one: Loop at table and write the different components of work area

LOOP AT itab_flight INTO wa_flight.

WRITE: wa_flight-carrid,

wa_flight-connid,

wa_flight-fldate,

wa_flight-price,

wa_flight-currency,

wa_flight-planetype,

wa_flight-seatsmax,

wa_flight-seatsocc,

wa_flight-paymentsum.

skip.

endloop.

**Alternative two: Loop at table with dynamic assign of component

*LOOP AT itab_flight INTO wa_flight.

  • DO.

  • ASSIGN COMPONENT sy-index OF STRUCTURE wa_flight TO <wa_comp>.

  • IF sy-subrc <> 0.

  • SKIP.

  • EXIT.

  • ENDIF.

  • WRITE <wa_comp>.

  • ENDDO.

*ENDLOOP.

    • object oriented way

*cl_salv_table=>factory( IMPORTING r_salv_table = alv

  • CHANGING t_table = itab_flight ).

*alv->display( ).

Hi All,

When i run the code below the query with SELECT statement display result as expected but other queries with LOOP and Object oriented running againt same table as that used in SELECT statement doesn't show anything, not even the output page. The status bar only showed the the program has complied without syntax error but no output page.

Please I need somebody to tell me why is the output not showing.

REPORT read_table_flights.

DATA: itab_flight TYPE STANDARD TABLE OF sflight,

wa_flight TYPE sflight,

alv TYPE REF TO cl_salv_table.

FIELD-SYMBOLS: <wa_comp> TYPE any.

SELECT *

FROM sflight INTO TABLE itab_flight

WHERE carrid = 'LH' AND seatsmax < 250 .

  • Alternative one: Loop at table and write the different components of work area

LOOP AT itab_flight INTO wa_flight.

WRITE: wa_flight-carrid,

wa_flight-connid,

wa_flight-fldate,

wa_flight-price,

wa_flight-currency,

wa_flight-planetype,

wa_flight-seatsmax,

wa_flight-seatsocc,

wa_flight-paymentsum.

skip.

endloop.

**Alternative two: Loop at table with dynamic assign of component

*LOOP AT itab_flight INTO wa_flight.

  • DO.

  • ASSIGN COMPONENT sy-index OF STRUCTURE wa_flight TO <wa_comp>.

  • IF sy-subrc <> 0.

  • SKIP.

  • EXIT.

  • ENDIF.

  • WRITE <wa_comp>.

  • ENDDO.

*ENDLOOP.

    • object oriented way

*cl_salv_table=>factory( IMPORTING r_salv_table = alv

  • CHANGING t_table = itab_flight ).

*alv->display( ).

4 REPLIES 4
Read only

former_member196280
Active Contributor
0 Likes
785

Code looks ok.

try after re-installing the GUI.

Regards,

SaiRam

Read only

0 Likes
785

Thanks SaiRam for your prompt reply. and thanks to everyone who has read my post.

The GUI i have is fresh installation. The SELECT query is working fine but LOOP doesn't display result even when SELECT does.

Please help me.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
785

Did your select statement fetch any data ?

Read only

0 Likes
785

Thanks Keshav.T ,

Yes, the SELECT statement fetched data and the data was correct.