‎2008 Feb 05 7:48 AM
Hi,
I have an internal table lfa1
which has fields lifnr
name1
land1 and
created_date
in the function module
in the table parametrs
date like zdata
zdata has two fields
1. from(8) type c,
2. to(8) type c.
select lifnr name1 land1 created_date from lfa1
into table i_lfa1
where created_date = R
HERE IN THE R I HAVE TO PASS THE RANGE OF DATE BETWEEN FROM AND TO WHICH ARE IN THE TABLE PARAMETERS.
that from and to range date will be given by the enduser.
note: dont say that created _date is not in the lfa1 table here I just used for explanation purpose.
‎2008 Feb 05 7:52 AM
Hi!
You can use a RANGE for that:
DATA: lt_date TYPE RANGE OF <data element>,
ls_date LIKE LINE OF lt_date.
ls_date-sign = 'I'.
ls_date-option = 'BT'.
ls_date-low = <first_date>
ls_date-high = <second_date>.
append ls_date to lt_date.
SELECT * FROM <tab> WHERE dat IN lt_date.
So you have the SELECT that you want to have.
Reward if useful
Greets
Edited by: JetGum on Feb 5, 2008 8:53 AM
‎2008 Feb 05 7:58 AM
hI
POPULATE UR RANGE LIKE THIS
RANGES RA_DATE TYPE SY-DATUM .
loop AT ZDATA .
ra_DATE = 'I'.
ra_DATE-option = 'EQ'.
ra_DATE-low = so_ekgrp-low.
APPEND ra_DATE.
CLEAR: ra_DATE.
ENDLOOP .
SELECT < FIELDS FOR SELECTION > INTO TABLE l_t_ekgrp
FROM < DB RTABLE >
WHERE CREATE_DATE in ra_DATE.
hOPE IT HELPS.
pRAVEEN
‎2008 Feb 05 7:58 AM
This can be possible through ranges.
Ranges: r_date for vbak-erdat.
CLEAR R_date.
REFRESH R_date.
R_date-SIGN = 'I'.
R_date-OPTION = 'EQ'.
R_date-LOW = 'date low value'
R_date-HIGH = 'date high value'.
APPEND R_date.
Select f1 f2 from lfa1 into table i_lfa1 where date in r_date.
Regards,
Kumar.
‎2008 Feb 05 7:59 AM