cancel
Showing results for 
Search instead for 
Did you mean: 

Character Formating in Smartforms

aravinth_anandhan
Active Participant
0 Kudos

Dear All,

How to use Condense and Right Alignment for a same variable, for example &test& is my variable, i need to use (C) and (R) for

this variable. I tried to give right alignment through smart styles also. But that is giving some space in the right side. I tried to give

&test(CR)& in smartforms itself but right alignment is coming, it is not condensing the leading space. My Variable is of type CURR. Pls help.

Accepted Solutions (1)

Accepted Solutions (1)

former_member320332
Contributor
0 Kudos

Hi Aravinth,

Copy your data of CURR type into one CHAR variable and then use CONDENSE on this CHAR variable. And then print

this CHAR variable with the style defined for printing right aligned data.

Thanks,

Pawan

aravinth_anandhan
Active Participant
0 Kudos

HI PawanG,

What you told is working fine and it fulfill my requirement. Thanks for your reply.

Answers (2)

Answers (2)

aidan_black
Active Contributor
0 Kudos

Hi,

This is realted to te issue of SAP note #1432997 which corrects a problem that the space reserved for the sign was truncated for symbols with type CURR. So with right alignment , the space is still there. Use formattng option S to suppress the sign and it should help. e.g. &test(CRS)&

Regards,

Aidan

aravinth_anandhan
Active Participant
0 Kudos

Hi Aidan,

If 'Test' is of currency type and if we give &test(CSR)&, it is not working. Space is coming but it got Right aligned. So i copied that currency field into character type field and I gave &test(R)&, now it is working. Thanks for your reply.

0 Kudos

Hello Aravinth,

CONDENSE is used to shrink the space between words and not used to remove

leading or trailing spaces.

For removing leading or trailing spaces you could use LEFT or RIGHT alignment

in smartstyles or use abap statements SHIFT LEFT O SHIFT RIGHT.

You are trying to shift your variable right and remove leading spaces which you

can never achieve.If you shift right or use RIGHT alignment,you can

only remove trailing space and never leading space.

When you declare a varaible ( eg: test as char 20 ),system allocated 20 characters

spaces as its length.So the system fills the data of the variable in

this length and prints it either left or right or centre as your preference.

regards

aravinth_anandhan
Active Participant
0 Kudos

Hi Ikshula ,

Thanks for ur reply and Sorry its trailing spaces only, i mentioned mistakenly. I know we can give right or left alignment through smart styles. But my doubt is, can we able to give both condense and right alignment in smart forms itself? Example : &Test(CR)& like this?