Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

internal tables

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

create an internal table which includes all fields and use move-corresponding

8 REPLIES 8

Former Member
0 Kudos

create an internal table which includes all fields and use move-corresponding

Former Member
0 Kudos

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.

0 Kudos

do i really have to make an internal tables for each my select statements?

0 Kudos

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

0 Kudos

ok..

tnx!!!

Former Member
0 Kudos

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.

0 Kudos

hi

i think field anco1 or inco2..

tnx

Former Member
0 Kudos

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.