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

Vline in sapscript

Former Member
0 Likes
1,773

i want to make vline that will be 50 why i get small

like this <b>|</b>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,487

hi

good

try this out

REPORT z_find_view LINE-SIZE 80.

TABLES: dd26s.

DATA: ctr1 TYPE i,

ctr2 TYPE i,

col TYPE i.

DATA: BEGIN OF itab OCCURS 0,

viewname TYPE viewname,

tabname TYPE vibastab,

END OF itab.

DATA: vtabs TYPE vibastab OCCURS 0 WITH HEADER LINE.

RANGES: r_tab FOR dd26s-tabname.

PARAMETERS: p_tab1 TYPE vibastab OBLIGATORY,

p_tab2 TYPE vibastab,

p_tab3 TYPE vibastab,

p_tab4 TYPE vibastab,

p_tab5 TYPE vibastab.

START-OF-SELECTION.

PERFORM fill_table_range.

PERFORM select_views.

FORMAT COLOR 1.

WRITE: / sy-vline,

' View ',

20 sy-vline,

(57) 'Tables' CENTERED,

sy-vline.

ULINE.

LOOP AT itab.

AT NEW viewname.

CLEAR ctr2.

ENDAT.

ctr2 = ctr2 + 1.

AT END OF viewname.

IF ctr2 = ctr1.

PERFORM write_view.

ENDIF.

ENDAT.

ENDLOOP.

ULINE.

AT LINE-SELECTION.

SET PARAMETER ID 'DVI' FIELD itab-viewname.

CALL TRANSACTION 'SE11'.

FORM fill_table_range .

ctr1 = 1.

r_tab-sign = 'I'.

r_tab-option = 'EQ'.

r_tab-low = p_tab1.

APPEND r_tab.

IF NOT p_tab2 IS INITIAL.

r_tab-low = p_tab2.

APPEND r_tab.

ctr1 = ctr1 + 1.

ENDIF.

IF NOT p_tab3 IS INITIAL.

r_tab-low = p_tab3.

APPEND r_tab.

ctr1 = ctr1 + 1.

ENDIF.

IF NOT p_tab4 IS INITIAL.

r_tab-low = p_tab4.

APPEND r_tab.

ctr1 = ctr1 + 1.

ENDIF.

IF NOT p_tab5 IS INITIAL.

r_tab-low = p_tab5.

APPEND r_tab.

ctr1 = ctr1 + 1.

ENDIF.

ENDFORM. " fill_table_range

FORM select_views .

SELECT viewname tabname

FROM dd26s

INTO TABLE itab

WHERE tabname IN r_tab.

SORT itab BY viewname.

ENDFORM. " select_views

FORM write_view .

REFRESH vtabs.

SELECT tabname

FROM dd26s

INTO TABLE vtabs

WHERE viewname = itab-viewname.

IF col = 0.

FORMAT RESET.

col = 1.

ELSE.

FORMAT COLOR 2.

col = 0.

ENDIF.

WRITE: / sy-vline, itab-viewname(16), sy-vline.

HIDE itab-viewname.

DO 5 TIMES.

CLEAR vtabs.

READ TABLE vtabs INDEX sy-index.

WRITE: vtabs(08) NO-GAP, sy-vline.

ENDDO.

READ TABLE vtabs INDEX 6.

IF sy-subrc = 0.

WRITE: ' <more>', sy-vline.

ELSE.

WRITE: ' ', sy-vline.

ENDIF.

ENDFORM. " write_view

thanks

mrutyun

12 REPLIES 12
Read only

Former Member
0 Likes
1,487

Hi,

You can't set height for vline,

you can use BOX command with width 0 to create a line of your length.

Regards,

Raghavendra

Read only

0 Likes
1,487

i did not understand can you give me exam

Read only

Former Member
0 Likes
1,487

Hi Liat,

Correct me if I am wrong.

Your requirement is how to display VLINE which is 50 CM.

You can do that using BOX command

/: BOX WIDTH 0 CM HEIGHT 50 CM FRAME 5 TW INTENSITY 1.

Regards,

SP.

Read only

Former Member
0 Likes
1,488

hi

good

try this out

REPORT z_find_view LINE-SIZE 80.

TABLES: dd26s.

DATA: ctr1 TYPE i,

ctr2 TYPE i,

col TYPE i.

DATA: BEGIN OF itab OCCURS 0,

viewname TYPE viewname,

tabname TYPE vibastab,

END OF itab.

DATA: vtabs TYPE vibastab OCCURS 0 WITH HEADER LINE.

RANGES: r_tab FOR dd26s-tabname.

PARAMETERS: p_tab1 TYPE vibastab OBLIGATORY,

p_tab2 TYPE vibastab,

p_tab3 TYPE vibastab,

p_tab4 TYPE vibastab,

p_tab5 TYPE vibastab.

START-OF-SELECTION.

PERFORM fill_table_range.

PERFORM select_views.

FORMAT COLOR 1.

WRITE: / sy-vline,

' View ',

20 sy-vline,

(57) 'Tables' CENTERED,

sy-vline.

ULINE.

LOOP AT itab.

AT NEW viewname.

CLEAR ctr2.

ENDAT.

ctr2 = ctr2 + 1.

AT END OF viewname.

IF ctr2 = ctr1.

PERFORM write_view.

ENDIF.

ENDAT.

ENDLOOP.

ULINE.

AT LINE-SELECTION.

SET PARAMETER ID 'DVI' FIELD itab-viewname.

CALL TRANSACTION 'SE11'.

FORM fill_table_range .

ctr1 = 1.

r_tab-sign = 'I'.

r_tab-option = 'EQ'.

r_tab-low = p_tab1.

APPEND r_tab.

IF NOT p_tab2 IS INITIAL.

r_tab-low = p_tab2.

APPEND r_tab.

ctr1 = ctr1 + 1.

ENDIF.

IF NOT p_tab3 IS INITIAL.

r_tab-low = p_tab3.

APPEND r_tab.

ctr1 = ctr1 + 1.

ENDIF.

IF NOT p_tab4 IS INITIAL.

r_tab-low = p_tab4.

APPEND r_tab.

ctr1 = ctr1 + 1.

ENDIF.

IF NOT p_tab5 IS INITIAL.

r_tab-low = p_tab5.

APPEND r_tab.

ctr1 = ctr1 + 1.

ENDIF.

ENDFORM. " fill_table_range

FORM select_views .

SELECT viewname tabname

FROM dd26s

INTO TABLE itab

WHERE tabname IN r_tab.

SORT itab BY viewname.

ENDFORM. " select_views

FORM write_view .

REFRESH vtabs.

SELECT tabname

FROM dd26s

INTO TABLE vtabs

WHERE viewname = itab-viewname.

IF col = 0.

FORMAT RESET.

col = 1.

ELSE.

FORMAT COLOR 2.

col = 0.

ENDIF.

WRITE: / sy-vline, itab-viewname(16), sy-vline.

HIDE itab-viewname.

DO 5 TIMES.

CLEAR vtabs.

READ TABLE vtabs INDEX sy-index.

WRITE: vtabs(08) NO-GAP, sy-vline.

ENDDO.

READ TABLE vtabs INDEX 6.

IF sy-subrc = 0.

WRITE: ' <more>', sy-vline.

ELSE.

WRITE: ' ', sy-vline.

ENDIF.

ENDFORM. " write_view

thanks

mrutyun

Read only

0 Likes
1,487

i want the main window to cut for 4 pices with vline

i tried your exam it not work sorry

Read only

Former Member
0 Likes
1,487

Hi,

To draw vertical line of your length use the BOX command as below try it out it should solve your problem.

BOX HEIGHT 50 CM FRAME 10 TW INTENSITY 15

Regards,

Raghavendra

Read only

0 Likes
1,487

it not work why.

i need to spreed the main window to 4

Read only

Former Member
0 Likes
1,487

Hi,

If you want it to cut into 4 pieces,

you have to specify the X origin Y origin and width accordingly,

send me your mail id i will send you the document regarding the same,

you will be able to understand it better after going through it.

Regards,

Raghavendra

Read only

0 Likes
1,487

liat2tal@walla.com

Read only

0 Likes
1,487

Hi liat,

you can very well use sy-vline i don't know what problem you are facing. i checked it , it is working fine for me.

i did it in my main window like this...

don't give any thing like thsi /: for commands we give.

<b>

&SYST-VLINE(255)& &SYST-VLINE(255)& &SYST-VLINE(255)&

</b>

then the form output will be

this kind of output you are looking.

Regards

vijay

Read only

Former Member
0 Likes
1,487

Hi Liat,

Try this --

Assuming page width to be 20 cm.

/: POSITION WINDOW

Sets the origin for the coordinate system to the upper left corner of the window.

/: POSITION XORIGIN 20 CM YORIGIN 25 CM

Sets the origin for the coordinate system to a point 20 cm from the left edge and 25 cm ie the center of screen

/: BOX WIDTH 0 CM HEIGHT 50 CM FRAME 10 TW INTENSITY 15

Draws the vertical line

/: BOX WIDTH 20 CM HEIGHT 0 CM FRAME 10 TW INTENSITY 15

Draws the horizontal line

Regards,

Aniket

Read only

Former Member
0 Likes
1,487

Hi Liat,

/: SIZE WINDOW

This command will set HEIGHT AND WIDTH to the current window dimensions.

Now you can draw a box using BOX command and this will span the entire window.

NOw you can fix the position of the lines,which are used to divide the window using POSITION command.In your case, one line will be positioned at (WIDTH , HEIGHT/2) and the other one will be positioned at (HEIGHT,WIDTH/2).

NOw you can draw Horizontal and vertical line using BOX command.

This should divide the MAIN window in to 4 parts.

Check these links too..

http://www.esnips.com/doc/7dd71921-a71f-4163-a4e0-c7e6e867d737/sap-script.pdf

http://www.esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf

http://www.esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf

I have also sent you a nice document in your mail also.

Hope your query is solved.

Regards,

SP.