on 01-24-2012 12:15 PM
Hello All,
we have a requirement to select the value of A based on the highest value of VALID TO field.
Eg:
If my DSO has the following values:
If A = 1 for VALID TO = 201111,
A =2 for VALID TO = 201112
and A =3 for VALID TO = 201201.
then while moving the data to the Infocube, we need to write code to pickup the data of A =3 since it hs the highest VALID TO value. I tried writing the following statement
select single max ([DISTINCT] /BIC/ZVLID_TO) from /BIC/AZTESTB00
but this is giving me a syntax error
'E:Unknown column name "MAX" until runtime, you cannot specify a field
list.'
Please advice..
Regards
Sneha
First there seems to a problem with the information u have given. There should be a key for which these values are changing, coz here both A & valid to are changing.
Assuming that there is another field which is key for ur source DSO, why dont u try this in the start routine.
Select * from /BIC/AZTESTB00 into itab1.
sort itab1 by /BIC/ZVLID_TO descending.
delete adjacent records comparing keyfield.
This way you would get the value of A for the highest valid to, as all the other records would be deleted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I solved my requirement by the following statement:
Select MAX( /BIC/ZVALID_TO ) from /BIC/AZTESTB00
into L_VLDTO where COMP_CODE = SOURCE_FIELDS-COMP_CODE.
Please note the spaces are very much important in the MAX statement. there should be no space between MAX & (
whereas there should be a space after the (
Hope this helps who face similar requirement.
Thanks & Regards
Sneha
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.