cancel
Showing results for 
Search instead for 
Did you mean: 

issuein sapscript alignment

Former Member
0 Kudos

Hi,

I my SAP script, with the line items, the first column aligned properly, while coming to second line the quantity and amount fields are misplaced by 2 characters with the previous column.

For eg:

column1 column2 column3 column4 column5

1 234 345678 89 22345908

2 234 434 89 3498

the output is coming like this.

but my output shud be,

column1 column2 column3 column4 column5

1 234 345678 89 22345908

2 234 434 89 3498

Also after this i want 1 blank line.

Please kindly help to solve this issue.

Advance thanks,

Karthik.

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Edited by: Alvaro Tejada Galindo on Dec 17, 2009 10:45 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To avoid such thing always specify the number of character spaces to be allocated for the values. To do this

use &VARIABLE(MAX LENGTH)&

Variable - name of the variable used to print the value

Max Length - The character length of the variable ( as maintained in the Table ).

In ur case it will be as


P1 &col1(10)& &col2(15)& &col3(15)& &col4(20)&

The above code will allocate the specified amount of length for each column and hence will avoid the misplacement of the text.

Also for more formatting options go through this link :[ Formatting Options in SAPscript|http://help.sap.com/saphelp_nw70/helpdata/en/d1/802d7d454211d189710000e8322d00/frameset.htm]

Hope this solves ur problem.

Regards,

Bhavesh.

Former Member
0 Kudos

Thanks for ur Reply, Issue solved.

Regards,

Karthik

Former Member
0 Kudos

but in case if 1 or 2 column is blank then its shifting the column and alignment.

Answers (1)

Answers (1)

former_member588853
Active Contributor
0 Kudos

Hi,

Can you be clear with the issue..

both the outputs are same.. you should have a trail and error method in scripts use tabs space also when placing the values.

regards,

Nazeer

Former Member
0 Kudos

sorry,

error output:

column1,,,,,column,,,,,,, column3,,, column4 ,,,, column5

1 ,,,,,,,,,,,,,,234 ,,,,,,,, ,,,45678,,,,,,,,89,,,,,,,,,,,,22345908

2 ,,,,,,,,,,,,,,234 ,,,,,,,,,,,,,434,,,,,,,,,,,89,,,,,,,,,,,,,,, 3498

-


(mistake)----


(mistake)

My output shud become,

column1,,,,,column,,,,,,, column3,,, column4 ,,,, column5

1 ,,,,,,,,,,,,,,234 ,,,,,,,, 345678 89 22345908

2 ,,,,,,,,,,,,,,234 ,,,,,,,,,,,,,,,,434,,,,,,,,89,,,,,,,,,,,,,,,,,,,,3498

Help to solve this issue,

Thank you

Former Member
0 Kudos

sorry for the mistakes,

eg columns,

column1,,,,,column,,,,,,, column3,,, column4 ,,,, column5

1 ,,,,,,,,,,,,,,234 ,,,,,,,, 345678,,,,,,, 89,,,,,,,,,,,, 22345908

2 ,,,,,,,,,,,,,,234 ,,,,,,,,,,,,,434,,,,,,,,,,,89,,,,,,,,,,,,,,, 3498

-


(mistake)----


(mistake)

output shud come like this

column1,,,,,column,,,,,,, column3,,, column4 ,,,, column5

1 ,,,,,,,,,,,,,,234 ,,,,,,,, 345678,,,,,,, 89,,,,,,,,,,,, 22345908

2 ,,,,,,,,,,,,,,234 ,,,,,,,,,,,,,,,,434,,,,,,,,89,,,,,,,,,,,,,,,,,,,, 3498

-


(correct)----


(correct)

Waiting for ur help,

Thanks,

Karthik