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

setting tab position for quantity fields in sap script

naresh_bammidi
Contributor
0 Likes
1,552

Dear Experts,

I am facing problem in aligning table data using tabs in SAP scripts.here i have to display currency fields ,that should be right justified.following is the screen shot of my layout.

[screens shot|http://www.anup080.blogspot.com/]

Here my table contains 16 columns.i am populating first 14 columns.For that i have created 14 tabs.following is the tab position for last three columns.

15,20 CM right         "currency field
16,60 CM right         "currency field
17,50 CM right         "currency field

But in my out put, last column value is misaligned.i tried to decrease the last tab size to 17 cm.Even though no change.What missed here?how the tab is working here?Please help me out.

With regards

Naresh

11 REPLIES 11
Read only

Former Member
0 Likes
1,361

Hi,

It could be an issue of not having enough space between the last two tabs as in the last but one tab s position is 16.6 cm and the last tab s position is 17.5 cm.

have you explored the (R) formatting option as well? Where you can explicity give alignment of a particular variable

Regards,

Arun

Read only

0 Likes
1,361

Hi thanks for your reply,

As you said earlier i am writing &field(8R)& this code in script.Here why to give length like (8R).what is happening with that notation?

with regards

Naresh

Read only

0 Likes
1,361

Hi Naresh,

This issue is purely depends upon tab settings, delete one tab

,,

in text editor or add one more tab and decleare that tab also.

Regards,

Surya.

Read only

0 Likes
1,361

Could you tell me how the tab is working ,in case of Right alignment.

with regards

Naresh Bammidi

Read only

0 Likes
1,361

Hi,

If you have already specified right aligned in your tab position, there is no need to go for (R) hard coding in your Script Editor.

Basically (8R) gives the lenght of the variable you want to print and the alignement ie. in this case 8 and Right aligned.

Check how you have given the tabs in your script editor . As mentioned in above post, you might have missed a single tab somewhere...

If you have sixteen columns , you should ideally have only 16 tabs...

So for the last column that is the sixteenth column , 16 tabs would have been encountered. And say the 16th tab position says 17.5cm Right aligned .. This means that the16th field will start printing from position 17.5 cm towards left side ( because it is right aligned).

If it were 17.5 cm left aligned , it would start printing from 17.5 towards right side.

Hope you understand the difference..

I still strongly believe you have an extra tab somewhere .

And like i said before , make sure you have enough width in the main window.

Give a screenshot of the line that you are printing in the script editor and also all the tab positions if issue still unresolved...

Regards,

Arun

Read only

0 Likes
1,361

Hi Arun ,

Now i understood what is going on with tabs left and right alignment.I am sure ,giving exactly 16 tabs.Following is the script code

IM         ,,&W_SNO&,,Empty,,&E_OUTPUT-MAKTX&,,Empty value 

=           ,,&E_OUTPUT-CHAPID&,,&E_OUTPUT-D_EDCES&,,&E_OUTPUT-MENGE&,,&E_OUTPUT-MATNR&,,&E_OUTPUT-EXBAS&  

=           ,,&E_OUTPUT-AMOUNT&,,&E_OUTPUT-PALLET_QTY&,,&E_OUTPUT-NUM_PALLETS&,,&E_OUTPUT-C_EDCESS&,,

=           &E_OUTPUT-FKIMG(8)&,,&E_OUTPUT-KBETR&,,&E_OUTPUT-NETWR&

from the above code you can notice some values are hard coded.

Tab positions:

1         0,10 CM    LEFT 

 2         0,40 CM    LEFT 

 3         1,50 CM    LEFT 

4          3,80 CM    LEFT

5          6,20 CM    LEFT

6          8,50 CM    RIGHT

7          9,90 CM    RIGHT

8          9,95 CM    RIGHT

9        12,20 CM    RIGHT

10      13,50 CM    RIGHT

11      14,40 CM    RIGHT

12      15,20 CM    RIGHT

13       16,60 CM    RIGHT

14       17,40 CM    RIGHT

15       18,10 CM    RIGHT

16       19,10 CM    RIGHT

My script output become like this

[screen shot 2|http://www.scrnshots.com/users/anuups/screenshots/296027]

up to 13th column alignment is good.but from the 14th column onwards missing alignment.Even i tried to decrement tab size to 17.9 CM,even though no change in the print preview. what i missed here?please help me out.

with regards

Naresh

Read only

0 Likes
1,361

Hi naresh,

Unfortuantely i am not able to view the screenshot as i cannot access site from office. I will check them later on

One thing i noticed here is your tab position no. 8. If i am not mistaken , that is for your MATNR field.. This should be left aligned and not right aligned ie change alignment of tab no. 8 from Right to Left. This could be causing problems later on.

In the 14th column , i dont think you should restrict the no. of characters to 8 . Try removing and doing some adjustment there too.. Will get back to you after seeing the screenshot as well.

Regards,

Arun

Read only

0 Likes
1,361

Sorry Arun ,this is my Typo mistake.i gave alignment as left only.

With regards

Naresh Bammidi

Read only

0 Likes
1,361

Hi Naresh,

Go step by step.. Remove 15th and 16th value columns.... And try with 1 through 14 columns only.... Remove the (8) addition for 14th column... See if it works fine....

If not , play around with tab position of 14th Tab.. And then after the alignment for the 14 th column is alright, put back the 15 th and 16th column..

I think with a few iterations, your script should come out fine...

Regards,

Arun

Read only

0 Likes
1,361

Hi Naresh,

I am not sure, please try compress format options as below

&E_OUTPUT-FKIMG(C)&,,&E_OUTPUT-KBETR(C)&,,&E_OUTPUT-NETWR(C)&

Regards,

Surya

Read only

0 Likes
1,361

Thank's for your suggestion,

it's working and compressing the space.Let me check with different line items and will come back to you with status.

With regards,

Naresh