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

SAP Script: Alignment problem: Table display

Former Member
0 Likes
1,785

Hi,

I am displaying a table with 3 fields in SAP script output.

Eg: -

matnr material description language

0001 testing only EN

0002 material 2 EN

If the material description is not present in my table, the alignment is not properly showing in the script output.

It is displaying as: -

0001 testing only EN

0002 EN

How can I show this in a properly aligned manner ???

Any control commands or Formatting paragraphs . Please let me know.

Regards,

Hari

9 REPLIES 9
Read only

former_member188829
Active Contributor
0 Likes
1,353

Hi,

You can use Tab Spaces.(two commas)

And you have option in Paragraph format.

Number Tabposition Alignment

Eg:

itab-matnr,,itab-maktx,,itab-langu

Read only

0 Likes
1,353

Hi Vishnu,

I already used tabs i.e,. 2 commas.

The problem here is alignment. If the description field is blank... it is coming to the left side in the output.

Read only

0 Likes
1,353

Hi,

try this.

&itab-field1&,,&itab-field2(R)&,,&itab-field3(R)

Without giving R also,u will get proper output.

Kindly check the tab positions in the paragraph formats.

Give 2 cm ,6 cm, 10 cm tabs.( adjust these u will surely get )

Read only

0 Likes
1,353

Hi Hari,

Initially i too did not get the space. But after what i did is, i have also used tab space at starting point.

Add two commas at starting point like below. It is working fine for me.

Eg:

,,&itab-matnr&,,&itab-maktx&,,&itab-langu&

This definitely work out.

Read only

0 Likes
1,353

Hi Vishnu,

It didnt worked for me. I already explained that the second field length is 50 CHAR. So, Even if the material text existing in the column is 10 length. The third column data is still coming left and thereby there is a problem in the alignment.

If the second field data itself is not there, It still more worst and coming more to the left.

Here my concern, How to display exactly the table in a SAP Script ?? Then in that case, whether data may present or may not present in some fields, It will display exactly in proper alignment.

I already tried, SAP Standard provided formattting tag - T1.

If data is present in some columns, there is no problem.

Let us know, if someone handled a similar kind of requirement.

thanks

Hari

Read only

0 Likes
1,353

erm you know that you dont need to just make those commas to get the tabs working?

in your paragraph format you need to define alignments and values for your tabs.

Read only

0 Likes
1,353

Hi Florian,

I defined the values in those paragraph formats and tried different options like 'R' and other contrl commands.

If the data present in the table for some columns, It is getting properly aligned. Let say for 4th record, the second column is empty. In that case, that particular record, the third column is coming to the left.

But in my Internal table, It is showing properly. But when displaying, there is a problem.

Hari krishna

Read only

0 Likes
1,353

Good, then its just a matter of number crunching.

most probably the space between your tab 2 and tab 3 is too low for the char50 textelement.

What happens then is that your data you wanted to print with tab 3 is beeing printed right after the data in tab 2. if there is no data in tab 2 it gets pulled left.

For a test, Give it a shot it takes 1 minute, make your tabs like

1 ch left

10 ch left

65 ch right

i suspect that you have values like

10 ch left

20 ch left

60 ch right

so 60 - 20 = 40 characters in which you want to print 50 characters.

I hope you got my idea.

I had a LOT of trouble with that stuff and mostly it helped to change those numbers until i saw something changing.

Then try to understand what happened and why we have a change now and then go for the perfect solution.

Read only

0 Likes
1,353

Hi Florian,

Before seeing the post, I checked the tabs values and it is not properly aligned as specified in your reply. I solved by my own. But as your reply helped me, I rewarded the points.

Thanks.

Regards,

Hari