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

Error in select statement

Former Member
0 Likes
1,345

Hi All below is the sample code where it is not fetching the data into itab. Please check where i am doing wrong...


REPORT  YP_TEST1.
tables: pernr , pa0001.
select-options:pernr1 for pa0001-pernr.

data: begin of itab occurs 1.
include structure pa0001.
data:end of itab.

start-of-selection.

select * from pa0001 into table itab where pernr in pernr1

when i am inputting pernr into the selection-screen it is not getting the itab to be populated please let me knwo where i am doing wrong....

Regards

sas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,302

YOu code is !00% correct.. iam getting values for ur code.. please check once weather u contain the data in ur table.

regards

sivaram

13 REPLIES 13
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,302

Hello,

Code looks OK to me. May be that data doesnot exist in the table PA0001.

BR,

Suhas

Read only

Former Member
0 Likes
1,302

could you please copy the code into your system and check please....it is ok definetl y..data is also there i dont know where i am doing wrong!

Regards

sas

Read only

0 Likes
1,302

Hi,

I copied your code in my system . And it is working fine.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,302

Hello Dude,

Works very well for me. Did you check in debug mode the data?

Since ITAB is an internal table with "header line", you need to check as ITAB[] else you will end up viewong the "header line" only.

BR,

Suhas

Read only

Former Member
0 Likes
1,302

Code is 100% fine.

Read only

former_member222860
Active Contributor
0 Likes
1,302

I'm getting the values with your code,, pl. check the data

tables: pernr , pa0001.

data: begin of itab occurs 1.
        include structure pa0001.
data:end of itab.

select-options:pernr1 for pa0001-pernr.

start-of-selection.

  select * from pa0001 into table itab where pernr in pernr1.


  loop at itab.
    write:/ itab-pernr.
  endloop.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,302

just check without employee no input.

Code is fine

Read only

Former Member
0 Likes
1,302

It works fine

Read only

Former Member
0 Likes
1,302

Sas,

Are you sure that the data exists in the system ?

Try to remove pernr in the declaration part of tables.

And activate the code once and try running it.

Read only

Former Member
0 Likes
1,303

YOu code is !00% correct.. iam getting values for ur code.. please check once weather u contain the data in ur table.

regards

sivaram

Read only

0 Likes
1,302

i am so sorry i got confused in different way..

i am just checking in the debug mode it is showing all zeros in header it made confuse.....at the end it is having data....

generally it need to handle the last record in header why is it showing as all zeros in header?any idea?

Regards

sas

Read only

0 Likes
1,302

>

> generally it need to handle the last record in header why is it showing as all zeros in header?any idea?

it is only true after a LOOP or after a SELECT ... APPEND itab ... ENDSELECT, but not after a SELECT ... INTO TABLE

Read only

0 Likes
1,302

wow Eric ..Thnkx....Seems intresting

Regards

sas