‎2010 Sep 10 9:01 AM
hi all,
i have join but some field are not populated in internal table lt_mseg (WERKS) .Here is join. Table MSEG contain value for werks.
SELECT * FROM mseg
INNER JOIN mkpf ON mkpf~mblnr EQ mseg~mblnr AND mseg~mjahr EQ mkpf~mjahr
INNER JOIN mara ON mara~matnr EQ mseg~matnr
INNER JOIN lfa1 ON lfa1~lifnr EQ mseg~lifnr
INTO CORRESPONDING FIELDS OF TABLE lt_mseg
WHERE mkpf~budat IN datum
AND mseg~lifnr IN lifnr
AND mseg~bukrs IN bukrs
AND mseg~werks IN werks
AND mseg~matnr IN matnr
AND mara~mtart IN mtart
AND lfa1~land1 IN land1
AND ( bwart = '101' OR bwart = '105' ).
‎2010 Sep 10 11:14 AM
I cant use select * from mseg
every field must me defined mseg.... mseg....
‎2010 Sep 10 1:23 PM
Right. If you have a join all the fields must be listed explicitly. If there's no join select * will work.
‎2010 Sep 10 2:08 PM
Not always, if the field names are unique across the joined tables OR always contain identical information anyway (like the fields used for the join conditions), then * will do.
OP had the problem because WERKS appears in both MSEG and LFA1, with probably different content.
Thomas