cancel
Showing results for 
Search instead for 
Did you mean: 

scripts

Former Member
0 Kudos

hi guys,

I have to print some data using the script. I have 13 fields to print. These include doc no, date etc...My problem is that all the fields are not being printed on one line. The allignment is not coming right. For ex: The document number has length, say 8, so the next field is displayed only after 8 characters, irrespective of whether the data actually contains 8 chars. How do i terminate the extra space that comes after every field?

thanks

regards

nayan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In your script type your variables like this

&DOC_NO(C)&

where C means condense blank spaces

Message was edited by:

Nehal Fonseca

Former Member
0 Kudos

Hi Nehal,

I tried, It does not work this way too...Is there any other option?

thanks

nayan

former_member480923
Active Contributor
0 Kudos

Use a perform routine inside the SAPScript to call a perform in a Z Program and in that perform condense the Data elements so that.



perform sub_condense in program zscript_foorms
                                                  using &FIELD&
                                             changing &FIELD_C&.

Hope That Helps

Anirban M.

Former Member
0 Kudos

Nayan ,

There are other ways you can try,

1. Use a table to display this data. u can make 13 cells in a line type of a table

in each cell put one field. the Table line length will be the length of the page so they will never go beyong one line. However if the length is greater, it will wrap in the cell. I dunno if that is accepatbel to you. /You can also use a template if youre

not looping for many lines

2. You can use tabs in paragraph styles. so that your fields appear after fixed disatnces, but this might not help them all to appear in one line.

Former Member
0 Kudos

ok thanks mate...il try this...

thanks

nayan

Answers (3)

Answers (3)

former_member196280
Active Contributor
0 Kudos

You problem can be solved by creating Tab spaces in Paragraph format... also try to condense the field by using option C.

Let me give you an example...

Create paragraph format PS

goto tabs and define tabs...

1.00 CM LEFT

4.00 CM LEFT

8.00 CM LEFT

Now apply your paragraph format like this... note ,, implies paragraph format...

Goto your line items in your main window...

PS ,, &Var1(C)& ,, &var2(c)& ,, &var3(c)&

Now var 1 is displayed starting form 1 Cm of your window, var2 will be displayed from 4 Cm and var3 display at 8 cm, so now even your data varies dynamically still your data will be aligned.

Regards,

SaiRam

former_member480923
Active Contributor
0 Kudos

well simply write &FIELD(C)& this will condense and remove the extra space.

Hope That Helps

Anirban M.

Former Member
0 Kudos

Hi,

i think it is better go for landscape format rather than portrait

or if you have to use portrait then split it into two rows

as one line may not be suffiicient to display all the feilds and there should be atleast some gap bettwen the two field so split it in two rows

and then display the reocrds and after the second row just display a blank row

you have to create the paragraph formats clearly and you have to make use of those as they are thevery good solutions for the alignment

regards,

Venkatesh