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

IN sapscript display Float to integer with decimal without changing type

deepak_dhamat
Active Contributor
0 Likes
1,176

HI ,

IN 4.7 version sapscript layout is ok . now we have upgraded to ECC 6.0 ,but layout is giving error

for float data type field , we don't want to change that field . is there any solution where we can apply

because it has shifted to right alignment in ecc 6.0 .

we are using text_element in sapscript to display data .

current output 4.6800000000000000E+03

Expected output 4680 or 4680.00

Regards

Deepak.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,033

in sapscript you wont get arround it without canging the datatype

you will need atleast an internal variable - inside the sapscript itsself ie. with DEFINE

and then move (you can even call performs if you dont want to touch the printprogram)

in smartforms or adobeforms you would have other possibilities, but not in sapscript

7 REPLIES 7
Read only

Former Member
0 Likes
1,034

in sapscript you wont get arround it without canging the datatype

you will need atleast an internal variable - inside the sapscript itsself ie. with DEFINE

and then move (you can even call performs if you dont want to touch the printprogram)

in smartforms or adobeforms you would have other possibilities, but not in sapscript

Read only

0 Likes
1,033

Hi,

maybe try using &<your_variable>(E)& in you sapscript.

Then, if you would get too many trailing zeros, you can try with

&<your_variable>(E)(.2)&

Second option is untested though, because no immediate SAP form with sapscript at hand.

Edited by: Geert Vermuyten on Oct 8, 2010 11:14 AM

Read only

0 Likes
1,033

hi ,

Thanks for reply from both manuell and geert

already i have used that ,

my Problem is fields got shifted towards right so ,last column value is going on next line

all float type have display using

,,&IT_QASE_ALL_ONE-MESSWERT_20(E.0)&

,,&IT_QASE_ALL_ONE-MESSWERT_30(E.2)&

they are displaying value now but alingment has changed .

this values are LINE items

hence command used is LI in sapscript

Regards

Deepak

Read only

0 Likes
1,033

that usually happens due to spaces left in the variable (although its a number, try adding option C)

and you may also want to try limiting the total legnth ie. (EC18.2)

otherwhise you will probably have to alter the tabstops

Read only

0 Likes
1,033

hI mANUEL ,

Thank you for solution ,

actuall i was unable to adjust using (e.2) but after using (e18c.2) and all posible adjustment with this syntax according to requiment of field length it is adjusted and problem is solved .

Read only

0 Likes
1,033

great, thats good news

btw. you dont need to change the datatype length

you can also use 20, 30 etc instead of 18

i usually use the biggest currency field length i have (which is mostly 18)

Read only

0 Likes
1,033

yes ..

this will help a lot further .

Regards

Deepak.