Application Development 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: 

sap script block positioning.

Former Member
0 Kudos

hi,

i have 2 pages in my sap script.

both the pages have the same "main" window.

i have given box command in the begining of this main window:

/:BOX XPOS '.5' CM YPOS '0' CM WIDTH '25' CM HEIGHT '1' CM FRAME 0 TW INTENSITY 15

/:BOX XPOS '.5' CM YPOS '0' CM WIDTH '25' CM HEIGHT 0 TW FRAME 10 TW

/:BOX XPOS '.5' CM YPOS '1' CM WIDTH '25' CM HEIGHT 0 TW FRAME 10 TW

The problem i am facing is :the box is coming at the right place for 1st page, but at the top of the page for the next window. i think it must be taking y coord. from the top of the page for the next window.

Please give a suitable solution for this,

thanks in advance,

Ravindra

14 REPLIES 14

former_member181962
Active Contributor
0 Kudos

Hi Ravindra,

The xpos and ypos are counted from the left top most corner of the WINDOW and not the PAGE.

i think in your case the main window in the first page has some other window above it and the second page doesn't have any other windows above it.

Regards,

Ravi

0 Kudos

hi, ravi,

thanks for the reply,

actually, the layout of 1st and 2nd page is exactly same.

also, the position of all the windows is same in both pages

thanks, Ravindra

Former Member
0 Kudos

wat is the position of ur main window in the 2nd page???

that decides where ur box comes in 2nd page

0 Kudos

hi, Bikash,

thanks for the reply,

the position of all the windows in 1st and 2nd

page are same.

Ravindra

Former Member
0 Kudos

Hii Ravindra

try this

BOX WIDTH 0 FRAME 10

BOX HEIGHT 0 FRAME 10

BOX WIDTH 5 CM HEIGHT 1 CM FRAME 10 TW INTENSITY 10

BOX WIDTH 7 CM HEIGHT 5 CM FRAME 10 TW INTENSITY 10

Use the box command with zero width for vertical lines.

plzz reward helpful ones.

Revert back for more help

Regards

Naresh

0 Kudos

hi, naresh,

thanks for thhe reply,

i tried ur solution..

but again, it is taking the top left corner as origin

for the next page,(<b>and not top left corner of the main window</b>).

thanks, Ravindra

Former Member
0 Kudos

May be you can use the IF condition.. and print the boxes accordingly..

like..

/: if &page& = 1

<print the box as per the 1st page MAIN dimensions>

/: else

<print the box as per the next page MAIN dimensions>

/: endif.

0 Kudos

hi, sravanthi,

thanks for thhe reply,

we cannot do that, since the window used in both pages is same.

thanks, Ravindra

Former Member
0 Kudos

hii Ravindra,

try this out

/: POSITION XORIGIN '11.21' YORIGIN '5.31' MM

/: SIZE HEIGHT '2' MM WIDTH '76' MM

/: BOX FRAME 10 TW INTENSITY 10

This can be usefull if you gave several boxes that share the same parameters.

If you want to set the position realtively to the window use POSITION WINDOW

to set the position to the top/left start of the window. Then use POSITION

to set the current position relatively to the start of the Window.

Note that you uses "+" or "-" in the ORIGIN position to the set the position relatively.

/: POSITION WINDOW

/: POSITION XORIGIN '5' MM YORIGIN '10' MM

the position is now 5 MM from the left and 10 MM from the top of the window

NOTE: After using the position command you can move the current position

realtively to the last used position

/: POSITION XORIGIN '10' MM YORIGIN '20' MM

Now the position will be X = 15 and Y = 30

Drawing a line. You can draw a line by setting the Height or Weidth to 0

and add a frane. E.g. a horizontal line:

/: SIZE HEIGHT '0' MM WIDTH '200' MM

/: BOX FRAME 10 TW XPOS '11.21' MM YPOS '14.81' MM INTENSITY 100

i guess this will help

revert back for more help

Regards

Naresh

0 Kudos

hi naresh,

thanks again for ur reply..

but the problem with it is that we are using the same

main window in both pages; and in first page , the

position of the box is as desired.

now if we change the code in the main window as u say, the

position of the box in the first page will be affected.

also, when seen in the settings> form painter>graphical form painter, the position is correctly displayed in both the pages.

Rgds,

Ravindra

Former Member
0 Kudos

Hi Ravindra,

Put the box commands within a Text Element. then before calling the Write_Form from the program for data in the main window, call this Text element using write_form.

this should work..had same problem some time back...

0 Kudos

Hi Bikash,

thanks again for ur reply..

but the box is already within a text element(520), and the print program is RFKORD00, which cannot be modified.

Rgds,

Ravindra

0 Kudos

then shift the box commands from ther to the top of the editor before all the text elements...

since u r not modifying the print program this problem is arising..

anyway try out...

Former Member
0 Kudos

Hii Ravindra ,

now make a duplicate of the current form and try removing the windows below MAIN window..this will clear out if the problem is because of other windows

Regards

Naresh