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 OPTIONS PROBLEM

Former Member
0 Likes
641

hello all,

i have two date fields BLDAT & BLDAT1 in selection-screen, and i hardcoded the second date in program. but problem is that when i m picking data by passing BLDAT1(that is hardcoded date) then its making no effect and picking all data from table. can anyone please help me?

code :

bldat1-low = '20080101'.

bldat1-high = '20080131'.

g = '2008'.

IF ITAB[] IS NOT INITIAL.

SELECT bldat awkey FROM bkpf INTO TABLE itab2 WHERE bldat IN bldat1

AND blart = 'RE'

AND bukrs = '1000'

AND gjahr = g.

endif.

regards saurabh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
575

Hi saurabh,

You need to also provide values for SIGN (I) and OPTION (EQ).

You need to APPEND the bldat1 to the internal table bldat1.

So,


bldat1-sign = 'I'.
bldat1-option = 'BT'. " u can also use  'EQ'
bldat1-low = value.
bldat1-high - value.
append bldat1 to bldat1.

Best Regards,

Ram.

4 REPLIES 4
Read only

Former Member
0 Likes
576

Hi saurabh,

You need to also provide values for SIGN (I) and OPTION (EQ).

You need to APPEND the bldat1 to the internal table bldat1.

So,


bldat1-sign = 'I'.
bldat1-option = 'BT'. " u can also use  'EQ'
bldat1-low = value.
bldat1-high - value.
append bldat1 to bldat1.

Best Regards,

Ram.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
575

Hello Saurabh,

Try this:


bldat1-sign = 'I'
bldat1-option = 'BT'.
bldat1-low = '20080101'.
bldat1-high = '20080131'.
APPEND bldat1.

@ Ram: You cannot use EQ for HIGH & LOW values )

Hope this helps.

BR,

Suhas

Edited by: Suhas Saha on Dec 16, 2008 12:37 PM

Read only

Former Member
0 Likes
575

Hi,

You will have to append the values to the selection table before applying it in the select query.

e.g.

bldat1-low = '20081201'.

bldat1-high = '20081231'.

bldat1-sign = 'I'.

bldat1-option = 'BT'.

append bldat1.

now use it in the select statement.

select f1 f2 from table name where bldat in bldat1.

Regards,

Sachin Dargan

Read only

Subhankar
Active Contributor
0 Likes
575

Hi....

Select option contain 4 field. SIGN, OPTION, LOW and HIGH.

use the your code as below...

bldat1-sign = 'I'.

bldat1-option = 'BT'. -


> It should be BT as you have passed value in HIGH

bldat1-low = '20080101'.

bldat1-high = '20080131'.

g = '2008'.

IF ITAB[] IS NOT INITIAL.

SELECT bldat awkey FROM bkpf INTO TABLE itab2 WHERE bldat IN bldat1

AND blart = 'RE'

AND bukrs = '1000'

AND gjahr = g.

endif.