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: 

didplaying Values

Former Member
0 Kudos

Dear Experts

In the table ekpo the value for menge is 1.000, ie. it is showing 3 decimal places

but in my report I nedd to display in 2 decimal places

pls advice the solutions

thanks in advance

kar

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos

Check this

DATA : p_menge TYPE menge VALUE '13.123'.
DATA : p_menge1 TYPE p DECIMALS 2.

p_menge1 = p_menge.
WRITE : p_menge1.

in your output table for report display move the quantity to a variable which has only 2 decimals, just like what i did above.

Regards

Gopi

6 REPLIES 6

gopi_narendra
Active Contributor
0 Kudos

Check this

DATA : p_menge TYPE menge VALUE '13.123'.
DATA : p_menge1 TYPE p DECIMALS 2.

p_menge1 = p_menge.
WRITE : p_menge1.

in your output table for report display move the quantity to a variable which has only 2 decimals, just like what i did above.

Regards

Gopi

Former Member
0 Kudos

Hi,

In final output specify like this


otab-recv_qty DECIMALS 2

Regards,

Nandha

Reward if it helps

Former Member
0 Kudos

DATA: BEGIN OF itab OCCURS 0,

ebeln LIKE ekpo-ebeln,

menge TYPE p DECIMALS 2,

END OF itab.

SELECT ebeln menge FROM ekpo INTO CORRESPONDING FIELDS OF TABLE itab

WHERE ebeln = '7103500006'.

LOOP AT itab.

WRITE:/ itab-ebeln,itab-menge.

ENDLOOP.

Try this coding.

Former Member
0 Kudos

hi karthik,

I understood u'r doubt and clarified it upto my knowledge level, so go though this code. If this is not helpfull just make u'r doubt a little bit more clariffication.

TABLES: ekpo.

DATA: BEGIN OF itab OCCURS 0,

ebeln LIKE ekpo-ebeln,

menge TYPE p DECIMALS 2,

END OF itab.

SELECT ebeln menge FROM ekpo INTO CORRESPONDING FIELDS OF TABLE itab

WHERE ebeln = '2000001992'.

LOOP AT itab.

WRITE:/ itab-ebeln,itab-menge.

ENDLOOP.

<b>please reward points if helpfull.</b>

with regards,

radhika kolluru.

Former Member
0 Kudos

hi,

u can do this 2 ways.

1st way -


create a variable with two decimal places and assign the result value to this variable and display the newly created variable

DATA : p_menge TYPE menge VALUE '13.123'.

DATA : p_menge1 TYPE p DECIMALS 2.

p_menge1 = p_menge.

WRITE : p_menge1.

2way: while declaring the decimal value use DECIMALS KEYWORD WITH REQUIRED LENGTH as

DATA : p_menge TYPE p DECIMALS 2.

if helpful reward some points.

with regards,

Suresh ALuri.

Former Member
0 Kudos

data : begin of itab_ekpo,

mange like ekpo-menge,

end of itab_ekpo.

data : var1 type p decimals 2.

select mange from ekpo into table itab_ekpo.

var1 = mange.

write 😕 var1.

Reward with points if helpful.