Application Development 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: 

Editable ALV

Former Member
0 Kudos
138

Hi Friends i am doing Editable ALV

in which i am having 2 fields r editable those 2 fields i have taken below types(data elements)..

field1 type ->TB_PYIELD DEC 10 7

field2 type ->TPM_NOMINAL_AMT CURR 21 2

my prblem is if i am entering 100 in field1 it is taking as 0.000100

and also if i am entering 100 in field2 it is taking as 1.00

and if i am entering 100000000 in field1 it is taking as 100.000000

and also if i am entering 10000 in field2 it is taking as 100.00

what i have to do ?? ......(it should take waht ever we have given,it should not convert into decimals...)

Regards,

Ramesh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
108

field1 type ->TB_PYIELD DEC 10 <b>7</b>

since field1 is taking 7 decimal places so, when u r entering 100 in field1 it is taking as

field1 decimals output

100 1 10.0

100 2 1.00

100 3 0.100

100 4 0.0100

100 5 0.00100

<b>100 6 0.000100

100 7 0.0000100</b>

The same is hapenning when u r entering 100000000 in field 1

field2 type ->TPM_NOMINAL_AMT CURR 21 2

since field2 is taking 2 decimal places so, when u r entering 100 in field2 it is taking as

field2 decimals output

100 1 10.0

<b>100 2 1.00</b>

when u r entering 10000 in field 2

field2 decimals output

10000 1 1000.0

<b>10000 2 100.00</b>

9 REPLIES 9

Former Member
0 Kudos
108

in the fieldcatalog givet he datatype as 'QUAN' or 'CUKY' and checkout if it works

wa_fieldcat-datatype = 'QUAN'

Former Member
0 Kudos
108

Hi,

For currency u can refer some currency key <b>WAERS</b> with two deciamls.

So that it wont move the deciaml places.

Former Member
0 Kudos
108

Friends,

In my Editable ALV Report i have a field which is of type (data element) TB_PYIELD ( u can check data elemet <b>TB_PYIELD</b> in SE11)

Data Type DEC

No. Characters 15

Decimal Places 6

Output Length 18

in my ALV out put if i enter 100 in field it is taking as 0.000100

and if i am entering 100000000 in field it is taking as 100.000000

means it is moving into decimals...

but if we enter 100 it has to take/keep it as 100/100.000000 na !!!

please give me the solution...

Ramesh.

Message was edited by:

Ramesh

Message was edited by:

Ramesh

0 Kudos
108

Friends,

My Problem is still not solved ,it has not been answered yet.

Regards,

Ramesh.

0 Kudos
108

Hi,

As u r referring the field with 6 decimal palces it will show like taht in the output.

So instead of taht in fieldcatalog refer the fieldname with the decimal places u need.

So taht u can avoid this problem.

Eg: Curr MARA-NETWR liek that.

fieldcatalog-fieldname   = 'MEINS'.
Use refernce table and fieldname in this fcat
  fieldcatalog-seltext_m   = 'Order Unit'.
  fieldcatalog-col_pos     = 6.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  
  fieldcatalog-fieldname   = 'NETPR'.
  fieldcatalog-seltext_m   = 'Net Price'.
  fieldcatalog-col_pos     = 7.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-datatype     = 'CURR'.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.

0 Kudos
108

I HAVE TRIED BY PUTTING...* wa_fcat-DATATYPE = 'INT4'."DEC'."CURR'

WITH DIFFERENT TYPE ,,,,,IT IS NOT WORKING....

RAMESH.

Former Member
0 Kudos
109

field1 type ->TB_PYIELD DEC 10 <b>7</b>

since field1 is taking 7 decimal places so, when u r entering 100 in field1 it is taking as

field1 decimals output

100 1 10.0

100 2 1.00

100 3 0.100

100 4 0.0100

100 5 0.00100

<b>100 6 0.000100

100 7 0.0000100</b>

The same is hapenning when u r entering 100000000 in field 1

field2 type ->TPM_NOMINAL_AMT CURR 21 2

since field2 is taking 2 decimal places so, when u r entering 100 in field2 it is taking as

field2 decimals output

100 1 10.0

<b>100 2 1.00</b>

when u r entering 10000 in field 2

field2 decimals output

10000 1 1000.0

<b>10000 2 100.00</b>

0 Kudos
108

s sreekanth that what is happening..i know...

i am asking for the solution....

i have declared the internal table as like structure of ZTABLE( the table is already used in some other programs so ican not change the field attributes...)...

so is there any solution to solve the problem in my ALV out put ...????????

Ramesh.

0 Kudos
108

CLEAR wa_fieldcat.

wa_fieldcat-row_pos = 1.

wa_fieldcat-col_pos = 8.

wa_fieldcat-fieldname = 'NETPR'.

wa_fieldcat-tabname = 'JTAB'.

wa_fieldcat-outputlen = '15'.

wa_fieldcat-coltext = 'NET PRICE'.

<b> wa_fieldcat-datatype = 'CURR'.</b>

wa_fieldcat-do_sum = 'X'.

wa_fieldcat-edit = 'X'.

APPEND wa_fieldcat TO i_fieldcat.

CLEAR wa_fieldcat.

wa_fieldcat-row_pos = 1.

wa_fieldcat-col_pos = 9.

wa_fieldcat-fieldname = 'NETWR'.

wa_fieldcat-tabname = 'JTAB'.

wa_fieldcat-outputlen = '15'.

wa_fieldcat-coltext = 'NET WEIGHT'.

<b> wa_fieldcat-datatype = 'CURR'.</b>

  • wa_fieldcat-do_sum = 'X'.

wa_fieldcat-edit = 'X'.

APPEND wa_fieldcat TO i_fieldcat.

since NETPR and NETWR is a currency field so give datatype as CURR.

I have check netpr and netwr in my system it is working

<b>For field1 ->TB_PYIELD give

wa_fcat-DATATYPE = 'DEC'

For field2 ->TPM_NOMINAL_AMT give

wa_fcat-DATATYPE = 'CURR'</b>