‎2021 Mar 26 3:40 PM
Hello All,
I have a requirement where a column of table needs to be populated with Row Number based on some grouping of columns and I was trying to leverage the Open SQL's window function. The window function works fine when using in Select but when almost same select is used as Subquery in Insert, it creates dump when trying to Activate or even on Syntax check. It does not provides any Activation or Syntax Check error.
The system used is S4HANA ON PREMISE 1909 & SAP_ABA 75E
For easier replication of scenario, I copied the Standard Demo Program DEMO_SELECT_OVER and added my scenario relevant codes:

Excerpts from ST22 dumpCategory Internal error
Runtime Errors SYSTEM_CORE_DUMPED
Date and Time 03/26/2021 10:01:02 (EST)
Short Text
Process terminated by signal 11.
Requesting help or insight on how to fix this ?
Added code below for easier replication:
REPORT yyaj_demo_select_over.
CLASS demo DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
main,
class_constructor.
ENDCLASS.
CLASS demo IMPLEMENTATION.
METHOD main.
DATA(out) = cl_demo_output=>new( ).
SELECT char1 && '_' && char2 AS group,
num1,
COUNT(*) OVER( PARTITION BY char1, char2 ) AS cnt,
ROW_NUMBER( ) OVER( PARTITION BY char1, char2 ) AS rnum,
MIN( num1 ) OVER( PARTITION BY char1, char2 ) AS min,
MAX( num1 ) OVER( PARTITION BY char1, char2 ) AS max,
SUM( num1 ) OVER( PARTITION BY char1, char2 ) AS sum,
division( 100 * num1,
SUM( num1 ) OVER( PARTITION BY char1, char2 ),
2 ) AS perc
FROM demo_expressions
ORDER BY group
INTO TABLE @DATA(windowed).
DATA : ls_exp2 TYPE yytmp_demo_exp2.
INSERT VALUE ls_exp2( id = '1' num1 = 1 num2 = 1 numlong1 = 1 numlong2 = 1 ) INTO TABLE yytmp_demo_exp2.
INSERT VALUE ls_exp2( id = '2' num1 = 2 num2 = 2 numlong1 = 1 numlong2 = 1 ) INTO TABLE yytmp_demo_exp2.
INSERT VALUE ls_exp2( id = '3' num1 = 3 num2 = 2 numlong1 = 3 numlong2 = 1 ) INTO TABLE yytmp_demo_exp2.
" Created yytmp_demo_exp table with first 5 fields from Table demo_expressions
DELETE FROM yytmp_demo_exp.
" Insert with Subquery with Window Function causing Termination of WorkProcess and Dump
INSERT yytmp_demo_exp FROM (
SELECT id, 1 AS num1 , 2 AS num2,
COUNT( * ) OVER( PARTITION BY char1, char2 ) AS numlong1,
ROW_NUMBER( ) OVER( PARTITION BY char1, char2 ) AS numlong2
FROM demo_expressions
* INTO TABLE @DATA(windowed2).
).
out->display( windowed ).
ENDMETHOD.
METHOD class_constructor.
TYPES tab_type TYPE STANDARD TABLE OF
demo_expressions WITH EMPTY KEY.
DELETE FROM demo_expressions.
INSERT demo_expressions FROM TABLE @( REDUCE tab_type(
LET r1 = cl_abap_random_int=>create(
seed = CONV i( sy-uzeit ) min = 1 max = 10 )
r2 = cl_abap_random_int=>create(
seed = CONV i( r1->get_next( ) ) min = 0 max = 1 )
c = `AB` IN
INIT t TYPE tab_type
FOR i = 0 THEN i + 1 UNTIL i >= 25
NEXT t = VALUE #(
BASE t ( id = sy-abcde+i(1)
num1 = r1->get_next( )
char1 = substring( val = c
off = r2->get_next( )
len = 1 ) &&
substring( val = c
off = r2->get_next( )
len = 1 )
char2 = substring( val = c
off = r2->get_next( )
len = 1 ) &&
substring( val = c
off = r2->get_next( )
len = 1 ) ) ) ) ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
demo=>main( ).
Table:
@EndUserText.label : 'Database Table for Expression Examples'
@AbapCatalog.enhancementCategory : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #ALLOWED
define table yytmp_demo_exp {
key mandt : mandt not null;
key id : char1 not null;
num1 : abap.int4;
num2 : abap.int4;
numlong1 : abap.int8;
numlong2 : abap.int8;
}
Even before the dump occurs, a pop up occurs saying > Work process restarted; ABAP session terminated (location ************)
Thanks
‎2021 Mar 26 3:40 PM
Thank you for visiting SAP Community to get answers to your questions. Since this is your first question, I recommend that you familiarize yourself with our Q&A Tutorial: https://developers.sap.com/tutorials/community-qa.html, as it provides tips for preparing questions that draw responses from our members. Should you wish, you can revise your question by selecting Actions, then Edit.
By adding a picture to your profile you encourage readers to respond: https://www.youtube.com/watch?v=46bt1juWUUM
Many thanks!
‎2021 Mar 26 4:04 PM
It usually means a kernel error. Look for a corrective note or a kernel patch in the SAP support Web site.
‎2021 Apr 02 5:49 AM
Tried looking for note with text from the dump but could not find an exact match.
Also I tried the same code in S4 2020 on-prem edition and the query worked fine.
‎2021 Apr 02 7:41 AM
Can you paste the whole core dump ? or actually you can create OSS ticket for this.
‎2021 Apr 02 8:12 AM
If you would post you code using the "code" button in the question editor, instead of as screen shots, then we could easily copy and paste into our own editors and try to figure it out for you. With screen shots there's a risk we have not typed exactly what you have done.
‎2021 Apr 02 8:14 AM
I did once have a problem with syntax check causing a dump - in my case it was syntax checking a simple statement like this:
CALL FUNCTION 'SOME_FUNCTION.I.e. without the closing '. I raised a message through support.sap.com (first response was "oh, you need a closing ' "), and having convinced them that I do know how to program ABAP, that I'm aware it's syntactically correct, and the issue is that no matter what we throw at the syntax check (or activation), it should not dump, someone who knew what they were doing looked into it and issued an patch.
I suggest you raise this through support.sap.com. Syntax check should not dump under any circumstances.
‎2021 Apr 02 6:06 PM
Matthew, I agree very much with you. Said almost the same thing to my colleague - its a static code - it should not dump.
Will check with team on going ahead and raising the OSS.
‎2021 Apr 02 6:18 PM
tom.wan Is there a specific part of dump ( Call stack, Active calls in Kernel etc.....), I can share here. ( Hesitant sharing entire ST22 dump having App Server details here. Is there a way we can hide these information when downloading or displaying ST22 dump? ).
Also as Matthew suggested I have added the code in the question now for easier replication.
‎2021 Apr 05 3:19 AM
Can you paste "Active calls in Kernel" and your kernel release&patch level.
‎2021 Apr 08 7:16 PM
Hello Tom,
The system was unavailable for last few days, so took me a while to respond. I also have now raised incident with SAP.
Following are the requested details
Kernel 777 Patch 200
|Active Calls in SAP Kernel | ---------------------------------------------------------------------------------------------------- |Lines of C sStack in kernel (structure different on each platform) |
|dw.sapS4S_D00[S](LinStackBacktrace(void**, int, int)+0xa9)[0x55ea643441b8,0x6f71b8] | |dw.sapS4S_D00[S](LinStack(_IO_FILE*)+0x4d)[0x55ea64347e41,0x6fae41] | |dw.sapS4S_D00[S](CTrcStack2+0x4b)[0x55ea64343bf5,0x6f6bf5] | |dw.sapS4S_D00[S](rabax_CStackSave()+0xa1)[0x55ea6454512f,0x8f812f] | |dw.sapS4S_D00[S](rabax(char16_t const*, char16_t const*, int, char16_t const*, void const*)+0x151b| |dw.sapS4S_D00[S](ab_CoreInfo+0xc6)[0x55ea6454de3e,0x900e3e] | |dw.sapS4S_D00[S](ThrCoreInfo(int)+0x9)[0x55ea642ce0d3,0x6810d3] | |dw.sapS4S_D00[S](ThIErrHandle(int, unsigned char, TH_VERBOSE_LEVEL, char16_t const*)+0x12b4)[0x55e| |dw.sapS4S_D00[S](ThErrHandle2(int, unsigned char, char16_t const*, char16_t const*)+0x97)[0x55ea64| |dw.sapS4S_D00[S](SigIGenAction+0x430)[0x55ea666b7c80,0x2a6ac80] | |libpthread.so.0[T][0x7f9f0d8e4c00,0x11c00] | |dw.sapS4S_D00[S](dbi::ast::AggregateFunction::mayReturnNullValues(dbi::ast::SymbolTable const&) co| |dw.sapS4S_D00[S](OSqlCommonCompiler<(OSqlCompilerTypes)1, OSqlGenCompiler>::NullValuesWarnings(dbi| |dw.sapS4S_D00[S](OSqlCommonCompiler<(OSqlCompilerTypes)1, OSqlGenCompiler>::checkSelectListAndInse| |dw.sapS4S_D00[S](OSqlCommonCompiler<(OSqlCompilerTypes)1, OSqlGenCompiler>::subSelectEnd(dbi::ast:| |dw.sapS4S_D00[S](SQLParserAdaptor<OSqlCommonCompiler<(OSqlCompilerTypes)1, OSqlGenCompiler> >::han| |dw.sapS4S_D00[S](SQLParserAdaptor<OSqlCommonCompiler<(OSqlCompilerTypes)1, OSqlGenCompiler> >::ope| |dw.sapS4S_D00[S](SQLParserAdaptor<OSqlCommonCompiler<(OSqlCompilerTypes)1, OSqlGenCompiler> >::ope| |dw.sapS4S_D00[S](OsqlParserRC a4rExitParser<(OSqlStatementTypes)6, dbi::ast::DmlStmt, dbi::ast::In| |dw.sapS4S_D00[S](void callSQLParser<(OSqlStatementTypes)6, DmlParser<(OSqlStatementTypes)6, dbi::a| |dw.sapS4S_D00[S](sqlParserCall(char16_t const*, char16_t const*)+0xa5)[0x55ea64fe9e5e,0x139ce5e] | |dw.sapS4S_D00[S](sc_antlr()+0x1b)[0x55ea64ba6471,0xf59471] | |dw.sapS4S_D00[S](rs_oper_abap91209()+0x1a5)[0x55ea64df299c,0x11a599c] | |dw.sapS4S_D00[S](rs_expan_abap+0x35)[0x55ea66086b05,0x2439b05] | |dw.sapS4S_D00[S](sc_expan(unsigned int)+0x1b1)[0x55ea660735d1,0x24265d1] | |dw.sapS4S_D00[S](parse(SC_LEVEL*) [clone .isra.161]+0x350)[0x55ea66070120,0x2423120] | |dw.sapS4S_D00[S](checkStatement(int, SC_STMT**, SC_LEVEL*, SC_ENV**, int, int, int, int)+0xe8)[0x5| |dw.sapS4S_D00[S](sc_check()+0x11a4)[0x55ea664e5c04,0x2898c04] | |dw.sapS4S_D00[S](cg_generate+0x1c9f)[0x55ea64aab9da,0xe5e9da] | |dw.sapS4S_D00[S](ab_jsych()+0x1099)[0x55ea645287b1,0x8db7b1] | |dw.sapS4S_D00[S](ab_extri()+0x22a)[0x55ea65e3b4ca,0x21ee4ca] | |dw.sapS4S_D00[S](ab_xevent(char16_t const*)+0x36)[0x55ea65e969e6,0x22499e6] | |dw.sapS4S_D00[S](ab_dstep+0x122)[0x55ea65e36db2,0x21e9db2] | |dw.sapS4S_D00[S](dynpmcal(DINFDUMY*, STPDUMMY*)+0x4cf)[0x55ea65e1afcf,0x21cdfcf] | |dw.sapS4S_D00[S](dynppai0(DINFDUMY*)+0x1c4)[0x55ea66375e64,0x2728e64] | |dw.sapS4S_D00[S](dynprctl(DINFDUMY*)+0x1d1)[0x55ea65e1bf71,0x21cef71] | |dw.sapS4S_D00[S](dynpen00+0x428)[0x55ea65e11aa8,0x21c4aa8] | |dw.sapS4S_D00[S](ThrtCallAbapVm+0xc2)[0x55ea65dff6a2,0x21b26a2] | |dw.sapS4S_D00[S](GuiHandler::handleRequest(REQUEST_BUF*, bool)+0x4ff)[0x55ea6432a69d,0x6dd69d] | |dw.sapS4S_D00[S](ThStart()+0x1fdb)[0x55ea64213744,0x5c6744] | |dw.sapS4S_D00[S](DpMain+0x3e9)[0x55ea662e8b69,0x269bb69] | |libc.so.6[S](__libc_start_main+0xf5)[0x7f9f0d551a35,0x23a35] |
Thanks,
Ashutosh
‎2021 Apr 14 7:18 AM
Couldn't find any known issues for this c-stack. BTW I saw your OSS ticket. We will handle it.