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

formatting problem in smartform

former_member188827
Active Contributor
0 Likes
1,093

hi

in the footer of table in smartform currency field vbrp-cmpre and quantity field vbrp-fkimg are cuming with leading spaces as follows:

32.000 copies

@ Rs. 7.00=

2.24

this should come as :

32 copies @ Rs. 7 = 224

also the product of fkimg & cmpre is not coming correct.

kindly help.

thanks.

Message was edited by:

abapuser

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,048

Hi,

Assign the value to a character field in program lines.It won't show the decimals if it is zero after the decimal.After assigning it to 2 character variable variables say v1,v2,multiply v1 and v2 and assign it to v3[length should be sufficient to hold the product].

Program line:

Input parameter

wa-cmpre

wa-fkimg

Output parameter

v1

v2

v3

v1 = wa-cmpre.

v2 = wa-fkimg.

v3 = v1 * v2.

concatenate v1 ' copies @ Rs. ' v2 ' = ' v3 into v4.

Now in text element drag and drop v4 from field list.

Kindly reward points by clicking the star on the left of reply,if it helps.

9 REPLIES 9
Read only

Former Member
0 Likes
1,048

try to write variable like <b> &variable(.0)&</b> add extra (.0) after each variable in same line.

Read only

0 Likes
1,048

how to add (.0) before &.when i try to add it, the text element variable starts blinking & it doesnt permit edditing.

Read only

0 Likes
1,048

go to text editor (change editor option in menu) and do the changes.

Read only

Former Member
0 Likes
1,048

For formatting problem please increase the size of your footer window ....it will come right then ...

Read only

Former Member
0 Likes
1,048

Hi ,

To remove the decimal places for quantity and rate/quantity , use the syntax to restrict the number of digits after decimal places. The syntax is

<b>&symbol(.N)&</b>

where N is number of decimal places.

Since you dont want decimals use<b> &symbol(.0)&</b>

For the other case it depends on how the currency is represented , any way try using the syntex <b>&symbol(T)&</b>

Regards

Arun

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,049

Hi,

Assign the value to a character field in program lines.It won't show the decimals if it is zero after the decimal.After assigning it to 2 character variable variables say v1,v2,multiply v1 and v2 and assign it to v3[length should be sufficient to hold the product].

Program line:

Input parameter

wa-cmpre

wa-fkimg

Output parameter

v1

v2

v3

v1 = wa-cmpre.

v2 = wa-fkimg.

v3 = v1 * v2.

concatenate v1 ' copies @ Rs. ' v2 ' = ' v3 into v4.

Now in text element drag and drop v4 from field list.

Kindly reward points by clicking the star on the left of reply,if it helps.

Read only

0 Likes
1,048

hi jayanthi,

In the global data of smartforms i have given v1,v2,v3,v4 of type C.

In program lines iam giving :

Input parameter

wa-cmpre

wa-fkimg

v4

Output parameter

v1

v2

v3

v4

v1 = wa-cmpre.

v2 = wa-fkimg.

v3 = v1 * v2.

concatenate v1 ' copies @ Rs. ' v2 ' = ' v3 into v4.

but when i execute it i get the dump

the program attempted to interpret the value '*' as number but since the value contravenes the correct number formats this was not possible.

reagrds

Read only

0 Likes
1,048

in the window...of the text element.. leftside you will find "paper and pen" u will enter to the editod... there you can give (.0) as jayanthi told.

Read only

0 Likes
1,048

Hi,

Are you declaring the variable with maximum length to hold.

For eg.

v1 type char25

v3 = v1 * v2.

You should give sufficient space between v1 and * and * and v2.