‎2007 Sep 26 2:21 PM
Hi experts,
I have the following selection below. It doesn't append the landx to i_mytable. If I use append i_mytable it appends to a new line not to i_mytable-landx. How can I solve the problem?
SELECT landx
into i_mytable-landx
FROM t005t
for ALL ENTRIES IN i_kna1
WHERE land1 = i_kna1-land1 AND
spras = 'EN'.
ENDSELECT.
‎2007 Sep 26 2:25 PM
SELECT landx into TABLE i_mytable "<-- ADD the word TABLE here
FROM t005t
for ALL ENTRIES IN i_kna1
WHERE land1 = i_kna1-land1 AND
spras = 'EN'.
* REMOVE the "ENDSELECT"
I'm assuming that LANDX is the only field in I_MYTABLE, otherwise you may want to use INTO CORRESPONDING FIELDS OF TABLE
Regards,
RIch Heilman
‎2007 Sep 26 2:25 PM
SELECT landx into TABLE i_mytable "<-- ADD the word TABLE here
FROM t005t
for ALL ENTRIES IN i_kna1
WHERE land1 = i_kna1-land1 AND
spras = 'EN'.
* REMOVE the "ENDSELECT"
I'm assuming that LANDX is the only field in I_MYTABLE, otherwise you may want to use INTO CORRESPONDING FIELDS OF TABLE
Regards,
RIch Heilman
‎2007 Sep 26 2:31 PM
Hello Rich,
in i_mytable there are several fields, I want to add landx to i_mytable-landx.
So in your version it inserts to the first column which is not good for me.
Have any idea?
‎2007 Sep 26 2:30 PM
Hi,
Adding some more points .
if not i_kna1 is initial.
SELECT landx
into table i_mytable-landx
FROM t005t
for ALL ENTRIES IN i_kna1
WHERE land1 = i_kna1-land1 AND
spras = 'EN'.
endif.
Thanks,
Manjunath MS
‎2007 Sep 26 2:35 PM
Hello Manjunat,
it gives me an error that i_mytable is not an internal table. I've already tried this version:
SELECT landx
into i_mytable-landx
FROM t005t
for ALL ENTRIES IN i_kna1
WHERE land1 = i_kna1-land1 AND
spras = 'EN'.
endselect.
but when I'm trying to append to i_mytable it inserts landx to a wrong position into a new line of the table
‎2007 Sep 26 2:38 PM
‎2007 Sep 26 2:44 PM
Yes, that is the case. So is it not possible to modify the line? Should I use instead of it an embedded selection and then when all the data is selected insert to the internal table?
‎2007 Sep 26 2:41 PM
‎2007 Sep 26 2:48 PM
Previously I selected the LAND1 from kna1 into i_kna1 (it's my internal table) it stores the country key (LAND1). Then I'm trying to retrieve the text to the country key LAND1, and I want to put the text LANDX into an another internal table called i_mytable.
‎2007 Sep 26 2:52 PM
‎2007 Sep 26 2:59 PM
I think I have realized what's the solution. I have to move to all the data into the header of my internal table i_mytable and then i have to append to it.
Thanks for posting some help for me.