안녕하세요...
프로그램을 개발하다가 MSEG를 건드리게 되였는데 속도가 너무나두 느려서 도움을 청합니다...
7일간의 데이타르 읽어오는데 1시간 남짓이 돌아가거든요 저의 소스 문제인지 아니면... 그리고 어떻게 하면
해결되는지 알고 싶습니다... 도와주세요 ~~~
select a~matnr a~lgort a~werks
a~bwart a~shkzg
a~dmbtr a~menge
b~budat
from mseg as a
inner join mkpf as b on a~mblnr = b~mblnr
and a~mjahr = b~mjahr
into corresponding fields of table gt_zmmv05
where a~matnr in s_matnr
and a~matnr like '60%'
and a~werks = p_werks
and a~lgort in r_lgort
and a~bwart in r_bwart
%_hints oracle 'ORDERED USE_NL (T_00) INDEX (T_00 "MSEG~M")'.
**********************************************
form ini_data.
clear: r_lgort[], r_lgort.
clear: r_bwart[], r_bwart.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = '5311'.
append r_lgort.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = '5321'.
append r_lgort.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = '5341'.
append r_lgort.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = '5371'.
append r_lgort.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = '5401'.
append r_lgort.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = '6011'.
append r_lgort.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = '6021'.
append r_lgort.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = '6031'.
append r_lgort.
r_lgort-sign = 'I'.
r_lgort-option = 'EQ'.
r_lgort-low = '6041'.
append r_lgort.
r_bwart-sign = 'I'.
r_bwart-option = 'EQ'.
r_bwart-low = '201'.
append r_bwart.
r_bwart-sign = 'I'.
r_bwart-option = 'EQ'.
r_bwart-low = '202'.
append r_bwart.
r_bwart-sign = 'I'.
r_bwart-option = 'EQ'.
r_bwart-low = '261'.
append r_bwart.
r_bwart-sign = 'I'.
r_bwart-option = 'EQ'.
r_bwart-low = '262'.
append r_bwart.
r_bwart-sign = 'I'.
r_bwart-option = 'EQ'.
r_bwart-low = '291'.
append r_bwart.
r_bwart-sign = 'I'.
r_bwart-option = 'EQ'.
r_bwart-low = '292'.
append r_bwart.
endform. "ini_data
**************************************************************
댓글 7
-
Risky
2011.01.17 20:57
-
초보아밥퍼
2011.01.17 23:12
일주일 데이터를 읽어오시는게 아니라 전기간의 데이터를 가져오고 계신데요...
-
양키
2011.01.18 00:06
쿼리상의 문제는 없어보입니다.
-
RCBEAR™
2011.01.18 22:37
초보아밥퍼 님의 말씀대로 조회 하고자하는 기간(Posting Date또는 Entry Date 등)조건이 없는듯 싶네요.
-
지민아빠
2011.01.19 02:35
MKPF를 MSEG에 합쳐서 쓰세요...User-exit : EXIT_SAPLMBMB_001
LOOP AT xmkpf.
* MKPF 모든 Field Select
SELECT SINGLE *
FROM mkpf
WHERE mblnr = xmkpf-mblnr
AND mjahr = xmkpf-mjahr.
CHECK sy-subrc = 0.
UPDATE mseg SET zvgart = mkpf-vgart
zblart = mkpf-blart
zblaum = mkpf-blaum
zbldat = mkpf-bldat
zbudat = mkpf-budat
zcpudt = mkpf-cpudt
zcputm = mkpf-cputm
zaedat = mkpf-aedat
zusnam = mkpf-usnam
ztcode = mkpf-tcode
zxblnr = mkpf-xblnr
zbktxt = mkpf-bktxt
zfrath = mkpf-frath
zfrbnr = mkpf-frbnr
zwever = mkpf-wever
zxabln = mkpf-xabln
zawsys = mkpf-awsys
zbla2d = mkpf-bla2d
ztcode2 = mkpf-tcode2
zbfwms = mkpf-bfwms
zexnum = mkpf-exnum
zlfsnr = mkpf-lfsnr
zoib_bltime = mkpf-oib_bltime
WHERE mblnr = xmkpf-mblnr
AND mjahr = xmkpf-mjahr.
ENDLOOP. -
지민아빠
2011.01.19 02:43
기존 자료는 업데이트하는 프로그램로 업데이트 시키면 끝나요...ㅎㅎㅎ
-
EMDTLS
2011.01.20 00:03
답변감사합니다.동료의 도움으로 해결 되였습니다만 RISKY님 제공해주신 자료와 비슷한 방법이 였습니다.
감사합니다... 그리고 초보아바퍼님이 짚어주신 것도 문제였던것같아요 답변해주신 모든분들 감사합니다 ~
참고해 보세요.
MKPF MSEG Inner join performance
http://forums.sdn.sap.com/thread.jspa?threadID=1843464&tstart=0