2012 Sep 04 2:47 PM
hello,
i have used a select query with inner join with conditions from select options,but its filling one field of the internal table wrongly,
i will post you my select query
SELECT b~aennr
a~aenst
b~datuv
a~andat
a~annam
a~lvorm
INTO TABLE it_aenr
FROM aenr AS a INNER JOIN aedt AS b
ON a~datuv = b~datuv
WHERE a~aenst in pm_aenst
AND a~annam IN pm_annam AND
b~datuv IN pm_datuv AND
a~ccart IN pm_ccart AND
a~aenbe IN pm_aenbe AND
a~lvorm like lvorm1 .
all the variables starting with pm_ and lvorm1 are select-options variables.
annam field is wrongly obtained in table it_aenr.
please help me.
Regards,
2012 Sep 04 3:34 PM
Hi
How have you defined the internal table it_aenr, the fields has to be in the same sequance (and type) of the fields set in the query:
DATA: BEGIN OT IT_AENR OCCURS 0,
AENNR .....
AENST .....
DATUV .....
...........................
END OF IT AENR.
MaX
2012 Sep 05 9:11 AM
hello,
the fields are defined in same sequence,but the field annam is wrongly geting entered into the table,
i mean to say that the value of the field annam in the first row of the table is repeating in the other rows.
regards,
2012 Sep 05 9:23 AM
Hi
Perhaps it's not ok the condition of the join:
SELECT b~aennr
a~aenst
b~datuv
a~andat
a~annam
a~lvorm
INTO TABLE it_aenr
FROM aenr AS a INNER JOIN aedt AS b
* ON a~datuv = b~datuv
ON a~AENNR = b~AENNR
WHERE a~aenst in pm_aenst
AND a~annam IN pm_annam AND
b~datuv IN pm_datuv AND
a~ccart IN pm_ccart AND
a~aenbe IN pm_aenbe AND
a~lvorm like lvorm1 .
But I suppose the data of table AENR should be repeated for every record of AEDT
Max
2012 Sep 06 12:14 PM
Dear,
I think ur field donot have same sequence as in select query so
Please use INTO CORRESPONDING FIELDS OF TABLE in place of
INTO TABLE.
regards