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

Smartform - Format quantity field - CIZ

Former Member
0 Likes
2,843

Hello all,

I have a quantity field which has a value 11.000.

I need to print it as 11 (no trailing zeroes ). But if the quantity is 11.23, then it shud print 11.23.

To acheive this, In sapscript, We used to write the quantity field with a C in bracket.

for eg. &CAUFVD-GAMNG(C)&

How Could I acheive this same functionality in smart forms ?

I beleive CIZ shud work in smartforms also..but unfortunately it is not..

Am i missing something.. ?

Thank you so much for your time.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,594

I donot think control commands are possible in Smartform like in sapscript. You have to create a program lines node and there u can write ur logic to meet this requirment.

Ex:

data: val type p decimals 3 value '10.230'.

data: l_char type c length 10.

data: l_whole_no type c length 10.

data: l_decimal type c length 3.

l_char = val.

split l_char at '.' into l_whole_no l_decimal.

if l_decimal = '000'.

l_char = l_whole_no.

endif.

Regards,

Joy.

Hello all,

I have a quantity field which has a value 11.000.

I need to print it as 11 (no trailing zeroes ). But if the quantity is 11.23, then it shud print 11.23.

To acheive this, In sapscript, We used to write the quantity field with a C in bracket.

for eg. &CAUFVD-GAMNG(C)&

How Could I acheive this same functionality in smart forms ?

I beleive CIZ shud work in smartforms also..but unfortunately it is not..

Am i missing something.. ?

Thank you so much for your time.

2 REPLIES 2
Read only

Former Member
0 Likes
1,595

I donot think control commands are possible in Smartform like in sapscript. You have to create a program lines node and there u can write ur logic to meet this requirment.

Ex:

data: val type p decimals 3 value '10.230'.

data: l_char type c length 10.

data: l_whole_no type c length 10.

data: l_decimal type c length 3.

l_char = val.

split l_char at '.' into l_whole_no l_decimal.

if l_decimal = '000'.

l_char = l_whole_no.

endif.

Regards,

Joy.

Read only

0 Likes
1,594

Thank you Joyjit.

I still cant beleive, Smart forms dont have any short cut to do this.

Those 3 (CIZ) were such beautiful commands.. Smart forms is the advanced version of sapscripts, and ..

There might be some other short cut..other than writing code for each and every currency and quantity fields..

Thanks much for your response.