分类:
2008-04-12 08:32:35
如果SE11维护了索引出现"数据库系统 BSIS~Z1 中索引 ORACLE 不存在"黄灯提示,那么我们应该进去SE14进行维护数据库对应的索引.
以下是我利用索引进行SELECT操作测试,.事务代码:SE30
语句1:
DATA: BEGIN OF w_bsis_bsas ,
belnr LIKE bseg-belnr, "会计凭证号码
wtges LIKE kblp-wtges, "按交易货币计算的总计冲销金额
gjahr LIKE bseg-gjahr, "会计凭证年度
buzei LIKE bseg-buzei,
hkont LIKE bsis-hkont, "会计科目
fipos LIKE kblp-fipos, "承诺项目
xsender LIKE kblp-xsender, "标识:发送者
xempfgr LIKE kblp-xempfgr, "标识:接收者
je1 LIKE kblp-wtges,
shkzg LIKE bseg-shkzg, "借方/贷方标识
xnegp LIKE bseg-xnegp, "标识: 反记帐
dmbtr LIKE bseg-dmbtr, "按本位币计的金额
delete TYPE c ,
END OF w_bsis_bsas.
DATA:it_bsis_bsas LIKE w_bsis_bsas OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF w_belnr,
belnr LIKE bseg-belnr, "会计凭证号码
END OF w_belnr.
DATA:f_belnr LIKE w_belnr OCCURS 0 WITH HEADER LINE.
SELECT fipos "承诺项目
belnr "会计凭证号码
hkont "科目号
gjahr "会计凭证年度
buzei "行项目
shkzg "借方/贷方标识
dmbtr "按本位币计的金额
xnegp "标识: 反记帐
INTO (w_bsis_bsas-fipos,w_bsis_bsas-belnr,w_bsis_bsas-hkont,w_bsis_bsas-gjahr,w_bsis_bsas-buzei,
w_bsis_bsas-shkzg,w_bsis_bsas-dmbtr,w_bsis_bsas-xnegp)
FROM bsis
WHERE bukrs = '8000'
AND gjahr = '2007'
AND ( ( hkont < '1100000000' AND hkont >= '1000000000' ) OR ( hkont > '1100000000' AND fipos < '9000' ) )
AND monat = '08'
AND bsis~mandt = sy-mandt %_hints oracle 'index(bsis"Z1")'.
IF w_bsis_bsas-hkont < '1100000000' AND w_bsis_bsas-hkont >= '1000000000'.
f_belnr-belnr = w_bsis_bsas-belnr.
APPEND f_belnr.
CLEAR f_belnr.
ENDIF.
IF w_bsis_bsas-hkont > '1100000000' AND w_bsis_bsas-fipos < '9000'.
APPEND w_bsis_bsas TO it_bsis_bsas .
ENDIF.
CLEAR w_bsis_bsas.
ENDSELECT.
语句2:
DATA: BEGIN OF w_bsis_bsas ,
belnr LIKE bseg-belnr, "会计凭证号码
wtges LIKE kblp-wtges, "按交易货币计算的总计冲销金额
gjahr LIKE bseg-gjahr, "会计凭证年度
buzei LIKE bseg-buzei,
hkont LIKE bsis-hkont, "会计科目
fipos LIKE kblp-fipos, "承诺项目
xsender LIKE kblp-xsender, "标识:发送者
xempfgr LIKE kblp-xempfgr, "标识:接收者
je1 LIKE kblp-wtges,
shkzg LIKE bseg-shkzg, "借方/贷方标识
xnegp LIKE bseg-xnegp, "标识: 反记帐
dmbtr LIKE bseg-dmbtr, "按本位币计的金额
delete TYPE c ,
END OF w_bsis_bsas.
DATA:it_bsis_bsas LIKE w_bsis_bsas OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF w_belnr,
belnr LIKE bseg-belnr, "会计凭证号码
END OF w_belnr.
DATA:f_belnr LIKE w_belnr OCCURS 0 WITH HEADER LINE.
SELECT fipos "承诺项目
belnr "会计凭证号码
hkont "科目号
gjahr "会计凭证年度
buzei "行项目
shkzg "借方/贷方标识
dmbtr "按本位币计的金额
xnegp "标识: 反记帐
INTO (w_bsis_bsas-fipos,w_bsis_bsas-belnr,w_bsis_bsas-hkont,w_bsis_bsas-gjahr,w_bsis_bsas-buzei,
w_bsis_bsas-shkzg,w_bsis_bsas-dmbtr,w_bsis_bsas-xnegp)
FROM bsis
WHERE bukrs = '8000'
AND gjahr = '2007'
AND ( ( hkont < '1100000000' AND hkont >= '1000000000' ) OR ( hkont > '1100000000' AND fipos < '9000' ) )
AND monat = '08'
AND bsis~mandt = sy-mandt.
IF w_bsis_bsas-hkont < '1100000000' AND w_bsis_bsas-hkont >= '1000000000'.
f_belnr-belnr = w_bsis_bsas-belnr.
APPEND f_belnr.
CLEAR f_belnr.
ENDIF.
IF w_bsis_bsas-hkont > '1100000000' AND w_bsis_bsas-fipos < '9000'.
APPEND w_bsis_bsas TO it_bsis_bsas .
ENDIF.
CLEAR w_bsis_bsas.
ENDSELECT.
效率结果是,代码1是75,609,代码2是556,795,因为不知道这个BLOG怎么添加图片,所以不能显示效果
chinaunix网友2008-04-22 14:03:17
SAP 行业猎头诚结各个模块顾问朋友,本人手中有超过十家SAPtop公司,其中包括4大咨询的2大咨询公司,全球10大IT服务公司中的4 大服务公司,多个全球500强前50强的内部职位的机会,国内极具发展潜力的SAP咨询公司若干,本人已经成功为数十名sap顾问物色到 合适的职位,其中内部转外部的成功8个,外部转内部5个,外部转外部12个,只有您有强烈的意愿跳槽,相信我一定会帮到你的! 简历请发:recruitconsultant007@gmail.com, 欢迎咨询各位SAP顾问朋友前来咨询 msn:headhunter007@live.cn