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

Alignment issue in script

former_member212705
Active Participant
0 Likes
4,238

HI Experts,

I am facing alingnment issue in sap script.

when the output is of size 5, ie 90.91, its exactly below gross amount, but if the amount is more than 5 digits, for  example 12390.91, the aligment is disturbed,,, my requitrement is,, as and when the size of the amount changes, for example, 43445462.50 etc.. it should align left side exacty under the heading, with the last digit bieng fixed at that place.i have tried giving tabs with right alignment, but its not working.

I tried with -7.2ZI as well but it didn't work.

thr ideal output should be as follows:

             gross amount            
                   12390.91
          1254577587.12
                        90.91

Pelase help me to solve this issue.

Regards,

A.T.

1 ACCEPTED SOLUTION
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
3,695

Hi Ashish

As a thumb rule all amount should be right aliged. So you will have to play with your header and item both. For example you can give little less space for amount at item field and then move your amount header towards right will solve your problem

Nabheet

12 REPLIES 12
Read only

ThangaPrakash
Active Contributor
0 Likes
3,695

Hello Ashish,

Try like below by placing R in the editor for right alignment

= &KOMVD-KBETR(10R)&,,&v_dto(6R)&%,,<PP>&KOMVD-KWERT(R)&

Read only

0 Likes
3,695

Hi TP,

Thanks for reply .I am checking ,will let you know.

Regards,

AT

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
3,696

Hi Ashish

As a thumb rule all amount should be right aliged. So you will have to play with your header and item both. For example you can give little less space for amount at item field and then move your amount header towards right will solve your problem

Nabheet

Read only

0 Likes
3,695

Nabheet i tried right alignment also but i am not able to understand why its not working.

Read only

0 Likes
3,695

After trying right alignment at item level did you try change the header text position via tabs... I believe both header and item are having different paragraph format as we may need to adjust header position

Please attach screenshot of output and paragraph formats which you are using

Nabheet

Read only

ThangaPrakash
Active Contributor
0 Likes
3,695

Oh great!!! I guess you are the first one in SCN to call me as TP. Please check and let me know, whether it works.

Read only

0 Likes
3,695

Hi TP i checked but its not working.

Read only

Former Member
0 Likes
3,695

Hi Ashish,

All amount should be right aligned. Also don't hard code in your sapscript. For lengthiest value it could cause problematic.

You can achieve this by creating a new paragraph format with different tab position of each column mentioning specifically right aligned for amount value column.

Thanks and regards

Srimanta

Read only

satyabrata_sahoo3
Contributor
0 Likes
3,695

Gross Amount header seems to be in Left or Center aligned. Make it right aligned so as the amount field.

Also you can use &<amount>(c)& to compress the unwanted space in the variable.

Read only

former_member212705
Active Participant
0 Likes
3,695

Hi All,

i would be displaying number of digits equal to 10 or less than 10. but it has to  be under the heading instead of moving rightwards.

ie.
GROSS AMOUNT               GROSS AMOUNT
                812.77                                   812.77

GROSS AMOUNT               GROSS AMOUNT
          7812345.87                                7812345.87   

in case of multiple line items, the amount has to be one below the other with right alignment as shown below  

             GROSS AMOUNT
                          12390.91
                 1254577587.12
                               90.91

currently its working fine for amount 90.91 i.e. five digits

please have a look at code snippet

header

item data

paragraph format T6 has 4 tabs

paragraph format P1 has 6 tabs

Read only

0 Likes
3,695

Hi Ashish

Why are you not using tab for Gross amount in header...? You should use for all fields in header to get proper positioning. Dont use space.

Please change it and check

Nabheet

Read only

0 Likes
3,695

Hi All,

i changed the 'SIGN' alignment to 'RIGHT' and now it is looking good.

Thanks for you supports.