‎2010 Aug 26 6:00 AM
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
‎2010 Aug 26 6:28 AM
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
‎2010 Aug 26 6:28 AM
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
‎2010 Aug 26 4:56 PM
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
‎2010 Aug 26 7:17 AM
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
‎2010 Aug 26 4:52 PM
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