2007 Feb 20 2:39 PM
Hi
I would like to select the latest date from a table. Therefore I througt that I could use the following statement (see context below):
select max(/BIC/FCVERDATE) from /BIC/AAPO_O1000 into FCVERDATE.
but there is no accept - I get the message: "E: Unknow column name MAX(/BIC/FCVERDATE). Not determined until runtime, you cannot specifi a field list."
I dont get it - why can I not use the max statement i works with the statement below, but I guess the statement below performs bad:
DATA: FCVERDATE LIKE /BIC/AAPO_O1000-/BIC/FCVERDATE.
....
select /BIC/FCVERDATE from /BIC/AAPO_O1000 into FCVERDATE up to 1 rows order by /BIC/FCVERDATE.
endselect.
*select max(/BIC/FCVERDATE) from /BIC/AAPO_O1000 into FCVERDATE.
select * from /BIC/AAPO_O1000 into table TAB_APOO10
WHERE /BIC/FCVERDATE = FCVERDATE.
LOOP AT DATA_PACKAGE.
...
Please let me know if you have a nice solution to get the latest date.
regards,
Torben
2007 Feb 20 2:52 PM
select max( /BIC/FCVERDATE ) from /BIC/AAPO_O1000 into FCVERDATE.
include space after ( and before ).
Regards,
Ravi
Hi
I would like to select the latest date from a table. Therefore I througt that I could use the following statement (see context below):
select max(/BIC/FCVERDATE) from /BIC/AAPO_O1000 into FCVERDATE.
but there is no accept - I get the message: "E: Unknow column name MAX(/BIC/FCVERDATE). Not determined until runtime, you cannot specifi a field list."
I dont get it - why can I not use the max statement i works with the statement below, but I guess the statement below performs bad:
DATA: FCVERDATE LIKE /BIC/AAPO_O1000-/BIC/FCVERDATE.
....
select /BIC/FCVERDATE from /BIC/AAPO_O1000 into FCVERDATE up to 1 rows order by /BIC/FCVERDATE.
endselect.
*select max(/BIC/FCVERDATE) from /BIC/AAPO_O1000 into FCVERDATE.
select * from /BIC/AAPO_O1000 into table TAB_APOO10
WHERE /BIC/FCVERDATE = FCVERDATE.
LOOP AT DATA_PACKAGE.
...
Please let me know if you have a nice solution to get the latest date.
regards,
Torben
2007 Feb 20 2:49 PM
Hi,
instead u can
Select /BIC/FCVERDATE from /BIC/AAPO_O1000
into TABLE i_FCVERDATE.
if sy-subrc = 0.
SORT i_FCVERDATE dscending by /BIC/FCVERDATE.
READ TABLE i_FCVERDATE WITH KEY index 1.
if sy-subrc = 0.
.................
endif.
endif.this wont have any perforamnce issue also.
2007 Feb 20 2:52 PM
select max( /BIC/FCVERDATE ) from /BIC/AAPO_O1000 into FCVERDATE.
include space after ( and before ).
Regards,
Ravi
2007 Feb 20 3:01 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |