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: 

frame in MAIN window

former_member182371
Active Contributor
0 Kudos

Hi,

in my print program i´ve got something like:

LOOP AT itab.

l_counter = l_counter + 1.

IF l_counter <= 13.

CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'SMALLFRAME'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 1.

ELSE.

CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'BIGFRAME'
WINDOW = 'MAIN'
EXCEPTIONS
OTHERS = 1.

ENDIF.
ENDLOOP.

and in my sapscript i´ve got:
/E BIGFRAME
/: POSITION WINDOW
/: POSITION XORIGIN '-0.5' CH YORIGIN '-0.25' LN
/: SIZE WIDTH '+0.4' CH HEIGHT +1 LN
/: BOX WIDTH '71.50' CH

HEIGHT '40.87' LN

FRAME 20 TW
/E SMALLFRAME
/: POSITION WINDOW
/: POSITION XORIGIN '-0.5' CH YORIGIN '-0.25' LN
/: SIZE WIDTH '+0.4' CH HEIGHT +1 LN
/: BOX WIDTH '71.50' CH

HEIGHT '27.40' LN

FRAME 20 TW

why is it not working?

is it not possible within the loop of itab (position´s values) to decide wich frame i want (big or small)?

is it only possible to define the frame dimensions before processing the lines of the main window and not within the loop?

Best regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

It doesn't make a sense to put the call of a box into a loop if you have to call the box only one time for each page.

You should create a window (not main) where you insert the text element to create a frame. This window should overlap at the main.

For exampla if the main size is:

- WIDTH = 71.50

- HIGTH = 40.87

The window for fram should be:

- WIDTH = 71.51

- HIGTH = 40.88

So the code in your program should be:

LOOP AT itab.

l_counter = l_counter + 1.

ENDLOOP.

IF l_counter <= 13.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'SMALLFRAME'

WINDOW = 'FRAME'

EXCEPTIONS

OTHERS = 1.

ELSE.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'BIGFRAME'

WINDOW = 'FRAME'

EXCEPTIONS

OTHERS = 1.

ENDIF.

Max

ENDIF.

2 REPLIES 2

Former Member
0 Kudos

Hi

It doesn't make a sense to put the call of a box into a loop if you have to call the box only one time for each page.

You should create a window (not main) where you insert the text element to create a frame. This window should overlap at the main.

For exampla if the main size is:

- WIDTH = 71.50

- HIGTH = 40.87

The window for fram should be:

- WIDTH = 71.51

- HIGTH = 40.88

So the code in your program should be:

LOOP AT itab.

l_counter = l_counter + 1.

ENDLOOP.

IF l_counter <= 13.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'SMALLFRAME'

WINDOW = 'FRAME'

EXCEPTIONS

OTHERS = 1.

ELSE.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'BIGFRAME'

WINDOW = 'FRAME'

EXCEPTIONS

OTHERS = 1.

ENDIF.

Max

ENDIF.

Former Member
0 Kudos

Yes it is possible to decide within loop but I guess one will be overwritten by the other as you are hardcoding the Xorigin and Y origin for the box . So before you call function WRITE_FORM you must decide whether BIGFRAME or SMALLFRAME is to be printed if you want only one . If you want one frame after the other you should remove the command POSITION WINDOW as it resets te pointer to print starting from Window Margin as reference .

Cheers