Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Help with SQL statement using structures

walkerist
Participant
0 Kudos
141

Hi, I have a local table named t_test that contains a field IDNRK and here are the values:

000000000001019917

000000000001020057

000000000001345359

I was trying to select data from AUSP using the values above. However, I was only able to use 1 as I'm not familiar on how to loop a table into a structure:

      SELECT objek,
atwrt
INTO TABLE @DATA(t_itemcat)
FROM ausp
WHERE objek = @x_test-idnrk
AND atinn = '1234'.

X_TEST-IDNRK comes from T_TEST which has a code:

      LOOP AT t_stbdata INTO DATA(x_stb)
"SOMETHING HERE
ENDLOOP.

IF I WANT TO USE ALL THE T_ITEMCAT IN X_ITEMCAT should I also use LOOP AT?

      LOOP AT t_itemcat INTO DATA(x_itemcat).
ENDLOOP.
1 REPLY 1

Sandra_Rossi
Active Contributor
0 Kudos
100

I don't understand. Better provide an example with input data, expected output, and the rules in plain words.