‎2006 Jul 05 10:33 PM
HI,
this is program i got and trying to execute..
REPORT sapbc400tss_itab_loop .
DATA: it_spfli TYPE sbc400_t_spfli.
DATA: wa_spfli TYPE spfli.
START-OF-SELECTION.
SELECT * FROM spfli INTO TABLE it_spfli.
IF sy-subrc = 0.
LOOP AT it_spfli INTO wa_spfli.
WRITE: / wa_spfli-carrid,
wa_spfli-connid,
wa_spfli-cityfrom,
wa_spfli-cityto,
wa_spfli-deptime,
wa_spfli-arrtime.
ENDLOOP.
ENDIF.
Its saying Type "sbc400_t_spfli" is unknown, i doubled click on that to check, but it does't exists. How to create that type sbc400_t_spfli, whats the syntax..
Thanks
‎2006 Jul 05 10:43 PM
You can also:
DATA: it_spfli TYPE spfli_tab.
DATA: wa_spfli TYPE spfli.
START-OF-SELECTION.
SELECT * FROM spfli INTO TABLE it_spfli.
IF sy-subrc = 0.
LOOP AT it_spfli INTO wa_spfli.
WRITE: / wa_spfli-carrid,
wa_spfli-connid,
wa_spfli-cityfrom,
wa_spfli-cityto,
wa_spfli-deptime,
wa_spfli-arrtime.
ENDLOOP.
ENDIF.Rob
PS - If you change your thread to a question, you might get more responses.
Message was edited by: Rob Burbank
‎2006 Jul 05 10:38 PM
types: sbc400_t_spfli type standard table of spfli.
add this statement right after report statement.
Otherwise declare it_spfli as an internal table.
data: it_spfli like spfli occurs 0.
declare
thanks,
Rajesh.
Message was edited by: Rajesh Mandalapu
‎2006 Jul 05 10:38 PM
Can you try like below
DATA: it_spfli <b>LIKE</b> sbc400_t_spfli
or
DATA: it_spfli like spfli
Regds
Manohar
Message was edited by: Manohar Reddy
‎2006 Jul 05 10:41 PM
Hello Sir,
You need a book ---> Learn abap here
http://cma.zdnet.com/book/abap/index.htm
REPORT sapbc400tss_itab_loop .
DATA: it_spfli LIKE spfli occurs 0 with header line.
DATA: wa_spfli LIKE spfli.
START-OF-SELECTION.
SELECT * FROM spfli INTO TABLE it_spfli.
IF sy-subrc = 0.
LOOP AT it_spfli INTO wa_spfli.
WRITE: / wa_spfli-carrid,
wa_spfli-connid,
wa_spfli-cityfrom,
wa_spfli-cityto,
wa_spfli-deptime,
wa_spfli-arrtime.
ENDLOOP.
ENDIF.
‎2006 Jul 05 10:43 PM
You can also:
DATA: it_spfli TYPE spfli_tab.
DATA: wa_spfli TYPE spfli.
START-OF-SELECTION.
SELECT * FROM spfli INTO TABLE it_spfli.
IF sy-subrc = 0.
LOOP AT it_spfli INTO wa_spfli.
WRITE: / wa_spfli-carrid,
wa_spfli-connid,
wa_spfli-cityfrom,
wa_spfli-cityto,
wa_spfli-deptime,
wa_spfli-arrtime.
ENDLOOP.
ENDIF.Rob
PS - If you change your thread to a question, you might get more responses.
Message was edited by: Rob Burbank
‎2006 Jul 05 11:42 PM
Hi,
The Program goes like this,
REPORT Z_ITAB_LOOP.
TYPES: SBC400_T_SPFLI TYPE STANDARD TABLE OF SPFLI.
*Note STANDARD TABLE is one of the Internal Tables Types,
*to gain more, place cursor on it and press F1
DATA: IT_SPFLI TYPE SBC400_T_SPFLI.
DATA: WA_SPFLI TYPE SPFLI.
START-OF-SELECTION.
SELECT * FROM SPFLI INTO TABLE IT_SPFLI.
IF SY-SUBRC = 0.
LOOP AT IT_SPFLI INTO WA_SPFLI.
WRITE: / WA_SPFLI-CARRID,
WA_SPFLI-CONNID,
WA_SPFLI-CITYFROM,
WA_SPFLI-CITYTO,
WA_SPFLI-DEPTIME,
WA_SPFLI-ARRTIME.
ENDLOOP.
ENDIF.
Note: Program will display only record without Field Lables.
Better to gain knowledge on basics first.
Goodday.
‎2006 Jul 05 11:42 PM
HI Jen,
Do this way ...
DATA: IT_SPFLI LIKE SPFLI OCCURS 0.
DATA: WA_SPFLI TYPE SPFLI.
START-OF-SELECTION.
SELECT * FROM SPFLI INTO TABLE IT_SPFLI.
IF SY-SUBRC = 0.
LOOP AT IT_SPFLI INTO WA_SPFLI.
WRITE: / WA_SPFLI-CARRID,
WA_SPFLI-CONNID,
WA_SPFLI-CITYFROM,
WA_SPFLI-CITYTO,
WA_SPFLI-DEPTIME,
WA_SPFLI-ARRTIME.
ENDLOOP.
ENDIF.Regards,
Santosh