‎2008 Mar 06 5:25 AM
Hi,
i have the foll problem:
I have a parameter on the selection screen called P_tarea and slect-options called s_date.i have done validations on the date to check that the from and to dates are having a gap of 5 days. i have to check the following conditions:
if the p_tarea field is initial. i have to fetch all the records from internal table (for the mentioned dates at selection screen) which have an entry in the davgte field of the same table.
plz reply.
‎2008 Mar 06 5:28 AM
Hi
*to validate date
If s_date-high - s_date-low < 5.
message..
endif.
*to retrive data
If p_area[] is not initial.
retrieve data.
endif.
Regards
Aditya
‎2008 Mar 06 5:35 AM
HI,
You have to loop at the internal table from which you have to fetch ur data. Please refer to the sample code below.
Loop at <internal table> into <workarea> where davgte LE sdate-high and davgte GE sdate-low.
*Fetch ur data from <workarea>.
EndLoop.
Regards,
Gaurav
‎2008 Mar 06 5:35 AM
Hi anand chidambaram,
You can diclare P_tarea is also as a select-options.
See the following code
select-options:
s_tarea for dtab-tarea NO-EXTENSION
NO INTERVALS,
s_date for sy-datum.
Data w_no type i.
AT SELECTION-SCREEN.
loop at s_date.
w_no = s_date-high - s_date-low.
if w_no < 5.
message e999 with 'Lessthan 5 day'.
endif.
endloop.Note : There is no need to chech either s_tarea is initial or not because i declared it as select-options so by default if it is initial it fetch all the records.
Reward if it is useful,
Mahi.
‎2008 Mar 06 5:36 AM
Hi,
if p_tarea field is initial.
loop at internal table
if wa-davgte not initial.
append wa to another internal table.
endif.
endloop.
endif.
Now your second internal table will have the required data.
Hope this will help you.
Regards
Shibin