Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data Dictionary

Former Member
0 Likes
402

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
377

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.

2 REPLIES 2
Read only

RahulKeshav
Active Contributor
0 Likes
377

hi

Try to use FM 'CHAR_NUMC_CONVERSION'...

If helpful

Plz Reward

Thnx

Rohit

Read only

Former Member
0 Likes
378

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.