I need to build CASE…WHEN logic into a prompt as follows:
Case when <= 07 then else
@Select(CLASS\object)<=@Prompt('Select Current Month as YYYYMM: ',‘A’,'CLASS\object,mono,constrained) AND @Select(CLASS\object) > (100*(@Prompt('Select Current Month as YYYYMM: ',‘A’,'CLASS\object,mono,constrained)/100))
end
Due to the prompt having 2 parts the code does not parse. All it needs to do is prompt when the datepart is between 08 and 31 otherwise default to previous month.
I’m sure it is only a syntax issue. Could anyone help? thanks
Ok, next: the highlighted part of your formula is a condition, but no CASE WHEN or result. You’re just saying “a <= b and c > d”. That should be wrapped in a CASE WHEN.
@Select(CLASS\object)<=@Prompt('Select Current Month as YYYYMM: ',‘A’,'CLASS\object,mono,constrained) AND @Select(CLASS\object) > (100*(@Prompt('Select Current Month as YYYYMM: ',‘A’,'CLASS\object,mono,constrained)/100))
What I want it to do is, if day in month is > 07 then I want it to prompt for a month e.g. 201009 but it will return all months of that year back to 201001.
Therefore if the current date is between 01 and 07 then it defaults to a predefined obejct i.e. last month.
If the current day in month is after 07 then I want it to prompt for the month but it will return that month and all prior months for that year. That’s why there are 2 parts to the prompt.
((
<day number of month> <= '07'
AND @Select(CLASS\object) = <previous month YYYYMM>
)
OR
(
<day number of month> > '07'
AND @Select(CLASS\object) BETWEEN substr(@Prompt('Select Current Month as YYYYMM: ','A','CLASS\object,mono,constrained),1,4) || '01'
AND @Prompt('Select Current Month as YYYYMM: ','A','CLASS\object,mono,constrained)
))
Regarding JoePeters solution: The problem is, that the prompt will pop up no matter what, because at this time there is no conditional prompting in SAP BusinessObjects.