cancel
Showing results for 
Search instead for 
Did you mean: 

Layout misallignment in SAPScript

Former Member
0 Kudos

Hi,

I have written a print program for sapscript and designed a layout for it.

Three fields have been defined in the layout set.

Every time the loop runs around write_form the three field gets printed.

<b>Print program logic:</b>

loop at iresb. "IRESB is internal table.

IF IRESB-SHKZG = 'S'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'CO-PRO' "Text Element

WINDOW = 'MAIN'.

ENDIF.

endloop.

<b>Layout logic:</b>

/E CO-PRO

A1 &IRESB-MATNR&,, ,,&IRESB-MAKTX&,, ,,&IRESB-BDMNG&

<b>Now the problem is I get output as follows:</b>

MACHINE1 CUTTING 5.000

M2 DRILLING 2.000

BIGMACHINE FITTING 7.000

<b>But I want output like:</b>

Machine1 Cutting 5.000

M2 DRILLING 2.000

BIGMACHINE FITTING 7.000

(If I keep the tab position constant then if the description of next matnr is long or short as compared to previous one the other data gets mis-alligned as you can see from the above one which I am getting)

What is solution for this ?

Accepted Solutions (1)

Accepted Solutions (1)

former_member221770
Contributor
0 Kudos

Tushar,

In your Paragraph Format 'A1' you want to assign the "Tabs". This option allows you to define the tab spacing. When you write out the text, the ",," says to use the next Tab.

Try definign the tabs as follows:

1 11CH Left

2 33CH Left

Then change the code in your SAPscript to be as follows:

A1 &IRESB-MATNR(10)&,,&IRESB-MAKTX(20)&,,&IRESB-BDMNG&

This will be he equililent to:

write:/ iresb-matnr(10).

write at 11 iresb-maktx(20).

write at 33 iresb-bdmng.

Let me know if you need more info.

Cheers,

Pat.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

This is related to previous post.

Even if I alligned the output which I want during posting message, I think the Java script for this post does not allow the spaces so its showing the same misallignment but i guess you might have got what I want.

Tushar