2007 Dec 31 9:55 AM
hi we are facing some problem in QM report we want to convert character field in to numeric as we want the total and average of the field .table name:- qamr- field name:- Original-Input. Waiting for the reply Regards
2007 Dec 31 10:14 AM
Hi Prashant,
Please use this code.
DATA:
BEGIN OF i_qamr OCCURS 0,
original_input LIKE qamr-original_input,
END OF i_qamr,
BEGIN OF i_qamr1 OCCURS 0,
input TYPE N,
END OF i_qamr1.
SELECT original_input
FROM qamr
INTO TABLE i_qamr
WHERE original_input NE SPACE.
IF sy-subrc EQ 0.
LOOP AT i_qamr.
IF i_qamr-original_input CA sy-abcde.
CONTINUE.
ELSE.
only numeric values are loaded in this table.
i_qamr1-input = i_qamr-original_input.
APPEND i_qamr1.
ENDIF.
ENDLOOP.
IF i_qamr1[] IS NOT INITIAL.
LOOP AT i_qamr1.
WRITE:/ i_qamr1-input.
ENDLOOP.
ENDIF.
ENDIF.
Please let me know if this serves your purpose.
hi we are facing some problem in QM report we want to convert character field in to numeric as we want the total and average of the field .table name:- qamr- field name:- Original-Input. Waiting for the reply Regards
2007 Dec 31 10:01 AM
hi
Try to use FM 'CHAR_NUMC_CONVERSION'...
If helpful
Plz Reward
Thnx
Rohit
2007 Dec 31 10:14 AM
Hi Prashant,
Please use this code.
DATA:
BEGIN OF i_qamr OCCURS 0,
original_input LIKE qamr-original_input,
END OF i_qamr,
BEGIN OF i_qamr1 OCCURS 0,
input TYPE N,
END OF i_qamr1.
SELECT original_input
FROM qamr
INTO TABLE i_qamr
WHERE original_input NE SPACE.
IF sy-subrc EQ 0.
LOOP AT i_qamr.
IF i_qamr-original_input CA sy-abcde.
CONTINUE.
ELSE.
only numeric values are loaded in this table.
i_qamr1-input = i_qamr-original_input.
APPEND i_qamr1.
ENDIF.
ENDLOOP.
IF i_qamr1[] IS NOT INITIAL.
LOOP AT i_qamr1.
WRITE:/ i_qamr1-input.
ENDLOOP.
ENDIF.
ENDIF.
Please let me know if this serves your purpose.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |