안녕하세요.
SAP 운영을 맡은지가 얼마 안돼서 어떻게 처리해야 할지 몰라서 올립니다.
집계 쿼리를 아래와 같이 되어 있습니다.
오더에 대한 정산처리 건수를 집계하는 부분입니다.
조회조건의 GR_OBJER 건수가 1만건이 넘어가는 경우에 에러가 납니다. 1만건 이하일때는 정상작동합니다.
달리 처리 할수 있는 방법 없을까요?
SELECT OBJNR
SUM( WTG001 ) AS WTG001 SUM( WTG002 ) AS WTG002
SUM( WTG003 ) AS WTG003 SUM( WTG004 ) AS WTG004
SUM( WTG005 ) AS WTG005 SUM( WTG006 ) AS WTG006
SUM( WTG007 ) AS WTG007 SUM( WTG008 ) AS WTG008
SUM( WTG009 ) AS WTG009 SUM( WTG010 ) AS WTG010
SUM( WTG011 ) AS WTG011 SUM( WTG012 ) AS WTG012
SUM( WTG013 ) AS WTG013 SUM( WTG014 ) AS WTG014
SUM( WTG015 ) AS WTG015 SUM( WTG016 ) AS WTG016
INTO CORRESPONDING FIELDS OF TABLE GT_COSP
FROM COSP
WHERE OBJNR IN GR_OBJNR
GROUP BY OBJNR.
SORT GT_COSP BY OBJNR.
아래는 오류 메시지 내용 및 시스템 환경 입니다.
** 오류 분석내요 ** 메세지
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught
in
procedure "LAST_SELECT_DATA" "(FORM)", nor was it propagated by a RAISING
clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The SQL statement generated from ABAP/4 Open SQL violates a
restriction imposed by the database system used in R/3.
You can usually find details in the system log and in developer
trace. The following error scenarios may be database-specific:
------
ORACLE
------
The maximum size of an SQL statement has been exceeded. In Oracle
6.* this is 8 KB, in Oracle 7.* 64 KB.
The Native SQL statement generated from an ABAP/4 Open SQL statement
must not take up more than the permitted space.
** 오류 수정방버 ** 메세지
The ABAP/4 Open SQL statement concerned must be divided into several
smaller units.
If the problem occurred due to the use of an excessively large table
in an IN itab construct, you can use FOR ALL ENTRIES instead.
-
When you use this addition, the statement is split into smaller units
according to the restrictions of the database system used.
-
If you cannot solve the problem yourself, please send the
following documents to SAP:
1. A hard copy print describing the problem.
To obtain this, select the "Print" function on the current screen.
-
2. A suitable hardcopy prinout of the system log.
To obtain this, call the system log with Transaction SM21
and select the "Print" function to print out the relevant
part.
3. If the programs are your own programs or modified SAP programs,
supply the source code.
To do this, you can either use the "PRINT" command in the editor or
print the programs using the report RSINCL00.
4. Details regarding the conditions under which the error occurred
or which actions and input led to the error.
Internal call code.........: "[RSQL/OPEN/COSP ]"
Please check the entries in the system log (Transaction SM21).
You may able to find an interim solution to the problem
in the SAP note system. If you have access to the note system yourself,
please use the following search criteria:
"ZPMMA_BL_026" "DBIF_RSQL_INVALID_RSQL"
If you cannot solve the problem yourself, please send the
following documents to SAP:
1. A hard copy print describing the problem.
To obtain this, select the "Print" function on the current screen.
-
2. A suitable hardcopy prinout of the system log.
To obtain this, call the system log with Transaction SM21
and select the "Print" function to print out the relevant
part.
3. If the programs are your own programs or modified SAP programs,
supply the source code.
To do this, you can either use the "PRINT" command in the editor or
print the programs using the report RSINCL00.
4. Details regarding the conditions under which the error occurred
or which actions and input led to the error.
The exception must either be prevented, caught within proedure
"LAST_SELECT_DATA" "(FORM)", or its possible occurrence must be declared in the
RAISING clause of the procedure.
To prevent the exception, note the following:
**** 시스템 환경 **********
SAP-Release 700
Application server... "s-sap-vt1"
Operating system..... "Windows NT"
Release.............. "5.2"
Hardware type........ "16x AMD64 Level"
Character length.... 16 Bits
Pointer length....... 64 Bits
Work process number.. 9
Shortdump setting.... "full"
Database server... "S-SAP-PRD"
Database type..... "ORACLE"
Char.set.... "C"
SAP kernel....... 700
created (date)... "Jan 29 2007 00:36:16"
create on........ "NT 5.2 3790 Service Pack 1 x86 MS VC++ 14.00"
Database version. "OCI_10201_SHARE (10.2.0.2.0) "
Patch level. 95
Patch text.. " "
Database............. "ORACLE 9.2.0.*.*, ORACLE 10.1.0.*.*, ORACLE 10.2.0.*.*"
SAP database version. 700
Operating system..... "Windows NT 5.0, Windows NT 5.1, Windows NT 5.2"
Memory consumption
Roll.... 16192
EM...... 29328880
Heap.... 0
Page.... 49152
MM Used. 8456624
MM Free. 4109824
댓글 5
-
qwert
2008.12.18 01:31
-
폴라리스
2008.12.18 01:33
답변감사합니다.
그런데
GR_OBJNR 에는 위에 집계쿼리전에 특정 기간이나 작업장 조건에 의해 추출한 오브젝트번호만 있습니다.
평상시에는 괜찮으나 1년간 집계를 하다보니 특정기간에 포함되는 건수 (GR_OBJNR)가 1만건이 넘게 됩니다.
-
COMAN
2008.12.18 02:05
위 두분 말씀에 공감.
GR_OBJNR이 1만건이 넘는다면 차리리 itab으로 내려받아 가공하심이 더 좋을 듯....
제가 cosp조회할때
WHERE VERSN = '000'
AND LEDNR = '00'
AND WRTTP = '04' "값유형 4=실제
AND PERBL = '016' "기간블럭
AND GJAHR EQ P_GJAHR
AND OBJNR IN R_OBJNR.
정도 주었습니다. 저도 OBJNR을 주긴 했는데 건수가 얼마 없었구요..
COSP에 어떤 index가 있는지 확인해보시길... -
폴라리스
2008.12.18 21:48
네.. 그런 방법으로 처리 해 보겠습니다.
답변 주신분들 모두 감사 드립니다.
-
hccpi
2009.12.01 18:17
아....그래서 오더 조회할때 리포트페이터로 만든 프로그램에서 1000건씩 끊어서 읽었구나..
Sum구문을 써도 where의 조건문에 index가 걸려있다면 range스캔이 됩니다. 하지만 말씀하신대로 Object no.로만 where 조건을 두기에는 좀 막연한 감이 드네요. 회계연도나 기간등을 둬서 좀 줄이시는게 어떨까 싶네요.