cancel
Showing results for 
Search instead for 
Did you mean: 

Default Value for parameter field

Former Member
0 Kudos

Hi,

i tried to add a default value to a parameter field with the following code.


  CREATE DATA lr_data TYPE (wd_assist->c_kagru).
  ASSIGN lr_data->* TO <fs_any>.
  <fs_any> = wd_assist->c_kagru_planung.

  wd_this->mr_selopt->add_parameter_field(
      i_id                         = wd_assist->c_kagru
      i_value                      = lr_data
      i_read_only                  = abap_true
*      i_dont_care_value            = lr_data
         ).

If I use "i_dont_care_value" the application dumps.

Pls, let me know if any one knows.

Thanks

Marcus

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_szcs
Active Contributor
0 Kudos

The "don't care" value is <b>not</b> the default value. In order to specify a default value, just use i_value. The "don't care" value means "nothing selected" and is only useful if the initial value was part of the value set or if a special "nothing selected" value is supposed to be used.

Best regards,

Thomas

P.S: There is a known bug regarding specifying a default value. Depending on the support package you use, it might not work.

Former Member
0 Kudos

Did you know the supportpackage or hint

thomas_szcs
Active Contributor
0 Kudos

Hi Marcus,

It's at least broken in SP12 and the upcoming SP13. We are currently working a fix, which will be supplied by a note.

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

and so far there is only the possibilty to solve this problem with a dropdown or a select-option?

Do you know when the note will coming out?

Best regards

Marcus

Former Member
0 Kudos

Hello again,

setting the default value with memory ID also does not work?


  SET PARAMETER ID 'ZPLAN_KAGRU' FIELD wd_assist->c_kagru_planung.
  CREATE DATA lr_data TYPE (wd_assist->c_kagru).
  ASSIGN lr_data->* TO <fs_any>.
  <fs_any> = wd_assist->c_kagru_planung.

  wd_this->mr_selopt->add_parameter_field(
      i_id                         = wd_assist->c_kagru
      i_value                      = lr_data
      i_memory_id                  = 'ZPLAN_KAGRU'
      i_read_only                  = abap_true
     ).

Greetings Marcus

Message was edited by:

Marcus

thomas_szcs
Active Contributor
0 Kudos

Hi Marcus,

The default value bug somehow slipped through the regression tests. Correction should be done by end of next week. I will post the note to this thread then. Feel free to create a support ticket in addition.

Memory id and lower case are both not supported yet and reserved for a future extension.

Best regards,

Thomas

thomas_szcs
Active Contributor
0 Kudos

Hello Marcus,

As promised this high priority issue has been fixed. Note 0001079237 contains the details. Unfortunately, the correction is dependent on an enhancement done in SP13 on the dropdown in Web Dynpro. This means no snote-applicable correction can be supplied for lower support packages. Nonetheless, if required a corrrection can possibly be supplied on an individual level for a lower SP as well. In case you require such a correction, I would like to ask you to open a support ticket.

Best regards,

Thomas

Former Member
0 Kudos

Hi all,

see SAP-Note 1082324

Best regards

Marcus

Former Member
0 Kudos

I took different approach.

I defined select-option and make it look like parameter on screen

and then i fill select option with default value . It worked same as parameter.

Nirad

Former Member
0 Kudos

Thanks, but the way you describe I already knows.

Former Member
0 Kudos

hi,

try in the following way

create data lr_dont_care_value type wdr_test_field.

assign lr_dont_care_value->* to <dont_care_value>.

<dont_care_value> = '99'.

wd_this->m_handler->add_parameter_field(

i_description = text

i_id = 'STRING5'

i_value = lr_value

i_as_dropdown = abap_true

i_dont_care_value = lr_dont_care_value ).

cheers