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

Custom selection values for query

nibiklavic
Explorer
2,610

Hello together,

is it possible to fill the time range for a SQ01 seleciton screen with coding in SQ02?

The selection I need is not available in standart variant customization. I need to select LIKP-ERZET values from SYUZEIT-30min until SYUZEIT.

I tried :

SP$00002-LOW = sy-uzeit - 60

SP$00002-HIGH = sy-uzeit

in the SQ02 Coding/Initialization Page.

But since I have no experience in ABAP, this code is obviously not working.

Thanks in advance and best regards

Niklas

1 ACCEPTED SOLUTION
Read only

Former Member
1,369

Hi Niklas,

If you want to remove 30 min from the current time, try this:

data lv_30min_less type syst-uzeit.
data lv_30min type syst-uzeit value '003000'.

lv_30min_less = sy-uzeit - lv_30min.

I hope it helps.

Cheers,

Rafael

3 REPLIES 3
Read only

Former Member
1,370

Hi Niklas,

If you want to remove 30 min from the current time, try this:

data lv_30min_less type syst-uzeit.
data lv_30min type syst-uzeit value '003000'.

lv_30min_less = sy-uzeit - lv_30min.

I hope it helps.

Cheers,

Rafael

Read only

0 Likes
1,369

Hello Rafael,

thanks for your input. But how can I pass this value to my selection field?

SP$00002-LOW =.... is not working

Regards

Niklas

Read only

Former Member
1,369

Hi Niklas

To do that, the field should be on the selection screen, and I don't think those fields are assigned in the Initialization section. I have an example that works is the Start-of-selection:

ranges my_opt for kna1-kunnr.
field-symbols <scr_opt> type standard table.

assign ('SP$00001[]') to <scr_opt>.
my_opt-sign = 'I'.
my_opt-option = 'EQ'.
my_opt-low = '0001026868'.
my_opt-high = ''.

append my_opt to <scr_opt>.

Regards,

Rafael