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

Query on fetching data from table

Former Member
0 Likes
1,470

Hi Friends,

My requirement is i have to fetch data from qasr table based on some condition .

when i tried to exexute the report the data is fetched wrongly.

eg :

select x into itab-x frm qasr where y = y.

The qasr table contains only value 1,2,3,4 and 5.

but when i executed the query the value retrived was 6,7,8,9,0 which is not there in the table

i tried with all the logic. This is related to QM

kindly suggest me a solution.

Regards

Yamini.A

8 REPLIES 8
Read only

former_member221770
Contributor
0 Likes
1,243

Yamini,

This is going to sound silly, but check the contents of QASR via SE16. Do you only see 1, 2, 3, 4, 5?

Also could you please paste your select query so we can see what you are doing?

Thanks,

Pat

Read only

Former Member
0 Likes
1,243

Hi,

I have declared my iternal table .sorry the retival should be frm qase table.

My query for retrival of data is

SELECT SINGLE

kurztext steuerkz

INTO (itab2-kurztext,itab2-steuerkz)

FROM qamv

WHERE prueflos = prueflos AND qpmk_werks = werk AND merknr = itab2-merknr.

if itab2-steuerkz8(1) Eq ''.

MOVE itab-probenr TO itab2-probenr.

SELECT SINGLE

original_input

INTO itab2-original_input1

FROM qase

WHERE merknr = itab2-merknr AND

probenr = itab2-probenr AND

detailerg = 1 AND

stuecknr = 1.

SELECT SINGLE

original_input

INTO itab2-original_input2

FROM qase

WHERE merknr = itab2-merknr AND

probenr = itab2-probenr AND

detailerg = 2 AND

stuecknr = 2.

so on....

when i checked with qase table the value of orginal_input was like 1,2,3,4,5

but when i executed the query the value retrived was 6,7,8,9,0

i donno why it is retriving so

Kindly help.

Regards

Yamini.A

Read only

0 Likes
1,243

Yamini,

Humm it looks ok in principle...try putting break points before each select and then as you single step through the program keep an eye on the contents of itab2-original_input1, itab2-original_input2, etc...

It doesn't look like that there are any conversion routine errors...

Let us know how the debugging goes.

Cheers,

Pat.

Read only

0 Likes
1,243

Hi,

Include VORGLFNR also in the where condition.

Read only

Former Member
0 Likes
1,243

Hi,

In the where condition what are fields you're using and check the field has any conversion exit.

Cheeres,

Sasi

Read only

0 Likes
1,243

hi,

Check all the field types which is corrctly defined or not. for ex instead of numc may be defined as integer like that.

Cheers,

Sasi

Read only

Former Member
0 Likes
1,243

Hi Friends,

I have tried debugging also. My declaration of internal table is similar to the the table field. even then i am facing this problem.

Regards

Yamini.A

Read only

0 Likes
1,243

Hi,

check whether your select single statement fetches exact one record.

for example your where conditon fetches more than one record, then the output will be any one of the record. If this is a problem you add all the key fields in the where condition else remove the select single and use into table for all entries.

Cheers,

Sasi