07-09-2012 8:57 AM
Hi, all
I have a poor question about abap report programing.
Please tell me why use the "~" in the select steatment??
AND which case we should use the "~" in the select steatment??
>> AND countryto = dv_flights~countryfr.
report name:Y_33_BC405_SSCS_1AE01
SELECT * FROM dv_flights INTO wa_flight
WHERE carrid IN so_car
AND connid IN so_con
AND fldate IN so_fdt
AND countryto = dv_flights~countryfr.
======================================
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Event INITIALIZATION
*&---------------------------------------------------------------------*
INITIALIZATION.
* Initialize select-options for CARRID" OPTIONAL
MOVE: 'AA' TO so_car-low,
'QF' TO so_car-high,
'BT' TO so_car-option,
'I' TO so_car-sign.
APPEND so_car.
CLEAR so_car.
MOVE: 'AZ' TO so_car-low,
'EQ' TO so_car-option,
'E' TO so_car-sign.
APPEND so_car.
*&---------------------------------------------------------------------*
*& Event START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.
* Checking the output parameters
CASE mark.
WHEN pa_all.
* Radiobutton ALL is marked
SELECT * FROM dv_flights INTO wa_flight
WHERE carrid IN so_car
AND connid IN so_con
AND fldate IN so_fdt.
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-countryfr,
wa_flight-cityfrom,
wa_flight-airpfrom,
wa_flight-countryto,
wa_flight-cityto,
wa_flight-airpto,
wa_flight-seatsmax,
wa_flight-seatsocc.
ENDSELECT.
WHEN pa_nat.
* Radiobutton NATIONAL is marked
SELECT * FROM dv_flights INTO wa_flight
WHERE carrid IN so_car
AND connid IN so_con
AND fldate IN so_fdt
AND countryto = dv_flights~countryfr.
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-countryfr,
wa_flight-cityfrom,
wa_flight-airpfrom,
wa_flight-countryto,
wa_flight-cityto,
wa_flight-airpto,
wa_flight-seatsmax,
wa_flight-seatsocc.
ENDSELECT.
WHEN pa_int.
* Radiobutton INTERNATIONAL is marked
SELECT * FROM dv_flights INTO wa_flight
WHERE carrid IN so_car
AND connid IN so_con
AND fldate IN so_fdt
AND countryto <> dv_flights~countryfr.
* AND countryto <> countryfr.
WRITE: / wa_flight-carrid,
wa_flight-connid,
wa_flight-fldate,
wa_flight-countryfr,
wa_flight-cityfrom,
wa_flight-airpfrom,
wa_flight-countryto,
wa_flight-cityto,
wa_flight-airpto,
wa_flight-seatsmax,
wa_flight-seatsocc.
ENDSELECT.
ENDCASE.
Thanks a lot in advance
and Best regards.
Akihiro.
Moderator message: please read ABAP documentation before posting.
Message was edited by: Thomas Zloch
07-09-2012 9:11 AM
Dear Akihiro,
DV_FLIGHTS- Is a database view. not table. so when we read from database view we have to use '~'.
The same concept which is used in INNER JOIN.
The database view is nothing but Inner join.
Regards,
Ramya R
07-09-2012 9:21 AM
Hi,
'~' is used to specify the table name from which the field has to be taken. If the same field is present in two or tables in a select query (in JOIN or selction from a view), '~' is used to specify the table name from which the field has to be taken.
Cheers
~Niranjan