10-12-2008 3:43 AM
hi gurus..
i'm a begginer..
how can i store all the data that i extracted into a final internal table (it_details)???
heres my code...
tnx!!
select shipping details from vbkd
SELECT inco1
inco2
INTO CORRESPONDING FIELDS OF TABLE it_sales
FROM vbkd
FOR ALL ENTRIES IN it_sales
WHERE vbeln EQ it_sales-vbeln
AND posnr EQ it_sales-posnr.
get description of shipping point
SELECT vtext
INTO CORRESPONDING FIELDS OF TABLE it_sales
FROM tvstt
FOR ALL ENTRIES IN it_sales
WHERE spras = 'en'
AND vstel = it_sales-vstel.
get description of incoterms
SELECT bezei
INTO CORRESPONDING FIELDS OF TABLE it_sales
FROM tinct
FOR ALL ENTRIES IN it_sales
WHERE inco1 = it_sales-inco1.
AND
inco1 = it_sales-inco2.
SELECT bezei
INTO CORRESPONDING FIELDS OF TABLE it_sales
FROM tinct.
WHERE inco1 = it_sales-inco2
get description route
SELECT bezei
INTO CORRESPONDING FIELDS OF TABLE it_sales
FROM tvrot
FOR ALL ENTRIES IN it_sales
WHERE route = it_sales-route.
Get customer details
SELECT kunnr
name1
name2
ort01
pstlz
regio
pfach
INTO CORRESPONDING FIELDS OF TABLE it_sales
FROM kna1
FOR ALL ENTRIES IN it_sales
WHERE kunnr EQ it_sales-kunnr.
Edited by: p0ng j0nes on Oct 12, 2008 4:43 AM
10-12-2008 3:50 AM
create an internal table which includes all fields and use move-corresponding
10-12-2008 3:50 AM
create an internal table which includes all fields and use move-corresponding
10-12-2008 3:52 AM
hey,
In your code your selecting and filling it_sales in all the select statement,you should create separate internal table for each selection and then use the for all enteries.
10-12-2008 3:55 AM
do i really have to make an internal tables for each my select statements?
10-12-2008 3:59 AM
Yes you should make seperate internal tables,otherwise just put a break-point in your first select statement and check what is happening then you will understand.
Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 12, 2008 4:59 AM
10-12-2008 4:13 AM
10-12-2008 4:23 AM
There is something wrong
for joining two table
There should be at least 1 common field
Please let me know which is common field between this two query ,
Regards
Ashoak Narayandas Advani
select shipping details from vbkd
SELECT inco1
inco2
INTO CORRESPONDING FIELDS OF TABLE it_sales
FROM vbkd
FOR ALL ENTRIES IN it_sales
WHERE vbeln EQ it_sales-vbeln
AND posnr EQ it_sales-posnr.
get description of shipping point
SELECT vtext
INTO CORRESPONDING FIELDS OF TABLE it_sales
FROM tvstt
FOR ALL ENTRIES IN it_sales
WHERE spras = 'en'
AND vstel = it_sales-vstel.
10-12-2008 4:34 AM
10-12-2008 11:39 AM
A few things.
Your first select will have only fields INCO1 and INCO2 filled in it_sales.
Your second select will return basically nothing as VSTEL is empty.
I'm not sure if it's allowed to do a
INTO CORRESPONDING FIELDS OF TABLE it_sales
in combination with
FOR ALL ENTRIES IN it_sales
You're inserting lines to it_sales while your selecting from the same internal table.
If i'm not mistaken, each selection with
INTO CORRESPONDING FIELDS OF TABLE it_sales
will overwrite any existing entries in it_sales. So should all your selects go through, you will find your internal table it_sales only filled with the entries retrieved in your final select statements.