SAP-ABAP-DBSQL_SQL_ERROR-SQL error "SQL code: 129"

[复制链接]
查看11 | 回复1 | 2022-10-19 14:55:56 | 显示全部楼层 |阅读模式
问题描述:自开发程序调用函数MD_SALES_ORDER_STATUS_REPORT,出现dump,详细信息请见DUMP信息
情况描述:当单独执行一个生产订单时也不会有问题,当执行整个工厂的未完成生产订单会出现dump。
LOOP AT pt_afko INTO DATA(ls_afko).
CLEAR:lt_mldelay.
CLEAR:lt_ioelx.
CALL FUNCTION 'MD_SALES_ORDER_STATUS_REPORT'
EXPORTING
edelkz = 'FE'
edelnr = ls_afko-aufnr
ewerks = ls_afko-werks
nodisp = 'X'
i_ignore_mtold = 'X'
i_profid = 'SAP000000001'
is_profile = ls_profile
IMPORTING
et_mldelay = lt_mldelay
EXCEPTIONS
error
= 1
OTHERS = 2.
……
ENDLOOP.

在dump位置标准增强es_pph_access_hana将SQL代码提取如下,会出现同样的报错。
REPORT Z8757_TEST022.
*&---------------------------------------------------------------------*
*& Report Z8757_TEST021
*&---------------------------------------------------------------------*
*&
TYPES: BEGIN OF ty_ma61v_e.
INCLUDE TYPE ma61v.
TYPES: maktx TYPE maktx,
bwkey TYPE bwkey,
bsext TYPE bsext,
bsint TYPE bsint,
kzgrp TYPE kzgrp,
END OF ty_ma61v_e.
DATA: lt_ma61v_e TYPE TABLE OF ty_ma61v_e.
DATA: lt_selectionTYPE pph_matnr_werks_berid_sel_tab.
DATA: lr_selectionTYPE pph_matnr_werks_berid_sel.
lr_selection-matnr = '000000010430010001'.
lr_selection-werks = '1000'.
lr_selection-BERID = '1000'.
append lr_selection to lt_selection.
SELECT
a~*,
c~*,
w~bwkey,
l~bsext,
l~bsint,
l~kzgrp
INTO CORRESPONDING FIELDS OF TABLE @lt_ma61v_e
FROM marc AS c
INNER JOIN mara AS a ON c~matnr = a~matnr
LEFT OUTER JOIN t001w AS w ON c~werks = w~werks"#EC CI_BUFFJOIN
LEFT OUTER JOIN t134 AS l ON a~mtart = l~mtart "#EC CI_BUFFJOIN
FOR ALL ENTRIES IN @lt_selection

WHERE c~matnr = @lt_selection-matnr AND

c~werks = @lt_selection-werks.
write: '1'.
测试代码:
1, 添加 up to 100 rows ,sql 不发生 dump。
2,添加 where 条件, 工厂'' 或任意工厂值,sql 不发生 dump。
3,将查询的字段任意注释一个,sql 不发生 dump。
后续处理。
1. 将T001W表调整激活
2. 让业务顾问将一个未清理干净的工厂清理干净
3. 将一个相关的badi增强MD_CHANGE_MRP_DATA对应的实施和类清理。
效果:
当晚问题依然存在。
第二天问题解决。
猜测可能是由于缓存未能立即生效。
也分辨不出是哪个引起的,大顾路过欢迎留言。


DUMP信息:
类别
ABAP 编程错误
运行时错误
DBSQL_SQL_ERROR
异常
CX_SY_OPEN_SQL_DB
ABAP 程序
CL_PPH_HANA_ACCESS_MATERIAL===CP
应用组件
PP-MRP
日期和时间
2021.11.30 18:30:15 (UTC+8)

短文本
SQL error "SQL code: 129" occurred while accessing table "MARC".

发生了什么?
Database error text: "SQL message: transaction rolled back by an internal
error: connection broken; $TYPE$=ReadChannel; $MESSAGE$=an error occured
while reading from the channel; $INFO$=connection broken; $PARAM$=active
channel (since 112806368mues) 1845513 from 48048 to 127.0"

我能做什么?
Note which actions and entries caused the error to occur.
Consult your SAP administrator.
Using transaction ST22 for ABAP dump analysis, you can view, manage,
and retain termination messages for longer periods.
Note which actions and entries caused the error to occur.
Consult your SAP administrator.
Using transaction ST22 for ABAP dump analysis, you can view, manage,
and retain termination messages for longer periods.

错误分析
An exception has occurred in class "CX_SY_OPEN_SQL_DB". This exception was not
caught
in procedure "PREPARE_MT61D_BULK_OPENSQL" "(METHOD)" or propagated by a
RAISING clause.
Since the caller of the procedure could not have anticipated this
exception, the current program was terminated.
The reason for the exception occurring was:
The reason for the exception is:
Database error text: SQL message: transaction rolled back by an internal
error: connection broken; $TYPE$=ReadChannel; $MESSAGE$=an error occured
while reading from the channel; $INFO$=connection broken; $PARAM$=active
channel (since 112806368mues) 1845513 from 48048 to 127.0
Return value of the database layer: "SQL dbsl rc: 99"

如何更正此错误
If the exception cannot be prevented, "CX_SY_OPEN_SQL_DB" must be caught within
procedure "PREPARE_MT61D_BULK_OPENSQL" "(METHOD)" or declared in the
procedure's RAISING clause.
To prevent the exception, note the following:
Analyze the entries in the system log (transaction SM21).
If the error occurs in a non-modfied SAP program, you might be able to
find a solution in the SAP Notes system. If you have access to the SAP
Notes system, check there first using the following keywords:
"DBSQL_SQL_ERROR" CX_SY_OPEN_SQL_DB
"CL_PPH_HANA_ACCESS_MATERIAL===CP" bzw. CL_PPH_HANA_ACCESS_MATERIAL===CM003
"PREPARE_MT61D_BULK_OPENSQL"
If you cannot solve the problem yourself, please send the following
information to SAP:
1. The description of the problem (short dump)
To do this, chooseSystem -> List -> Save -> Local File (unconverted)
on the screen you are in now.
2. The relevant system log
To do this, call the system log in transaction SM21. Restrict the time
interval to ten minutes before the short dump and five minutes after
it. In the display, choose System -> List -> Save -> Local File
(unconverted).
3. If these are programs of your own, or modified SAP programs: The
source text of the programs
To do this, please choose
"Other Utilties -> Upload/Download -> Download".
4. Details regarding the conditions under which the error occurred or
which actions and input caused the error.
异常对象的链
级别 类
属性名称

1
CX_SY_OPEN_SQL_DB
(程序)
CL_PPH_HANA_ACCESS_MATERIAL===CP
(包含文件)
CL_PPH_HANA_ACCESS_MATERIAL===CM003
(行)
229
(短文本)
数据库返回 SQL 代码 129。错误文本:transaction rolled back by an i>

connection broken; $TYPE$=ReadChannel; $MESSAGE$=an error occured

while reading from the channel; $INFO$=connection broken;

$PARAM$=active channel (since 112806368mues) 1845513 from 48048
(长文本)
数据库返回 SQL 代码 129。错误文本为:transaction rolled back by an>

error: connection broken; $TYPE$=ReadChannel; $MESSAGE$=an error

occured while reading from the channel; $INFO$=connection broken;

$PARAM$=active channel (since 112806368mues) 1845513 from 48048 to

127.0.0....。#

#
IS_RESUMABLE
KERNEL_ERRID
SQLCODE
129
SQLMSG
transaction rolled back by an internal error: connection broken;

$TYPE$=ReadChannel; $MESSAGE$=an error occured while reading from

the channel; $INFO$=connection broken; $PARAM$=active channel

(since 112806368mues) 1845513 from 48048 to 127.0.0....

关于在何处终止的信息
The termination occurred in ABAP program or include
"CL_PPH_HANA_ACCESS_MATERIAL===CP", in "PREPARE_MT61D_BULK_OPENSQL". The
main program was "ZMMR0038".
In the source code, the termination point is in line 229 of include
"CL_PPH_HANA_ACCESS_MATERIAL===CM003".
include "CL_PPH_HANA_ACCESS_MATERIAL===CM003".
The termination is due to exception "CX_SY_OPEN_SQL_DB" occurring in procedure
"PREPARE_MT61D_BULK_OPENSQL" "(METHOD)",
but not being handled locally there or being declared in the RAISING
clause.
The procedure is in program "CL_PPH_HANA_ACCESS_MATERIAL===CP". Its source
code begins in line 1 of
include "CL_PPH_HANA_ACCESS_MATERIAL===CM003".

源代码提取
行代码
199 * ----------------------------------------------------
200 * Check what has already been read before
201 * ----------------------------------------------------
202 lt_selection = it_selection.
203 LOOP AT lt_selection ASSIGNING .
204 lv_tabix = sy-tabix.
205 READ TABLE mt_mt61d_out
206 WITH KEY matnr = -matnr
207
werks = -werks
208
berid = -berid
209
BINARY SEARCH
210
TRANSPORTING NO FIELDS.
211 IF sy-subrc = 0.
212 DELETE lt_selection INDEX lv_tabix.
213 ENDIF.
214 ENDLOOP.
215 IF lt_selection[] IS INITIAL.
216 EXIT.
217 ENDIF.
218 * -----------------------------------------------------
219 * prep: reduce the involved bwkeys
220 * -----------------------------------------------------
221 lt_selection_werks = lt_selection.
222 SORT lt_selection_werks BY werks.
223 DELETE ADJACENT DUPLICATES FROM lt_selection_werks COMPARING werks.
224 * ----------------------------------------------------
225 * MA61V is the DB-Join on MARC + MARA - this is the leading result
226 * all subsequent selects are needed to fill the missing fields of MT61D
227 * ----------------------------------------------------
228 ENHANCEMENT-SECTION prepare_mt61d_bulk_opensql_01 SPOTS es_pph_access_hana .
>>>>> SELECT
230 a~*,
231 *c~ahdisc~altslc~apokzc~auftlc~ausdtc~ausmec~ausss
232 *c~basmgc~bearzc~beskzc~bstfec~bstmac~bstmic~bstrf
233 *c~bwesbc~bwscl
234 *c~cuobjc~cuobv
235 *c~diberc~disgrc~dislsc~dismmc~dispoc~dplfsc~dplho
236 *c~dplpuc~dzeit
237 *c~eisbec~eisloc~ekgrpc~eprioc~expme
238 *c~fabkzc~fevorc~fhoric~frtmec~fxhor
239 *c~insmk
240 *c~kzausc~kzbedc~kzdiec~kzpsp

回复

使用道具 举报

千问 | 2022-10-19 14:55:56 | 显示全部楼层
测试代码:
1, 添加 up to 100 rows ,sql 不发生 dump。
2,添加 where 条件, 工厂'' 或任意工厂值,sql 不发生 dump。
3,将查询的字段任意注释一个,sql 不发生 dump。
后续处理。
1. 将T001W表调整激活
2. 让业务顾问将一个未清理干净的工厂清理干净
3. 将一个相关的badi增强MD_CHANGE_MRP_DATA对应的实施和类清理。
效果:
当晚问题依然存在。
第二天问题解决。
猜测可能是由于缓存未能立即生效。
也分辨不出是哪个引起的,大顾路过欢迎留言。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行