Application Development and Automation 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: 
Read only

Select Single

Former Member
0 Likes
279

I am making a query using sq02.

Select Single * from TSP02

where PJFINAHERR = 1.

<b>IF SY-SUBRC = 0.

myvariable = PJIDENT. 'Primary Key

ENDIF.

</b>

thats the short code.

but after testing the query it outputs multiple but same data.

it outputs:

13229

13229

13229

13229

13229

13229

13229

13229

13229

13229

and so on and so forth.

could you pls. advise?

Thank you in advance.

1 REPLY 1
Read only

Former Member
0 Likes
235

see demo code -

tables tsp02.

data myvariable like tsp02-pjident.

Select Single * from TSP02

where PJFINAHERR = 1.

IF SY-SUBRC = 0.

myvariable = tsp02-PJIDENT.

ENDIF.

write: myvariable.