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: 

problem in displaying the value in smartform

Former Member
0 Kudos

Hi,

I am working on a smartform in which i have to display the 3 values i.e. condition type i.e. ZING,ZRO1,ZGRD.

I am able to fetch the data and displaying it in the smartform but the problem is that when i am displaying it in the smartform it is showing a space in between of the value .

ex, (G) 4521.11 where as i want to display the value as (G) 4521.11.

I am using the concatenate function but it is giving more space.

Here's d code which i am using to display the value of it :-

move item-rate to vrate.

move item-rate1 to vrate1.

if item-rate2 <> 0.

MOVE ITEM-RATE2 TO BBB.

move item-rate2 to vrate2 .

CONCATENATE '(G)'VRATE2 BBB INTO BBB.

shift BBB left deleting leading space.

endif.

move item-rate3 to vrate3.

shift vrate left deleting leading space.

shift vrate1 left deleting leading space.

shift vrate3 left deleting leading space.

Here,BBB is also defined in the global definitions of the smartforms as :-

BBB TYPE C LENGTH 10

Plzz provide me guidelines to solve this problem.

8 REPLIES 8

peter_ruiz2
Active Contributor
0 Kudos

Hi Ricx,

use the CONDENSE statement.

CONDENSDE BBB.

this will remove all trailing and leading spaces as well as those spaces in between characters.

regards,

Peter

Former Member
0 Kudos

Hi,

Try the syntax below in the form editor for compressing the leading spaces before quanatity or currency fields.

'(G)'&ITEM-RATE2(C)& using C here will compress the leading spaces.

With Regards,

Dwarakanath.S

Former Member
0 Kudos

hi,

You can use the following string operations:

Condense or you can use Shift left deleting leading spaces (or)

Shift right deleting trailing spaces.

Also ,

Goto TCode ABAPDOCU. Give keyword as Condense and Shift. To get the exact syntax.

thanks

Former Member
0 Kudos

Hi

After you concatenate required fields, you can use CONDENSE keyword.

CONDENCE c NO-GAPS.

The no-gaps option removes all spaces in c.

Hope this helps

Regards,

Jayanthi.K

0 Kudos

HI JAYANTI,

I had tried what u had told me it is giving the output value like this:-

(G)1432. as it is not displaying the .110 value in it .

even i had changed the value in the global definitions from c length 13. but still it is displaying the value like this:-

(G)1432. and not displaying the value .11 and i want to display it as (G)1432.11.

Plzz provide me guidlines to solve this problem .

Edited by: ricx .s on Jan 19, 2009 7:25 AM

Former Member
0 Kudos

Hi All,

i had made some modifications in the code of the smartform and here's the code which i am using now :-

move item-rate to vrate.

move item-rate1 to vrate1.

move item-rate3 to vrate3.

if item-rate2 <> 0.

MOVE ITEM-RATE2 TO BBB.

CONCATENATE 'G'BBB INTO BBB.

shift BBB left deleting leading space.

endif.

shift vrate left deleting leading space.

shift vrate1 left deleting leading space.

shift vrate3 left deleting leading space.

the output is coming like this:-

G4521.11 but i want to display like (G)4521.11 and when i add () in the concatenate statement it gives the output like (G)4521. as .11 did not displayed.

plzz provide me guidelines for solving this problem.

Former Member
0 Kudos

hi:

hi,

it is due to small size of ur cell.

u can solve it as if those cells contain the numeric values.

in text field where u insert the table field do like this

before u will be doing like this.

&itab-fieldname&

now just do like this.

&itab-fieldname(6)& " value in brackets can b varied according to ur need...(6) will align 5 numeric digit on the same line.

Former Member
0 Kudos

you can use CONDENSE keyword here.

Regards,

Joan