2008 Jul 30 6:37 AM
Hi,
I have a requirement ....I have a select option in selection screen which is a date field.
I need to capture the values entered in select option for date in an internal table in the program.
Pls give me a logic to do this
Thanks in advance
Sarvan
2008 Jul 30 6:40 AM
Hi Saravana ,
Write your code something like this :
select-options :
s_date for sy-datum.
select <field names you want>
from <db tab name>
into <int tab name>
where <date-field name in db tab> in s_date.
This will retrieve the records you want for the entered date values from the db table in to your internal table.
Regards,
Swapna.
2008 Jul 30 6:59 AM
Hi,
Thanks for ur reply..
What i need is....I am giving value range for date in select option in the selection screen say from 20.07.2008 to 30.07.2008 . In this case I need to capture the 10 dates from 20th to 30th and all these date values shuld be there in my internal table...
Pls let me know how can i do this
Regards
Saravan
2008 Jul 30 7:02 AM
Hi,
u can store the select option low and high values in the variables.
2008 Jul 30 6:40 AM
Hi
data :
begin of fs_struct,
d1 type d,
d2 type d,
End of fs_struct.
START-OF-SELECTION
fs_-struct-d1 = s-fld1-low
fs_-struct-d1 = s-fld1-high
append fs_-struct to tab.
Regards
Pavan
2008 Jul 30 6:41 AM
Hi,
Select options is itself an internal table. So you can directly use the values in select options by looping on select option or you can move the values to the internal tableby looping the select option.
2008 Jul 30 6:43 AM
Hi!
Check out this sample code.
REPORT z_sdn.
SELECT-OPTIONS:
s_date FOR sy-datum.
DATA:
BEGIN OF fs_emp,
empname(10) TYPE c,
ldate TYPE sy-datum,
hdate TYPE sy-datum,
END OF fs_emp.
DATA:
t_emp LIKE
TABLE OF
fs_emp.
CLEAR fs_emp.
fs_emp-empname = 'XYZ'.
fs_emp-ldate = s_date-low.
fs_emp-hdate = s_date-high.
APPEND fs_emp TO t_emp.
LOOP AT t_emp INTO fs_emp.
WRITE:
/ fs_emp-empname,
fs_emp-ldate,
fs_emp-hdate.
ENDLOOP.
Regards
Abhijeet
2008 Jul 30 6:44 AM
2008 Jul 30 6:44 AM
select-options :
sdate for sy-datum.
select <field names>
from <db tab name>
into <int tab name>
where <date-field name in db tab> in sdate.
try this it will work out .
2008 Jul 30 6:45 AM
Dear Sravan,
whenever the user enters some condtions/values in the select option on the screen, these values are automatically available in an internal table with the same name of the select option.
for example :
select option : s_first for spfli-carrid.
here s_first would be an internal table with values/conditions selected by the user at runtime with the fallowing structure. you can check the same at runtime.
SIGN OPTION LOW HIGH
Reward points if helpful
Thanks
Damodar
2008 Jul 30 6:53 AM
Hi
Tty this ...
DATA: date1 type sy-datum.
SELECT-OPTIONS:so_date FOR date1 .
START-OF-SELECTION.
You can get the values of the SELECT-OPTION object using its low and high components
Eg. WRITE:/ so_date-low, so_date-high.
Hope it helps.
Murthy
2008 Jul 30 7:09 AM
hi,
Well for this you have to create one variable of Sy-datum type.
DAta:
date type sy-datum,
date2 type sy-datum.
date = s_date-low.
while date LE s_date-high.
wa_itab-date = date..
modify t_itab form wa_itab index 1.
add 1 to date.
endwhile.
Regards
Sumit Agarwal
2008 Jul 30 7:35 AM
Hi,
PLease use FM CBIH_LB39_DAYS_TABLE_GET, you will get the values in the table parameter X_DAYS_TAB.
Thanks,
Sriram Ponna.