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

where condition range

Former Member
0 Likes
846

Hi,

I am using the below code but the data is not selecting as per the where condition date range.it shows sy-subrc =4.

s_datum-option = 'EQ'.

s_datum-sign = 'I'.

s_datum-low = v_date.

s_datum-high = w_lastday.

append s_datum.

read table s_datum index 1.

SELECT * FROM VBRK INTO CORRESPONDING FIELDS OF TABLE I_VBRK

WHERE VKORG IN S_WERKS

AND FKDAT EQ S_DATUM.

In the above code the data is not selecting for s_datum.how to solve the issue.

Thanks,

Rajendra.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
798

Hi,

use BT instead of EQ while building the range

s_datum-option = '<b>BT</b>'.

s_datum-sign = 'I'.

s_datum-low = v_date.

s_datum-high = w_lastday.

append s_datum.

Thanks,

Naren

6 REPLIES 6
Read only

Former Member
0 Likes
798

Hi,

Use IN instead of EQ

SELECT * FROM VBRK INTO CORRESPONDING FIELDS OF TABLE I_VBRK

WHERE VKORG IN S_WERKS

AND FKDAT <b>IN</b> S_DATUM.

Thanks,

Naren

Read only

0 Likes
798

Hi,

I tryed using in also still the sy-subrc is 4 only but i have the data in the vbrk table.

Thanks,

Rajendra.

Read only

0 Likes
798

Oops, I overlooked another thing, you need to use BT as the option.

s_datum-option = 'BT'.

Regards,

Rich Heilman

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
798

You need to use the IN operator.



SELECT * FROM VBRK INTO CORRESPONDING FIELDS OF TABLE I_VBRK
WHERE VKORG IN S_WERKS
AND FKDAT IN S_DATUM. 

Regards,

Rich Heilman

Read only

0 Likes
798

Also, no need for this statement.

read table s_datum index 1.

REgards,

Rich Heilman

Read only

Former Member
0 Likes
799

Hi,

use BT instead of EQ while building the range

s_datum-option = '<b>BT</b>'.

s_datum-sign = 'I'.

s_datum-low = v_date.

s_datum-high = w_lastday.

append s_datum.

Thanks,

Naren