cancel
Showing results for 
Search instead for 
Did you mean: 

WD4A select options, default value

Former Member
0 Kudos

Hello,

while using the select option screen i tried to fill a default value in one of my fields. I used:

*add a new field to the selection

wd_this->m_handler->add_selection_field(

i_id = 'Z_TEST'

it_result = lt_range_table

i_memory_id = 'SXV'

i_no_intervals = abap_true

i_no_extension = abap_true ).

I checked that the parameter ID SXV is filled but there is no default value in the dynpro.

Any ideas?

best regards

stefan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Stefan.

Is it necessary to use memory id's for you?

It is quiet easy to work with field-symbols and

add a value to the range table:


  data:
        ls_tmprange    type rsparams.

  field-symbols:
                 <fs_param>      type any,
                 <fs_range>      type any,
                 <fs_rangetable> type table.

  ls_tmprange-low = some value.
  ls_tmprange-sign = some value.
  ls_tmprange-option = some value.

  assign lt_range_table->* to <fs_rangetable>.
  create DATA lr_headerline like LINE OF  <fs_rangetable>.
  ASSIGN lr_headerline->* to <fs_range>.
  move-CORRESPONDING  ls_tmprange to <fs_range>.
  append <fs_range> to <fs_rangetable>.

After that you can call add_selection_field with lt_range_table.

Hope this helps.

Cheers,

Sascha

Former Member
0 Kudos

Hello Sasha,

thank you for your answer. I think that memory id is necessary for me because in the first field I want to put the username and in the the next field the current date.

regards

stefan

Former Member
0 Kudos

Hi Stefan.

Maybe I do not get what you mean.

But assigning user and date could also be done this way. Right after you have

created the range table you can use the above code to set the user as default to

the range.

Regards,

Sascha

Former Member
0 Kudos

Hello Sasha,

you did understand me very well, but I mixed up the range_table and the value_set, sorry. What you wrote is exactly what I need.

But when I using your coding I get the error that field lr_headerline is unknown. Could you please give me one more hint how to declare it.

Thanks a lot.

best regards

stefan

Former Member
0 Kudos

Hello Sascha,

its working!

Thanx and regards.

stefan

Former Member
0 Kudos

Hi Stefan.

Sorry I just copied a code snippet from my method. So the variable was missing.

But you made it anyway.

Cheers,

Sascha

Answers (0)