Application Development 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: 

parameters in selection screen

Former Member
0 Kudos

hi all,

in the report, we have 2 parameters in the selection screen i.e., FROM DATE and TO DATE.

AS

PARAMETERS: p_fromdat LIKE kopp-fromdat,

p_todat LIKE kopp-todat.

in the selection screen if we give the data as

FROM DATE : 01.01.2001

TO DATE : 01.01.2009

Do i get the entries only FROM DATE and TO DATE data or FROM DATE and TODATE Inbetween data.

please let me know, i need inbetween data

please help with code to get inbetween range data.

thanks in advance.

8 REPLIES 8

Former Member
0 Kudos

Hi,

If you use parameters it will only consider the date which you enter in the selection screen and not the inbetween range. Instead of parameters use Select-options.


select-options : s_date for kopp-fromdat.

Here enter the high and low values. It will then consider the range in between.

Regards,

Vikranth

Former Member
0 Kudos

hi,

use select option instead of parameter.

select-options : s_data for kopp-fromdat.

then while filtering

select ..........

.......

where fromdat in s_date

and todat in s_date.

Hope this helps..

Rgds.,

subash

Former Member
0 Kudos

Hi Vignesh,

You can follow the solution given by Vikranth or you have one more option.

In the select statement where condition, you can write logical expression as per ur requirement.

where erdat < = todate and erdat > = fromdate.

Hope this also helps.

Rgds,

Sripal

Former Member
0 Kudos

It depends on How you write select query. Always use select options when you try defining ranges in selection screen.

Former Member
0 Kudos

hi,

if you want in range use select-option instead of parameters...... here data what u will get depend on ur query....

Thanks

Ashu SIngh

faisal_altaf2
Active Contributor
0 Kudos

Hi, Sree,

Do the following way if you want to work with PARAMETERS.

TABLES: vbak.
PARAMETERS: pfdate LIKE vbak-audat OBLIGATORY,
            ptdate LIKE vbak-audat OBLIGATORY.

DATA: it_vbak LIKE STANDARD TABLE OF vbak WITH HEADER LINE.

SELECT * INTO CORRESPONDING FIELDS OF TABLE it_vbak
  FROM vbak
  WHERE audat BETWEEN pfdate AND ptdate.

Regards,

Faisal

Former Member
0 Kudos

Hi,

You can use the Select Options ad this will extract the records within that range of Dates. So, you can use the following convention like

Tables : kopp.

SELECT-OPTIONS s_date like kopp-fromdat.

Have a look at the following link for a detailed information of the syntax and usage.

http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba66935c111d1829f0000e829fbfe/content.htm

Hope this helps.

Thanks,

Samantak.

Former Member
0 Kudos

Hello,

If you want the data between fromdate and todate you have to write select query after the event START-OF-SELECTION like:

Select field1 field2 ... fieldn FROM Table_name into table IT_TAB

WHERE DATE BETWEEN fromdate AND todate.

Here after execution of select query you will get the data into internal table IT_TAB which would be between fromdate and todate.

hope this will help.

Best regards,

Vivek