cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms - X = 123,500 - How to show only 123 and not 123,500

Former Member
0 Kudos

Hello,

X is defined as type QUAN with 3 decimals. I don't want show the decimal part . How to do it ?

Tks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

It's valid the same formatting rules of sapscript:

&NUM(.Z)&

Z indicates the decimal places, so if you don't need it: &NUM(.0)&

Max

Former Member
0 Kudos

Hello Max,

tks for reply.

with this I got an error

Zone WA_TAB2-BDMNG : option de traitement "(.0)" erronée

N° message SSFCOMPOSER602

Former Member
0 Kudos

Hi

Can you post the code inserted in your text element?

I've tried in my system and any error occurs

Max

Former Member
0 Kudos

sure:

texte element type 'E' with:

&WA_TAB2-BDMNG(.0)& with paragraph. alignement right

no other particular option

tks

Former Member
0 Kudos

Hi

How that field is defined? Which is your release?

Max

Former Member
0 Kudos

BDMNG type BDMNG = QUAN 13 ( 13 + 3 decimall )

system: SAP ECC 6.0¨

SAP_BASIS 700

SAP_ABA 700

Former Member
0 Kudos

Max,

what is your code on smartforms and data element ??

thank you

Former Member
0 Kudos

Hi

My system is just like yours

I've created a very simple smartforms:

In the interface (as import parameter) I've created QUANTITY defined as TYPE BDMNG, in the main I've created the text element having the following code:

&QUANTITY(.0)&

and it woks fine

Max

Former Member
0 Kudos

Tks for your reply:

I copied &WA_TAB2-BDMNG& into &w_quantity& and I print &w_quantity(.0)&

It's work fine.

Maybe the problem was that &WA_TAB2-BDMNG& have a reference in &WA_TAB2-BDMNG& (same field).

is this ??

Tks anyway,

regards,

Robeto.

Former Member
0 Kudos

Hi

Probably

I've not used a referenced field

Max

Former Member
0 Kudos

Hi Robert

I have a similar problem. could you let me know how you solved it in smartform

Where did you declare w_quantity and of what type. Did you do it driver program or in form.

Former Member
0 Kudos

declare it on global data

the type is : BDMNG

regards

Former Member
0 Kudos

Yes

I did that , but still it is same. 1,000 is printed as 1,000 instead of 1.

GS_FKIMG is of type BDMNG

GS_ITEM-FKIMG is of type FKIMG of type QUAN (13,3)

In %CODE program lines for Element I am using

GS_FKIMG = GS_ITEM-FKIMG.

I am printing &GS_FKIMG(.0)& but not working

I also tried using &GS_FKIMG(C.0)& but in vain.

could you guide if I am writing program lines wrong or at wrong place.

Former Member
0 Kudos

try to declare both variable the same type:

GS_FKIMG type FKIMG

or

GS_ITEM-FKIMG is of type BDMNG of type QUAN (13,3)

nabheetscn
Active Contributor
0 Kudos

Hi,

I was wondering if you dont want to show decimalplace why are we creating a variable with decimals..?

It will be if you create a vriable without decimalplaces and print it.

Nabheet

Former Member
0 Kudos

First reason:

Need decimal to do some calculs before to show it

second reason

the field is standard and I don't want to modify is

and other reasons...

you can chose one

nabheetscn
Active Contributor
0 Kudos

Thanks for the clarification gotthe reason..:)

Nabheet

Former Member
0 Kudos

Where is my rewards points ??

hihiihih

nabheetscn
Active Contributor
0 Kudos

How to..?..:):) Tell me i will do it..hehehehhe

Nabheet

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Try like this

V_INT = TRUNC(V_VALUE).

V_DEC = FRAC(V_VALUE).

IF V_DEC = 0.

CLEAR V_VALUE

V_VALUE = V_INT.

ENDIF.

WRITE: V_VALUE.

Regards

GK.

Former Member
0 Kudos

Hi,

Change the Data Element to CHAR.. it will not have any decimal places.. so your output will be without Decimal places.

In SMARTFORM, under "Global Definitions" under "Global Data" tab Against the Variable name main any CHAR data Type (ex. MATNR... thiis will have lenth of 18 without decimal) in the field Associated Type.

Regards

GK.

Former Member
0 Kudos

Hi,

Check these options while displaying the data in smartform.

&field(.<nat.number>)& Limits output of decimal places to <nat.number>

X(3.0) which will display as 123 instead of 123,500/