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

Problem in Select statement

Former Member
0 Likes
634

Hi All,

I am developing a custom report.

I have defined a selection screen in which one field will be Period (S003-SPBUP).

This field will be a select-options field.

Now while retrieving data from S003 table based on selection screen, i am unable to get the desired data within the specified Period (S003-SPBUP) values.

I can retrieve the data manually from table by inputting the same value as i enter in the Program's selection screen.

What might be the reason behind this issue?

Regards

Pavan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
611

Hi Pavan,

How did you define your select-option?

Regards,

John.

6 REPLIES 6
Read only

Former Member
0 Likes
612

Hi Pavan,

How did you define your select-option?

Regards,

John.

Read only

0 Likes
611

SELECTION-SCREEN BEGIN OF BLOCK MERKMALE WITH FRAME TITLE TEXT-003.

SELECT-OPTIONS: S_MATNR FOR S003-MATNR.

select-options: S_VKORG FOR S003-VKORG.

select-options: S_VTWEG FOR S003-VTWEG.

SELECTION-SCREEN END OF BLOCK MERKMALE.

SELECTION-SCREEN BEGIN OF BLOCK MCPERIOD WITH FRAME TITLE TEXT-002.

select-options: S_SPBUP for S003-SPBUP.

SELECTION-SCREEN END OF BLOCK MCPERIOD.

start-of-selection.

select matnr vkorg vtweg spbup aenetwr stwae umnetwr ummenge

from s003

into corresponding fields of table itab

where spbup in s_spbup

and vkorg in s_vkorg

and vtweg in s_vtweg

and matnr in s_matnr

and spbup in s_spbup.

Read only

0 Likes
611

Hi Pavan,

In the select statement you have written "into corresponding fields of table itab". Please check the internal table itab to see if it has similar names what you are retrieving from the database S003. Check the itab if it has atleast any one of the fields with same name as " matnr vkorg vtweg spbup aenetwr stwae umnetwr ummenge. This may be one reason why you are not getting the records programaticallly when records exist in database.

Regards,

Yellappa.

Read only

0 Likes
611

Hi Pavan,

you write s_pbup twice in the select clause.

Maybe this is causing the problem.

"in" should be ok and better than "between"

regards

Frank

Read only

Former Member
0 Likes
611

Hi Pavan,

Use IN Operator instead of '=' for select-options variable in you r select query.

For ex..

select * from mara where matnr IN s_mat ( ur select-oprion varialble ).

if u gave In means

check with all other conditions which u passing select query..

same manually in table.

Thanx

bgan.

Read only

Former Member
0 Likes
611

Hi Pavan

Instead of using the IN operator try using between option for

lower & higher limit of select-option for date.