ABAP JOIN連線報錯的問題

2021-10-04 23:06:09 字數 1157 閱讀 1635

在abap sql中左連線left join、右連線night join後,不能使用where 加限制條件,否則會報錯:

如下:select b~ebeln

b~ebelp

a~lifnr

c~name

b~retpo

into corresponding fields of table gt_data

from ekko as a inner join ekpo as b

on a~ebeln eq b~ebeln

left join lfa1 as c

on a~lifnr eq c~lifnr

where a~bedat in s_bedat

and a~loekz eq space

and b~loekz eq space

and c~matnr eq p_mara.

上述語句錯誤,是因為c是使用的left join ,則後續的where中不能再加入與c有關的限制條件。而b使用的inner join,是可以在where中加入與b有關的限制條件。

針對上述問題的解決方法:

1、

select b~ebeln

b~ebelp

a~lifnr

c~name 

c~matnr

b~retpo

into corresponding fields of table gt_data

from ekko as a inner join ekpo as b

on a~ebeln eq b~ebeln

left join lfa1 as c

on a~lifnr eq c~lifnr

where a~bedat in s_bedat

and a~loekz eq space

and b~loekz eq space.

delete gt_data where matnr ne p_mara.

2、對於簇表、聚集表不能使用join鏈結語句時,可以使用for all entries in語句來鏈結兩表。參考文章《

abap 資料庫操作之 for all entries in》

ftp連線報錯

報錯如下 1.伺服器發回了不可路由的位址。使用伺服器位址代替 命令 mlsd 錯誤 目錄列表被使用者終止 2.狀態 連線建立,等待歡迎訊息.狀態 已登入 狀態 讀取目錄列表.命令 pwd 響應 257 is your current location 命令 type i 響應 200 type is...

遠端連線報錯

遠端登入卻報錯host is not allowed to connect to this mysql server 解決方法 在裝有mysql的機器上登入mysql mysql u root p密碼 執行use mysql 執行update user set host where user roo...

SSH 連線報錯總結

ssh connect to host localhost port 22 connection refused其中這個原因是因為沒有開啟ssh服務 解決方法 開啟服務即可 下面兩種任選 service sshd start 或 systemctl start ssh sudo etc init.d...