‎2017 Nov 16 3:59 PM
Hi,
I have a problem with my select single statement:
SELECT single * FROM setleaf
WHERE setclass = var
AND setname = var1
AND valfrom = vbrk-regio.
SELECT SINGLE * FROM setlinet
WHERE setclass = var
AND setname = var1
AND lineid = setleaf-lineid
AND langu LIKE sy-langu.
Both the select statements are not working. I have more queries that work well. but these last ones do not work.
Please help me. I am a newbie in abap.

The first image is from debugger and after the select, it has not providing result.

The second image is from the table SETLEAF(First select) and you can see with the help of the transaction that you have data.

The third image is from table SETLINET (Second Select) and you can also see the data.
Then I can not find where I'm wrong or what I'm missing
‎2017 Nov 18 10:28 PM
Hello everyone, I found a solution for my problem.
Thank you very much for your comments and help.
The solution was very simple:
In my select statement I just needed to uppercase the value in my where clause for example:
SELECT single * FROM setleaf
WHERE setclass = '0000'
AND setname = 'tax_st'. change to this => 'TAX_ST'
AND valfrom = vbrk-regio.
SELECT SINGLE * FROM setlinet
WHERE setclass = '0000'
AND setname = 'tax_st' change to this => 'TAX_ST'
AND lineid = setleaf-lineid
AND langu LIKE sy-langu.
And problem solved.
Regards.
‎2017 Nov 16 4:15 PM
I am not sure about your target structure as you have not mentioned in your query.
But select single * will always return the first records with all the fields of the table matching your where criteria.
If you can write your exact select query then I can let you know the problem.
Currently what is vbrk-region(as you cannot pass the full table) or may be you are trying to just explain.
Not working means -> Not providing result or giving dump?
‎2017 Nov 16 4:29 PM
HI,
Thanks for your time.
The select statement It does not return data.
I did tests on transaction se16 and there is data then I do not know what is my error.
‎2017 Nov 16 6:33 PM
Pl. do a sy-subrc check against your first SELECT, before proceeding to the next SELECT statement. This is very dangerous statement, in case you plan to do a update on the table based on that, in real time scenario.
Hard code a break-point against your useID, activate and check how the execution goes, and how the tables gets filled.
Could be a change in your logical conditions
‎2017 Nov 16 4:15 PM
What do you want to achieve with
AND langu LIKE sy-langu.
Where are your INTO clauses
???
SELECT is thoroughly documented.
https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abapselect.htm
‎2017 Nov 16 5:11 PM
I think he wont get any result either if he copies and pastes your example
‎2017 Nov 16 6:03 PM
As suggested by others you have not done your homework of checking already available resources. Please search thoroughly.
You can even look at t-code ABAPDOCU which has various sample program available which you can analyse and debug to creat an understanding of open SQL.
‎2017 Nov 16 6:26 PM
believe me I've seen documentation and tried many things, this is why I need help, since I've seen querys similar to mine
‎2017 Nov 17 5:10 AM
Open SE16N and enter the values for which you are getting data from SETLEAF table. Then click on display selection criteria which will show the select statement which the standard SAP code generates to fetch the data. Now compare your understanding with same and validate.
‎2017 Nov 16 9:18 PM
‎2017 Nov 16 9:57 PM

Assume the box with the holes is your table and the bricks are your variables.
You showed us just the box, but not your variables.
How could anyone know what value you have there and if that matches with the value in the table.
‎2017 Nov 17 3:21 PM
Hi Andres Gomez,
Go through below syntax. You have written select statement but you doesn't mention workarea or internal table to hold the data records.
* wa_setleaf should be setleaf table structure.
SELECT single * FROM setleaf into wa_setleaf
WHERE setclass = var
AND setname = var1
AND valfrom = vbrk-regio.
* wa_setlinet should be setlinet table structure.
SELECT SINGLE * FROM setlinet into wa_setlinet
WHERE setclass = var
AND setname = var1
AND lineid = setleaf-lineid
AND langu = sy-langu.
Thanks.
‎2017 Nov 18 10:28 PM
Hello everyone, I found a solution for my problem.
Thank you very much for your comments and help.
The solution was very simple:
In my select statement I just needed to uppercase the value in my where clause for example:
SELECT single * FROM setleaf
WHERE setclass = '0000'
AND setname = 'tax_st'. change to this => 'TAX_ST'
AND valfrom = vbrk-regio.
SELECT SINGLE * FROM setlinet
WHERE setclass = '0000'
AND setname = 'tax_st' change to this => 'TAX_ST'
AND lineid = setleaf-lineid
AND langu LIKE sy-langu.
And problem solved.
Regards.
‎2017 Nov 18 10:49 PM