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 st.

Former Member
0 Likes
557

I have 2 records in my table if I write the below select st. I'm not getting the records

SELECT * FROM z_emp INTO CORRESPONDING FIELDS OF TABLE it_tab

WHERE z_uname = pa_empno and z_date = pa_date.

but if I write the select st. without where clause as below I'm getting the records that I have

SELECT * FROM z_emp INTO CORRESPONDING FIELDS OF TABLE it_tab.

Can you please explain why? Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
534

Hi Shaheen,

SELECT * FROM z_emp INTO CORRESPONDING FIELDS OF TABLE it_tab

<b>WHERE z_uname = pa_empno and z_date = pa_date.</b>

Probably... u r not getting the records becoz the records exist in z_emp table which matches ur requirement z_uname = pa_empno and z_date = pa_date

try to get it manually ...

or look whether the records presents or not as per ur criteria through SE11 ...

Display z_emp nd try to see the records in that... enter ur criteria in parameters here..

Hope it will solve ur problem..

<b>Reward points if useful...</b>

Thanks & Regards

ilesh 24x7

5 REPLIES 5
Read only

Former Member
0 Likes
535

Hi Shaheen,

SELECT * FROM z_emp INTO CORRESPONDING FIELDS OF TABLE it_tab

<b>WHERE z_uname = pa_empno and z_date = pa_date.</b>

Probably... u r not getting the records becoz the records exist in z_emp table which matches ur requirement z_uname = pa_empno and z_date = pa_date

try to get it manually ...

or look whether the records presents or not as per ur criteria through SE11 ...

Display z_emp nd try to see the records in that... enter ur criteria in parameters here..

Hope it will solve ur problem..

<b>Reward points if useful...</b>

Thanks & Regards

ilesh 24x7

Read only

former_member195698
Active Contributor
0 Likes
534

1) Are you passing the right field in the select query (Is Empno and Username the same field or by mistake you are comparing UNAME with the Employee Number field )

2) Check if the data is present in the database with the parameters that you are using for testing.

Read only

Former Member
0 Likes
534

Hi,

Check Z_EMP is having the records with date pa_date you are passing.

Regards,

Satish

Read only

Former Member
0 Likes
534

You may have to run pa_empno through a conversion exit to pad it with the correct number of leading zeroes. Look at FMs <b>conversion_exit_ alpha_input</b> and <b>conversion_exit_ alpha_output</b>.

Rob

Read only

Former Member
0 Likes
534

Hi Shaheen

In you question you said that you have 2 record in the table. Does that mean there are only two records in the table or 2 records that satisfy the condition in where clause.

In both the cases.

The only thing can be that parameters that you are selecting in the SELECT statement does not match.

As previous replies suggested check out in SE16 Data Browser. If any concerns please reply.