‎2008 Dec 12 6:01 AM
Hi all,
i'm getting the two variables Low date and High date which is not from the selection screen,
this i'm doing manually n getting low and high values.
now i want to make this two variable as the internaltable of select-options. so tat i can pass into select statement.
please help me ..
Regards
Suprith
‎2008 Dec 12 6:04 AM
Hi Suprith,
As i understand you want to build a range for dates and use it in your select statement. YUo can do this as follows.
data: t_r_date type TRGR_DATE,
wa_date type TRGS_DATUM.
wa_date-sign = 'I'. " (Includes)
wa_date-option = 'BT'. " (Between) - *you can also use 'EQ'*
wa_date-low - "date
wa_date-high = "date.
Append wa_date to t_r_date.
Now, you can use t_r_date in your select statement.
Best Regards,
Ram.
Edited by: ram Kumar on Dec 12, 2008 7:04 AM
Edited by: ram Kumar on Dec 12, 2008 7:07 AM
‎2008 Dec 12 6:04 AM
Hi Suprith,
As i understand you want to build a range for dates and use it in your select statement. YUo can do this as follows.
data: t_r_date type TRGR_DATE,
wa_date type TRGS_DATUM.
wa_date-sign = 'I'. " (Includes)
wa_date-option = 'BT'. " (Between) - *you can also use 'EQ'*
wa_date-low - "date
wa_date-high = "date.
Append wa_date to t_r_date.
Now, you can use t_r_date in your select statement.
Best Regards,
Ram.
Edited by: ram Kumar on Dec 12, 2008 7:04 AM
Edited by: ram Kumar on Dec 12, 2008 7:07 AM
‎2008 Dec 12 6:08 AM
the o/p wat i need is.....
internal table shoul look like this
sign option low high
I BT 01.03.2008(low date) 10.03.2008(high date)
Regards
Suprith
‎2008 Dec 12 6:09 AM
Hi Suprith,
My reply resolves your requirement. Check that.
Best Regards,
Ram.
‎2008 Dec 12 6:05 AM
data : sel_optio type RSPARAMS occurs 0.
RSPARAMS -
>ABAP: General Structure for PARAMETERS and SELECT-OPTIONS
‎2008 Dec 12 6:09 AM
‎2008 Dec 12 6:12 AM
SEE THE FOLLOWING EXAMPLE
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : p_vkorg FOR vbrk-vkorg OBLIGATORY. "Sales Organization
SELECT-OPTIONS : p_vtweg FOR vbrk-vtweg. "Distribution Channel
SELECT-OPTIONS : p_dev FOR vbrk-spart. "Division
SELECT-OPTIONS : p_cust FOR kna1-kunnr. "Customer Code
SELECT-OPTIONS : p_date FOR vbrk-fkdat. "Invoice Date
SELECTION-SCREEN : END OF BLOCK b1.
initialization.
p_date-low = sy-datum - 30.
p_date-high = sy-datum.
p_date-option = 'BT'.
p_date-sign = 'I'.
append p_date.
‎2008 Dec 12 6:13 AM
You can code in INITIALIZATION event. Code example:
SELECT-OPTIONS: s_ktokd FOR kna1-ktokd.
***********************************************************************
*INITIALIZATION.
***********************************************************************
INITIALIZATION.
DATA t_ktokd LIKE kna1-ktokd.
SELECT ktokd INTO t_ktokd FROM t077d
WHERE ktokd NOT IN ('3001','5001').
CLEAR s_ktokd.
s_ktokd-sign = 'I'.
s_ktokd-option = 'EQ'.
s_ktokd-low = t_ktokd.
APPEND s_ktokd.
ENDSELECT.