Skip to Content
0
Nov 22, 2019 at 12:28 PM

Select name1 from kna1 into internal table

134 Views Last edit Nov 22, 2019 at 03:39 PM 3 rev

Hello guys,

I am learning ABAP, I am doing some exercise about the basic stuff.

I encountered a problem, If I am using internal table tab_result, sy-subrc will return 4.

if I am using an identical internal table tab_result2, the name1 and maktx will be empty.

I'v checked tab_result and tab_result2, they have value of kunnr and matnr.

I am running HANA.

here is the code.

APPEND LINES OF tab_result TO tab_result2.

SELECT name1
FROM kna1
INTO TABLE tab_result
FOR ALL ENTRIES IN tab_result2
WHERE kunnr = tab_result2-kunnr.

SELECT maktx
FROM makt
INTO TABLE tab_result
FOR ALL ENTRIES IN tab_result2
WHERE matnr = tab_result2-matnr.