‎2009 May 22 8:01 AM
I have my QA Trend Analysis Report in which I have field "mittelwert" whose data type is FLTP of length 16.
my internal table it_inspection contains...
mittelwert LIKE qamr-mittelwert.
and selecting from my select query below:
SELECT * FROM qamv AS qamv
JOIN qals AS qals
ON qamvprueflos = qalsprueflos
JOIN qamr AS qamr
ON qamrprueflos = qamvprueflos
AND qamrmerknr = qamvmerknr
AND qamrvorglfnr = qamvvorglfnr
INTO CORRESPONDING FIELDS OF TABLE it_inspection
WHERE qals~matnr IN s_matnr
AND qals~stat35 = p_ud
AND qals~pastrterm IN r_date.
I am getting values as below in my report ALV output:
6.000000000E+00
5.600000000E+00
6.100000000E+00
When I go and see in the tcode : qe01, by giving the Inspection lot values..
I have values as below which is of character type of length 16.
6.00
5.60
6.10
Here the probelm is how can I show the values above in the report output ?
Thanks in advance.
‎2009 May 22 8:12 AM
Hi take your internal table field like packed type . use the fallowing code to modify the content of internal table. See example below...
DATA: float TYPE f,
pack TYPE p DECIMALS 2.
float = 73050 * '0.0727'. " result: 5.3107349999999997E+03
pack = float.
WRITE pack. " result: 5310.73
Thanks
Deepanker Dwivedi
‎2009 May 22 8:05 AM
Use FM 'FLTP_CHAR_CONVERSION'
CALL FUNCTION 'FLTP_CHAR_CONVERSION'
EXPORTING
DECIM = L_CONVERT_DIGITS "Decimals
EXPON = 0
INPUT = L_FLOAT " Input >>> Floating number
IVALU = L_CONVERT_NOT_INITIAL
IMPORTING
FLSTR = L_CONVERT_CHARACTER. " Output Hope this helps...
‎2009 May 22 8:12 AM
Hi take your internal table field like packed type . use the fallowing code to modify the content of internal table. See example below...
DATA: float TYPE f,
pack TYPE p DECIMALS 2.
float = 73050 * '0.0727'. " result: 5.3107349999999997E+03
pack = float.
WRITE pack. " result: 5310.73
Thanks
Deepanker Dwivedi
‎2009 May 22 8:20 AM
Hi Sam,
Use the output from variable STRING in your ALV
This is similar to how it is done for the screen fields in your standard transaction
DATA
: MITTELWERT LIKE QAMR-MITTELWERT VALUE '6.000000000E+00',
STRING TYPE CHAR20.
CALL FUNCTION 'QSS4_FSTRING_AUSGEBEN'
EXPORTING
I_NOTINI = 'X'
I_FLOAT = MITTELWERT
I_DECIMALS = '2' "No of decimals you require in the standard it is 2
IMPORTING
E_STRING = STRING
* TABLES
* T_OPTIPOS = OPTIPOS
.
WRITE STRING.Regards