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

select-option

Former Member
0 Likes
912

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
846

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

7 REPLIES 7
Read only

Former Member
0 Likes
847

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

Read only

0 Likes
846

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

Read only

0 Likes
846

Hi Suprith,

My reply resolves your requirement. Check that.

Best Regards,

Ram.

Read only

Former Member
0 Likes
846

data : sel_optio type RSPARAMS occurs 0.

RSPARAMS -


>ABAP: General Structure for PARAMETERS and SELECT-OPTIONS

Read only

Former Member
0 Likes
846

You can use ranges and append them with ur values

Read only

Former Member
0 Likes
846

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.

Read only

Former Member
0 Likes
846

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.