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 with date in select querry

Former Member
0 Likes
633

Hi Friends,

I need to write a select querry to get the data in the internal table with date as condition.(Ex: Data should be captured in before 31.03.2005)

I have coded in this way, But I am unable to get the data.

SELECT gpart opbel betrw fdgrp INTO CORRESPONDING FIELDS OF TABLE lt_balance1 FROM dfkkop

WHERE fdgrp = s_augrp-low

AND hvorg = '5000'

AND tvorg = '0100'.

AND faedn LE 20050331.

Can any one correct the following code,

Thanx and Regards,

Line

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
606

Put the date in Quotes

SELECT gpart opbel betrw fdgrp INTO CORRESPONDING FIELDS OF TABLE lt_balance1 FROM dfkkop

WHERE fdgrp = s_augrp-low

AND hvorg = '5000'

AND tvorg = '0100'.

<b>AND faedn LE '20050331'</b>.

Hi Friends,

I need to write a select querry to get the data in the internal table with date as condition.(Ex: Data should be captured in before 31.03.2005)

I have coded in this way, But I am unable to get the data.

SELECT gpart opbel betrw fdgrp INTO CORRESPONDING FIELDS OF TABLE lt_balance1 FROM dfkkop

WHERE fdgrp = s_augrp-low

AND hvorg = '5000'

AND tvorg = '0100'.

AND faedn LE 20050331.

Can any one correct the following code,

Thanx and Regards,

Line

4 REPLIES 4
Read only

Former Member
0 Likes
607

Put the date in Quotes

SELECT gpart opbel betrw fdgrp INTO CORRESPONDING FIELDS OF TABLE lt_balance1 FROM dfkkop

WHERE fdgrp = s_augrp-low

AND hvorg = '5000'

AND tvorg = '0100'.

<b>AND faedn LE '20050331'</b>.

Read only

Former Member
0 Likes
606
try this..

data : v_date like sy-datum value '20050331'.

SELECT gpart opbel betrw fdgrp INTO CORRESPONDING FIELDS OF TABLE lt_balance1 FROM dfkkop
WHERE fdgrp = s_augrp-low
AND hvorg = '5000'
AND tvorg = '0100'.
AND faedn LE v_date.

Also check out if there is any data with the values u had given in where condition

Read only

Former Member
0 Likes
606

<b>data: v_date type sy-datum.

move '20050331' to v_date</b>.

SELECT gpart opbel betrw fdgrp INTO CORRESPONDING FIELDS OF TABLE lt_balance1 FROM dfkkop

WHERE fdgrp = s_augrp-low

AND hvorg = '5000'

AND tvorg = '0100'.

AND faedn LE <b>v_date.</b>

Read only

Former Member
0 Likes
606

Hello ,

DO like this.

data : v_date like sy-datum.

v_date = '20050331'.

SELECT gpart opbel betrw fdgrp INTO CORRESPONDING FIELDS OF TABLE lt_balance1 FROM dfkkop

<b>WHERE fdgrp in s_augrp</b>

AND hvorg = '5000'

AND tvorg = '0100'.

<b>AND faedn LE v_date.</b>

If useful reward

Vasanth