Question:
I have a requirement. I need a select option for period for a fiscal year. In this specific requirement the period starts from '0' so that previous period postings are also included. I cannot declare the select option for any table field like "MONAT" because it does not take the s_option-low as '0' when I initialize it.
My code needs to set the default value for the period as '0' and '12'.
Here's my code.
DATA: period(3) TYPE n.
SELECT-OPTIONS s_period FOR (period) DEFAULT '0' TO '12'
visible length 2.
Now when I enter the value rage '3' to '12' it gives me an error saying "Lower limit is greater than upper limit".
Can anyone solve this ?????????
Answer:
The problem is you are using a type n field so a '3' in the first position looks like '300' to SAP. Notice that if you put in '03' instead of '3' in the example you described - you don't get that error. I would suggest doing visible length 3 and making your defaults '000' and '012'.
Hope that helps!
TB
Answer:
Ya I know that what SAP is doing while on the selection screen.
What I'm interested in is there a way to achieve the requirement. I know NUMC would take 3 as '300' while on selection screen. Even Integer and Character data types also behave similarly.
Thanks
Answer:
data period(2) type c.
select-options s_monat for period.
initialization.
s_monat-low = 0.
s_monat-high = 12.
append s_monat.
AnupU
Answer:
SAP has standard periods of 1-12 plus 4 special periods. What you are doing is outside of this scope.
What's the requirement for this ?? If you can convince your users to use SAP standard, you can use SpBup from S001 for your select option definition.
Doing this provides a lot of validation that you would otherwise have to do yourself.
_________________
Regards
R
Abap KC
SFMDR
Answer:
Hey R,
Why do u have ur signiture as Tuly Idiot Wannabe ??? U r by far the best ABAPer in this forum. I have read many of ur posts and articles and Im a big fan of urs Change ur sign to guru or something more appropriate
Maybe some day I would become a Tuly Idiot like you too
cya
Answer:
Hey R,
Why do u have ur signiture as Tuly Idiot Wannabe ??? U r by far the best ABAPer in this forum. I have read many of ur posts and articles and Im a big fan of urs Change ur sign to guru or something more appropriate
Maybe some day I would become a Tuly Idiot like you too
cya
The Tuly Idiot club started from a post that I think has been lost in the last hacking attack on SapFans. This post gave Vic the Volcano the accolade of being the first Tuly Idiot. Abap Doc and myself then started the Tuly Idiot club. As Vic is the one and only true Tuly Idiot, I can only be a 'wannabe'.
(Vic - do you know where the post is ??)
_________________
Regards
R
Abap KC
SFMDR