‎2008 Jun 18 9:56 AM
Hi,
I want to use SELECT....INTO TABLE statement but using a fixed value in one column, is that possible???
I'm trying to do something like this:
SELECT matnr "sy-datum" quantity FROM ztable INTO TABLE it_table.
The it_table has got 3 columns: matnr, date and quantity but in the ztable there isn't a date and I want to insert into the table with a variable or something...
Thanks
‎2008 Jun 18 10:00 AM
It is not possible ..
U have to write the coding as ...
SELECT matnr quantity FROM ztable
INTO corresponding fields of TABLE it_table.
Loop at it_table.
it_table-date = <date>.
modify it_table index sy-tabix.
endloop.
‎2008 Jun 18 9:58 AM
hi,
do this way ..
SELECT matnr date quantity FROM ztable INTO TABLE it_table where date = sy-datum.Regards,
Santosh
‎2008 Jun 18 9:58 AM
don't think so. You'll probably have to select two fields from ztable by INTO CORRESPONDING FIELDS and then perform a mass update on the internal table in a second step.
Thomas
‎2008 Jun 18 9:59 AM
hi,
Its not possible with select statemnet
first you must go with select using its corresponding addition
then use loop statemnt and modify the record
regards
prasanth
‎2008 Jun 18 10:00 AM
It is not possible ..
U have to write the coding as ...
SELECT matnr quantity FROM ztable
INTO corresponding fields of TABLE it_table.
Loop at it_table.
it_table-date = <date>.
modify it_table index sy-tabix.
endloop.
‎2008 Jun 18 10:02 AM
Ok... Thanks Srinivas.
I thought it was possible.
I already knew the loop solution but it doesn't looks like a good performance solution
‎2008 Jun 18 10:01 AM
you can use into corresponding fields of it_table and then modify the it_table with sy-datum.
‎2008 Jun 18 10:03 AM
Do like this.
SELECT matnr date quantity FROM ztable INTO TABLE it_table.
loop at it_table into wa_table.
wa_table-date = sy-datum.
modify it_table from wa_table.
endloop.
DhanaLakshmi
‎2008 Jun 18 10:03 AM
Hi,
you can do like this.
Suppose your internal table structure is like that,
********************************************************************
data:begin of itab occurs 0,
matnr type mara-matnr,
datum type sy-datum,
quant type menge,
end of itab.
SELECT matnr quant FROM ztable INTO corresponding fields of TABLE it_table.
loop at itab .
itab-datum = sy-datum.
modify itab index sy-tabix.
endloop.
********************************************************************
If you do like this then your column of itab-datum will have sy-datum .
I hope this will help you.
Help children of U.N World Food Program by rewarding them and encourage others to answer your queries