Creating table type in ABAP

Go down

Creating table type in ABAP

Post  Uma_ABAP on Sat Apr 28, 2012 9:03 pm

*&---------------------------------------------------------------------*
*& Report ZCH_DEFINING_TABLE_TYPE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZCH_DEFINING_TABLE_TYPE.

TYPES: BEGIN OF TY_SPFLI,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
COUNTRYFR TYPE SPFLI-COUNTRYFR,
CITYFROM TYPE SPFLI-CITYFROM,
CITYTO TYPE SPFLI-CITYTO,
END OF TY_SPFLI.

TYPES: TT_SPFLI TYPE STANDARD TABLE OF TY_SPFLI.

DATA: T_SPFLI TYPE TT_SPFLI,
W_SPFLI TYPE TY_SPFLI.

SELECT CARRID
CONNID
COUNTRYFR
CITYFROM
CITYTO
FROM SPFLI
INTO TABLE T_SPFLI
UP TO 10 ROWS.

IF SY-SUBRC EQ 0.
LOOP AT T_SPFLI INTO W_SPFLI.
WRITE: / W_SPFLI-CARRID, W_SPFLI-CONNID, W_SPFLI-COUNTRYFR, W_SPFLI-CITYFROM, W_SPFLI-CITYTO.
ENDLOOP.
ENDIF.

Uma_ABAP

Posts : 56
Join date : 2012-03-31

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum