‎2007 Jun 19 1:38 PM
can we change the statement as follows
SELECT carrid connid airpfrom cityfrom airpto cityto deptime arrtime
FROM spfli
INTO CORRESPONDING FIELDS OF wa_spfli.
SELECT carrid connid airpfrom cityfrom airpto cityto deptime arrtime
FROM spfli
INTO TABLE wa_spfli.
‎2007 Jun 19 1:55 PM
Hi,
u need to declare the internal table like this.
data : begin of wa_spfli occurs 0,
carrid type S_CARR_ID,
connid type S_CONN_ID,
airpfrom type S_FROMAIRP,
cityfrom type S_FROM_CIT,
airpto type S_TOAIRP,
cityto type S_TO_CITY,
deptime type S_DEP_TIME,
arrtime type S_ARR_TIME,
end of wa_spfli.
now write ur select statement
SELECT carrid connid airpfrom cityfrom airpto cityto deptime arrtime
FROM spfli
INTO TABLE wa_spfli.
regards,
Nagaraj
‎2007 Jun 19 1:40 PM
If the table wa_spfli is declared in the order of selecting field then u can change the code like the second select.
REgards,
Vasanth
‎2007 Jun 19 1:42 PM
‎2007 Jun 19 1:55 PM
Hi,
u need to declare the internal table like this.
data : begin of wa_spfli occurs 0,
carrid type S_CARR_ID,
connid type S_CONN_ID,
airpfrom type S_FROMAIRP,
cityfrom type S_FROM_CIT,
airpto type S_TOAIRP,
cityto type S_TO_CITY,
deptime type S_DEP_TIME,
arrtime type S_ARR_TIME,
end of wa_spfli.
now write ur select statement
SELECT carrid connid airpfrom cityfrom airpto cityto deptime arrtime
FROM spfli
INTO TABLE wa_spfli.
regards,
Nagaraj
‎2007 Jun 19 2:23 PM
Yes its possible..
Provided your internal table has been declared , in the same order of the fields ,
as you are using in the select statement .
Praveen .
‎2007 Jun 19 2:29 PM
hi,
can we change, but before chnaging you must create internal table as per selected fields sequence.
you must create internal table with selected fields order or write the select statement as per internal table fields order.
SELECT carrid connid airpfrom cityfrom airpto cityto deptime arrtime
FROM spfli
INTO CORRESPONDING FIELDS OF wa_spfli.
in this case no need to keep the internal table fields and selected fields in same sequence. but this statement affects on perfomace.( don't use select statements with CORRESPONDING addition).
SELECT carrid connid airpfrom cityfrom airpto cityto deptime arrtime
FROM spfli
INTO TABLE wa_spfli.
this statement deffinetly improves the perfomance of your program. but here you must take care regarding internal table fields order and selected fields order.
regards,
Ashokreddy.
‎2007 Jun 19 2:33 PM
Hi Abhijeet,
Good question and this is what you are supposed to do everytime to better the code as per the performance issue.
You can achieve this by using the following things.
1> Create a types declaration.
types: begin of ty_vbak,
field1 type vbak-field1,
field2 type vbak-field2,
field3 type vbak-field3,
end of ty_vbak.
2> Make sure that occurances of fields are in the sequential order as they are in the table.
field1 occurs first from the top and after field1 field2 occurs so that fetching can be done in the same manner.
3> Create a structure for this.
data: x_vbak type ty_vbak.
4> Create an internal table if it is contain more than one line/entry of data.
data: it_vbak type table of ty_vbak.
5> Even in the select query make sure that the conditions are also given in the sequential order.
These should empower u from replacing corresponding keyword.
Reward Points if useful.
Thanks,
Tej..