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

Selection Screen

Former Member
0 Likes
819

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

1 ACCEPTED SOLUTION
Read only

former_member192429
Active Participant
0 Likes
802

Parameters: P_stime like Z_Header-stime,

P_etime like Z_Header-etime.

-Kriss

10 REPLIES 10
Read only

former_member192429
Active Participant
0 Likes
803

Parameters: P_stime like Z_Header-stime,

P_etime like Z_Header-etime.

-Kriss

Read only

0 Likes
802
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.
Read only

0 Likes
802

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

Read only

0 Likes
802

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.
Read only

0 Likes
802

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

Read only

0 Likes
802

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

Read only

0 Likes
802

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

Read only

0 Likes
802

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

Read only

Former Member
0 Likes
802

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.

Read only

Former Member
0 Likes
802

Is exp1 z_Header-stime and exp2 z_header-etime, if so add to your where clause:

and stime < etime.