‎2007 May 29 8:04 AM
Hi,
For this simple program I am not getting the output.
REPORT ZATUL_DEMO1.
data: it_spfli TYPE TABLE OF sflight ,
wa_spfli type sflight.
SELECT * from sflight INTO corresponding fields of table it_spfli.
loop at it_spfli into wa_spfli.
endloop.
WRITE : wa_spfli-CARRID.
‎2007 May 29 8:17 AM
try this...there might not be any data in table SFLIGHT
REPORT ychatest.
DATA: it_spfli TYPE TABLE OF sflight ,
wa_spfli TYPE sflight.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE it_spfli.
IF NOT it_spfli[] IS INITIAL.
LOOP at it_spfli into wa_spfli.
WRITE : / wa_spfli-carrid.
ENDLOOP.
ELSE.
WRITE : / 'No Data found'.
ENDIF.
‎2007 May 29 8:05 AM
Please check whether sflight has any data in it or not and then move write statement inside the loop....
loop at it_spfli into wa_spfli.
WRITE : wa_spfli-CARRID.
endloop.
null
‎2007 May 29 8:11 AM
I tried the write statement in side the loop . then also its not working. not gng inside the loop.
‎2007 May 29 8:14 AM
‎2007 May 29 8:06 AM
Hi Ajay,
write WRITE statement with in loop.
reward , if useful
Regards,
Bhaskar
‎2007 May 29 8:07 AM
Hi ajay,
Give write statement within the loop.
Look the below one.
*********************************************************
DATA : it_spfli LIKE STANDARD TABLE OF sflight WITH HEADER LINE.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE it_spfli.
LOOP AT it_spfli.
WRITE 😕 it_spfli-carrid.
ENDLOOP.
*********************************************************
<b>Regards,
jackie..</b>
Message was edited by:
Jackie
‎2007 May 29 8:07 AM
HI,
REPORT ZATUL_DEMO1.
data: it_spfli TYPE TABLE OF sflight ,
wa_spfli type sflight.
SELECT * from sflight INTO corresponding fields of table it_spfli.
loop at it_spfli into wa_spfli.
<b>WRITE : / wa_spfli-CARRID.</b> "putting a / will get next records in new line..
endloop.
*WRITE : wa_spfli-CARRID. this will return the last record
rewards if useful,
regards,
nazeer
‎2007 May 29 8:07 AM
Hi
Keep that write statment inside the LOOP..ENDLOOP.
Wa_spfli will have only one value at a time
incase if it doesnt have last record,it wont display.
Thanks
‎2007 May 29 8:08 AM
Hi
Do Like This.............
REPORT ZATUL_DEMO1.
data: it_spfli TYPE TABLE OF sflight ,
wa_spfli type sflight.
SELECT * from sflight INTO corresponding fields of table it_spfli.
loop at it_spfli into wa_spfli.
WRITE 😕 wa_spfli-CARRID.
endloop.
‎2007 May 29 8:10 AM
hi,
data: it_spfli TYPE TABLE OF sflight ,
wa_spfli type sflight.
SELECT * from sflight INTO corresponding fields of table it_spfli.
loop at it_spfli into wa_spfli.
WRITE : wa_spfli-CARRID.
endloop.
reward with points if helpful.
‎2007 May 29 8:13 AM
Hi
You just keep the WRITE command inside LOOP and ENDLOOP.
Since the work are is blank of the internal table is blank, you were not getting at single record displayed.
REPORT ZATUL_DEMO1.
data: it_spfli TYPE TABLE OF sflight ,
wa_spfli type sflight.
SELECT * from sflight INTO corresponding fields of table it_spfli.
IF sy-subrc = 0.
loop at it_spfli into wa_spfli.
WRITE : wa_spfli-CARRID.
endloop.
endif.
‎2007 May 29 8:14 AM
Hi,
Are you getting any error message or
Just a blank output screen.
Try it by using the above coding
which i gave..
Regards,
Jackie.
Message was edited by:
Jackie
‎2007 May 29 8:15 AM
Hi Ajay ,
Your code is working fine in my system.
So could you please check if data is selected from the select statement.
I feel no data is being selected by the SQL statement.
Regards
Arun
‎2007 May 29 8:17 AM
try this...there might not be any data in table SFLIGHT
REPORT ychatest.
DATA: it_spfli TYPE TABLE OF sflight ,
wa_spfli TYPE sflight.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE it_spfli.
IF NOT it_spfli[] IS INITIAL.
LOOP at it_spfli into wa_spfli.
WRITE : / wa_spfli-carrid.
ENDLOOP.
ELSE.
WRITE : / 'No Data found'.
ENDIF.
‎2007 May 29 8:19 AM
Hi ajay singh,
check sy-subrc before writing loop. IF sy-subrc EQ 0 then only use the loop statement.
If sy-subrc EQ 0 and still if U wont get any output it means U have the CARRID as initial. As it is a primary key this is not possible but programatically if some one has inserted some junk data this is possible. Check ur table entires once.