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

Default value for Select-option in Module Pool?

jens_straten2
Explorer
0 Likes
1,146

I am having a problem with assigning a default value to a select-option in a module pool.

Basically, this works fine for parameters in the PBO, but it simply doesn't work for select-options. From what I can see in debug mode, any default values for select-options are being deleted by the corresponding call subscreen (standard code).

Therefore I tried to set the default value once more after calling the subscreen, but then I have to hit return (screen refresh) to see the actual value as expected. So, this is not a solution either...

Is there a trick? Is it a bug? Did anybody get this to work? Is there a know workaround?

Thanks,

Jens

1 ACCEPTED SOLUTION
Read only

faisalatsap
Active Contributor
0 Likes
876

Hi, Jens

Are you working on Custom or Standard Screen? If it is a Custom Screen then Write Code in AT SELECTION-SCREEN OUTPUT like bellow.

AT SELECTION-SCREEN OUTPUT.
  IF sodate[] IS INITIAL.
    sodate-low = sy-datum.
    APPEND sodate.
  ENDIF.

Thanks and Regards,

Faisal

Edited by: Faisal Altaf on Aug 26, 2010 10:35 AM

4 REPLIES 4
Read only

faisalatsap
Active Contributor
0 Likes
877

Hi, Jens

Are you working on Custom or Standard Screen? If it is a Custom Screen then Write Code in AT SELECTION-SCREEN OUTPUT like bellow.

AT SELECTION-SCREEN OUTPUT.
  IF sodate[] IS INITIAL.
    sodate-low = sy-datum.
    APPEND sodate.
  ENDIF.

Thanks and Regards,

Faisal

Edited by: Faisal Altaf on Aug 26, 2010 10:35 AM

Read only

0 Likes
876

Thanks Faisal!

Your answer solved my problem.

I simply forgot an append statement... I normally know this, but I guess I tried to accomplish too many things on a single day yesterday.

One more comment:

If you are using ABAP objects like me, you will have to declare a local structure similar to type rsdsselopt (don't forget to adjust high/low fields to your field type) in your method. You can then assign values to -low, -high, etc. before you append your structure to your global select-option.

Cheers,

Jens

Read only

Former Member
0 Likes
876

Hi,

please go through the link which will solve your problem..

http://wiki.sdn.sap.com/wiki/display/sandbox/Usethefunctionalityofselect-optionsindialogprogramming(module+pool)

hope this will help you..

Regards,

Kiran

Read only

0 Likes
876

Kiran,

I have seen this before, but I don't want to use it.

Will give you some points anyhow since it is a good alternative option.

Thanks,

Jens