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 query not selecting values into table

dayakar_sama
Explorer
0 Likes
1,613

Hi,

i want the AUFNR to be extracted from QMEL for a QMNUM, i used the below statement, but it is showing sy-subrc = 4.

IF git_qmnum[] IS NOT INITIAL.

    SELECT qmnum

           aufnr

          FROM qmel

        INTO TABLE git_qmel

          FOR ALL ENTRIES IN git_qmnum

          WHERE qmnum EQ git_qmnum-qmnum.

  ENDIF.

please help

regards,

sama

Moderator message : Not enough re-search before posting, discussion  locked.

Message was edited by: Vinod Kumar

8 REPLIES 8
Read only

naveen_inuganti2
Active Contributor
0 Likes
1,516

Hope your table git_qmel declaration is correct with qmnum and aufnr fields.

Then, check in debug mode what values are coming into for all entries table and copy one of then from debugging screen and check in SE11 if we have data for it.

Regards,

Naveen.I

Read only

Kanagaraja_L
Active Contributor
0 Likes
1,516

Share your SQL Statement to fill git_qmnum

Read only

Former Member
0 Likes
1,516

Hi ,

The query looks correct, so please check the following

1. Does the value that exists in internal table git_qmnum exist in the db table .

2. Data type of the field qmnum in the internal table and the value in the field must have preceding '0' where ever needed . Please see some entry in table QMEL for example.

I think in your scenario case 2 must be more relevant.

Regards

Arun

Read only

0 Likes
1,516

Hi,

git_qmnum is having the value of qmnum. i checked it, and i also used the conversion_exit_alpha_input for aufnr to get the preceeding 0's.

Read only

0 Likes
1,516

Hi ,

is it conversion exit for aufnr or for QMNUM. I would expect the conversion exit to be used for QMNUM.

If you are doing this then really don't understand why the statement does not work ,  if possible you can post some sample data or attach screen shots.

Regards,

Arun

Read only

former_member404244
Active Contributor
0 Likes
1,516

Hi,

Check if the data is there or not in the table...

Regards,

Nagaraj

Read only

0 Likes
1,516

qit_qmnum is not intiail

Read only

0 Likes
1,516

Hello,

check the way fields declared in internal table or types declaration are in the same order as you are selecting in select query.

Best Regards

Himayat