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: 

select from table

Former Member
0 Kudos

Hi,

I would like to select the PSPID from table PROJ with POST1.

I don´t understand why it doesn´t work.

Here is my select statement.

SELECT PSPID POST1

FROM PROJ

Into wa_tab

WHERE PSPID EQ B_PSPID .

ENDSELECT.

The fields are empty, i don´t understand this.

regards

11 REPLIES 11

prasanth_kasturi
Active Contributor
0 Kudos

Hi,

Did you check the data in the table is present or not according to your where condition

I think no data in your database table

regards

prasanth

Former Member
0 Kudos

check the sy-subrc value after the select query. If its 4 then no records were selected and so the fields are empty.

Former Member
0 Kudos

hi

check the table entries in PROJ for the matching entries in the where clause.

Former Member
0 Kudos

Hi Sabine,

If B_PSPID is a select-option

then the code should like this :

SELECT PSPID POST1

FROM PROJ

Into wa_tab

WHERE PSPID in B_PSPID .

ENDSELECT.

This is more optimestic:

SELECT PSPID POST1

FROM PROJ

Into table i_tab

WHERE PSPID EQ B_PSPID .

0 Kudos

thank you for the answers,

I have looked in the table. I´ve took the Post1 to select the PSPID and POST1 together.

SELECT PSPID POST1

FROM PROJ

Into table i_project

WHERE POST1 EQ "a project description", I get empty field, but there are a many data sets in the table PROJ.

But when I take the WHERE PSPID EQ "12345", it works.

I dont understand what is the difference between POST1 and PSPID?

0 Kudos

Hi,

PSPID is the keyfield for the table PROJ, when you use " WHERE PSPID EQ '12345' " statement, it returns you the matching values for sure if there is any, but POST1 is a text field and using a text field in an SQL query is not an efficient way to get matching values (uppercase-lowercase conflict may be an example).

that is the difference between POST1 and PSPID.

regards,

Murat Kaya

0 Kudos

Hi,

OK


DATA: lt_proj TYPE STANDARD TABLE OF proj.

SELECT * FROM proj INTO TABLE lt_proj WHERE post1 = 'test'.

NOT OK


DATA: lt_proj TYPE STANDARD TABLE OF proj.

SELECT * FROM proj INTO TABLE lt_proj WHERE post1 = 'TEST'.<<---------------------

So, it's case sensitive!

Adibo.

0 Kudos

-> look at domain PS_PSPID

notice the conversion routine ABPSN

CONVERSION_EXIT_ABPSN_INPUT / output

A.

0 Kudos

Hi.

SELECT PSPID POST1

FROM PROJ

Into table i_project

WHERE POST1 EQ "a project description", I get empty field, but there are a many data sets in the table PROJ.

But when I take the WHERE PSPID EQ "12345", it works.

As you mentioned that it is working for PSPID Eq '12345' and not for 'a project description'. it seems to be case sensitive problem or else pattern problem. so please check case first. if its is fine then try to write CP ( contains pattern ) in where condition.

Hope this will give you some idea,

Regards,

Aswini.

Former Member
0 Kudos

Hi,

Try selecting with the query,

SELECT PSPID POST1

FROM PROJ

Into table i_project

WHERE POST1 EQ 'A PROJECT DESCRIPTION'.

ENDSELECT.

Hope this will help you.

Best Regards,

Suresh

Former Member
0 Kudos

ok, thank you very much to all.

regards