‎2007 Aug 16 8:26 PM
Hi Gurus,
I need to make a report that will include the follwoing fields at the selection screen
starting Time
End Time
and both these times are stored in my custom table z_header, z_header-stime and z_header-etime.
can you please help me out how to do it.
Thanks
Rajeev Gupta
‎2007 Aug 16 8:30 PM
Parameters: P_stime like Z_Header-stime,
P_etime like Z_Header-etime.
-Kriss
‎2007 Aug 16 8:30 PM
Parameters: P_stime like Z_Header-stime,
P_etime like Z_Header-etime.
-Kriss
‎2007 Aug 16 8:35 PM
data: lv_start like z_header-stime ,
lv_end like z_header-etime .
select-OPTIONS: s_start for lv_start,
s_end for lv_end.
‎2007 Aug 16 8:35 PM
Thanks For the Reply Kriss.
Now I need to select all the records from z_header that meet the below conditions:
time period(start and end time) specified in the selection screen
mode = '1' or '2'
and exp1 < exp2
can you please tell me how to do it.
Thanks
Rajeev Gupta
‎2007 Aug 16 8:37 PM
data: lv_start like z_header-stime ,
lv_end like z_header-etime,
lt_tab type table of z_header.
select-OPTIONS: s_start for lv_start,
s_end for lv_end.
select * from z_header into table lt_tab where etime in s_start and
stime in s_end.
‎2007 Aug 16 8:51 PM
Thanks For the reply Amandeep,
Can you also tell me how to take care of other two conditions as well that I specified in my question.
Thanks
Rajeev Gupta
‎2007 Aug 16 9:10 PM
HI Rajeev,
You have been asking the same thing since two days..
data: lv_start like z_header-stime ,
lv_end like z_header-etime,
lt_tab type table of z_header.
select-OPTIONS: s_start for lv_start,
s_end for lv_end.
select * from z_header into table lt_tab where etime in s_start and
stime in s_end and mode in ( '1','2').
exp1 < exp2.. if these two belong to the same table from here you are gettin data i.e z_header you cannot put this condtion rather what you can do is.
after the above select statement.
delete lt_tab where exp1 < exp2.
Thanks
Mahesh
‎2007 Aug 16 9:26 PM
Hey Mahesh,
Thanks for the reply.
First of all I am not stupid , I know I am asking the same thing beacuse I haven't got it resolved. Moreover the code that you have given is not working, you asked me to move every thing to the internal table and then delete the unwanted records and I tried doing the same but its not working.
I think this is a public platform where we all help each other.
Thanks
Rajeev Gupta
‎2007 Aug 16 9:35 PM
Since Stime and Etime are the start and end times, what ever user enters in the parameters Start time and End time of selection screen he wants to get the records which are greater than Starttime and Less than endtime.
So, I think the Select must be
Select * from Z_header into table lt_tab where ( stime ge p_stime and etime le p_etime ) and mode in ('1','2').
There might be some corrections in this code as I am not before the system check the paranthesis and use the code..
-Kriss
‎2007 Aug 16 8:35 PM
Option 1:
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_start LIKE z_header-stime,
p_end LIKE z_header-etime.
SELECTION-SCREEN END OF LINE.
Option 2:
SELECTION-SCREEN BEGIN OF LINE.
SELECT-OPTIONS: s_start FOR z_header-stime,
s_end FOR z_header-etime.
SELECTION-SCREEN END OF LINE.
‎2007 Aug 16 9:34 PM
Is exp1 z_Header-stime and exp2 z_header-etime, if so add to your where clause:
and stime < etime.