2008 Feb 07 9:01 AM
Hi experts,
I want to select the maximum and minimum excise number from the the excise header table J_1IEXCHDR. But the field j_1iexchdr-exnum field is of chac type . If i am writing select qurey such as
select MIN ( exnum ) as exnum MAX( exnum ) as exnum1 from j_1iexchdr into corresponding fields of table it_J_1iexchdr where werks = '1010' and
exgrp = '11' and
exdat in s_budat and
srgrp = '60'.
i am getting one record in internal table it_j_1iexchdr with only max number but min number is getting blank. what is the problem acutally? i am thinking becasue of the exnum is chac type field it is not taking min number . if so wht to do? how to convert that and write the qurey to select max and min excise number?
any suggestions.... will be helpful.
please help its urget.
<b>points will be rewarded for useful answers </b>
Regars,
priyanka reddy.
2008 Feb 07 10:08 AM
Hi,
I think for ur selection criteria the table contains the record with the EXNUM as space , so u r getting space as minimum value
For this scenario add one more condition in the select query like
EXNUM NE SPACE in the where clause
Now u will get the required value at the select query output.
Regards,
Manikumar
Hi experts,
I want to select the maximum and minimum excise number from the the excise header table J_1IEXCHDR. But the field j_1iexchdr-exnum field is of chac type . If i am writing select qurey such as
select MIN ( exnum ) as exnum MAX( exnum ) as exnum1 from j_1iexchdr into corresponding fields of table it_J_1iexchdr where werks = '1010' and
exgrp = '11' and
exdat in s_budat and
srgrp = '60'.
i am getting one record in internal table it_j_1iexchdr with only max number but min number is getting blank. what is the problem acutally? i am thinking becasue of the exnum is chac type field it is not taking min number . if so wht to do? how to convert that and write the qurey to select max and min excise number?
any suggestions.... will be helpful.
please help its urget.
<b>points will be rewarded for useful answers </b>
Regars,
priyanka reddy.
2008 Feb 07 9:03 AM
How about SELECT all the data in an internal table and then SORT the table on required field in Descending Order. Then, first row will contain MAX value and last row MIN value.
Regards,
Amit
2008 Feb 07 9:07 AM
2008 Feb 07 9:23 AM
I think the minimum value in the exnum would be a space
in the table ..
and it is getting a space .. get all the entries sort by ascending
and take the min value(other than space)
2008 Feb 07 10:07 AM
Hi,
I think for ur selection criteria the table contains the record with the EXNUM as space , so u r getting space as minimum value
For this scenario add one more condition in the select query like
EXNUM NE SPACE in the where clause
Now u will get the required value at the select query output.
Regards,
Manikumar
2008 Feb 07 10:08 AM
Hi,
I think for ur selection criteria the table contains the record with the EXNUM as space , so u r getting space as minimum value
For this scenario add one more condition in the select query like
EXNUM NE SPACE in the where clause
Now u will get the required value at the select query output.
Regards,
Manikumar
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |