SAP ABAP select 语句为什么取不到数据(确认后台表中有数据)
如下面的代码:其中L_COSS表无法取到数据,是为什么呢,哪里有问题呢TABLES:COSP,COSS.DATA:BEGINOFITABOCCURS0,GJAHRTYPE...
如下面的代码:其中L_COSS表无法取到数据,是为什么呢,哪里有问题呢
TABLES : COSP,COSS .
DATA : BEGIN OF ITAB OCCURS 0 ,
GJAHR TYPE COSS-GJAHR,
BUKRS TYPE COSS-BUKRS,
*............定义表字段代码省略
END OF ITAB .
*............ALV输出代码省略
SELECTION-SCREEN BEGIN OF BLOCK CHK WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:
S_GJAHR FOR COSS-GJAHR,
S_BUKRS FOR COSS-BUKRS,
S_KSTAR FOR COSS-KSTAR .
SELECTION-SCREEN END OF BLOCK CHK.
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
FORM GET_DATA .
SELECT
COSS~GJAHR
COSS~BUKRS
COSS~WRTTP
COSS~KSTAR
COSS~BEKNZ
COSS~WKG009
COSS~WKG010
COSS~FKBER
FROM COSS
INTO (L_COSS-GJAHR,
L_COSS-BUKRS,
L_COSS-WRTTP,
L_COSS-KSTAR,
L_COSS-BEKNZ,
L_COSS-WKG009,
L_COSS-WKG010,
L_COSS-FKBER )
WHERE cosS~GJAHR IN S_GJAHR
AND cosS~BUKRS IN S_BUKRS
AND cosS~KSTAR IN S_KSTAR.
ENDSELECT. 展开
TABLES : COSP,COSS .
DATA : BEGIN OF ITAB OCCURS 0 ,
GJAHR TYPE COSS-GJAHR,
BUKRS TYPE COSS-BUKRS,
*............定义表字段代码省略
END OF ITAB .
*............ALV输出代码省略
SELECTION-SCREEN BEGIN OF BLOCK CHK WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:
S_GJAHR FOR COSS-GJAHR,
S_BUKRS FOR COSS-BUKRS,
S_KSTAR FOR COSS-KSTAR .
SELECTION-SCREEN END OF BLOCK CHK.
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
FORM GET_DATA .
SELECT
COSS~GJAHR
COSS~BUKRS
COSS~WRTTP
COSS~KSTAR
COSS~BEKNZ
COSS~WKG009
COSS~WKG010
COSS~FKBER
FROM COSS
INTO (L_COSS-GJAHR,
L_COSS-BUKRS,
L_COSS-WRTTP,
L_COSS-KSTAR,
L_COSS-BEKNZ,
L_COSS-WKG009,
L_COSS-WKG010,
L_COSS-FKBER )
WHERE cosS~GJAHR IN S_GJAHR
AND cosS~BUKRS IN S_BUKRS
AND cosS~KSTAR IN S_KSTAR.
ENDSELECT. 展开
2个回答
2015-11-09
展开全部
你检查一下L_COSS-GJAHR,L_COSS-BUKRS,L_COSS-WRTTP,L_COSS-KSTAR等字段的值,取出的数应该在这些字段里面
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询