2006 Aug 28 3:07 PM
hi experts,
plz help me how to code for the following given description.
Number of months entered by user.
Validate number between 1 and 12. From this number, calculate the value Count Months where Count Months = 12 divided by # number of months entered by user. Example, 1 times bins counted per year results in Count Months = 12.
regards,
siri
2006 Aug 28 3:11 PM
Hi,
Check this code:
take user entered months into variable x_months.
then write this code to find count months:
if x_months between 1 and 12.
x_CountMonths = 12 / x_months .
else.
message s000(xxx) 'Invalid month'.
endif.Regards
Appana
2006 Aug 28 3:12 PM
sounds pretty simple...
something like
parameter: p_count type i.
if not p_count is initial.
if not ( p_count ge '1' and p_count le '12' ).
message 'Error'.
endif.
endif.
count_months = 12 / p_count.
(count_months will give u a value depending on the type u declare it with..if its type i, u ll get integer values, else decimal values )..
hope it helps..