0% found this document useful (0 votes)
16 views

Exercises 2

Uploaded by

kishancp
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Exercises 2

Uploaded by

kishancp
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

1) Declare a table type using the structure type

TYPES: BEGIN OF some_components_sflight_2,


carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
fldate TYPE sflight-fldate,
price TYPE sflight-price,
currency TYPE sflight-currency,
planetype TYPE sflight-planetype,
seatsmax TYPE sflight-seatsmax,
seatsocc TYPE sflight-seatsocc,
END OF some_components_sflight_2.
TYPES table_type_short_sflight TYPE TABLE OF some_components_sflight_2 WITH KEY
carrid connid fldate.

TYPES table_type_booking TYPE TABLE OF flight_booking WITH KEY carrid connid


fldate customid.

2) Declare a variable of type character with 10 positions and give it ‘Hello ABAP’
as an initial
value.

DATA message TYPE c LENGTH 10 VALUE 'Hello ABAP'.

3) Declare a variable of numeric type with 4 positions and initial value 1234.
DATA amount TYPE f VALUE 1234.

4) Declare a variable of type integer with initial value 42.

DATA age TYPE i VALUE 42.

5) Declare a variable of type integer with initial value 12.72.

DATA round_number TYPE i VALUE '12.72'.


WRITE round_number.

6) Declare a variable of type date and give it Leap day.

DATA any_day TYPE d.


any_day = '20240229'. " Leap

7) Declare a packed number variable with 7 decimal places.

DATA many_decimals TYPE p LENGTH 10 DECIMALS 7.


many_decimals = '123456789.987654321'.
WRITE many_decimals.

8)Declare a variable of type S_CARR_ID.

DATA air_line_code TYPE s_carr_id.

9) Declare a variable of the same type of field carrid from table SPFLI.

DATA air_line_code TYPE spfli-carrid.

10) Declare a variable of the same type of field FLDATE table SFLIGHT.

DATA flight_date TYPE sflight-fldate.

You might also like