ABAP问题。 我想问下。为什么我用inner join 关联表的时候。为什么取出的数据会进行循环。
SELECTekbe~ebelnlikp~vbelnlips~werksekko~bukrsmakt~maktxINTOCORRESPONDINGFIELDSOFTABL...
SELECT ekbe~ebeln
likp~vbeln
lips~werks
ekko~bukrs
makt~maktx
INTO CORRESPONDING FIELDS OF TABLE gi_ms
FROM ekko
INNER JOIN ekbe ON ekko~ebeln = ekbe~ebeln
INNER JOIN likp ON ekbe~belnr = likp~vbeln
INNER JOIN lips ON likp~vbeln = lips~vbeln
INNER JOIN makt ON lips~matnr = makt~matnr
WHERE ekko~reswk = p_reswk
AND ekko~bsart = 'UB'
AND ekbe~vgabe = '8'
AND ekbe~ebeln IN s_ebeln
AND lips~werks IN s_werks
AND likp~vbeln IN s_vbeln
AND likp~lfdat IN s_lfdat. 展开
likp~vbeln
lips~werks
ekko~bukrs
makt~maktx
INTO CORRESPONDING FIELDS OF TABLE gi_ms
FROM ekko
INNER JOIN ekbe ON ekko~ebeln = ekbe~ebeln
INNER JOIN likp ON ekbe~belnr = likp~vbeln
INNER JOIN lips ON likp~vbeln = lips~vbeln
INNER JOIN makt ON lips~matnr = makt~matnr
WHERE ekko~reswk = p_reswk
AND ekko~bsart = 'UB'
AND ekbe~vgabe = '8'
AND ekbe~ebeln IN s_ebeln
AND lips~werks IN s_werks
AND likp~vbeln IN s_vbeln
AND likp~lfdat IN s_lfdat. 展开
3个回答
展开全部
楼上正解 而且看你select 的 字段 没有必要关联ekbe
ekbe~ebeln 换成 ekKO~ebeln
去掉 INNER JOIN ekbe ON ekko~ebeln = ekbe~ebeln
就ok了
ekbe~ebeln 换成 ekKO~ebeln
去掉 INNER JOIN ekbe ON ekko~ebeln = ekbe~ebeln
就ok了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
1楼正解,表关系的问题,如果不想重复尝试用LEFT JOIN
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询