cancel
Showing results for 
Search instead for 
Did you mean: 

WRITE_FORM keeps the last value of the structure

Former Member
0 Kudos

Hi experts!!

I have the following requirement: print labels from SAP.

The sticker papers have 8 rows and 3 colums, i.e. 24 stickers per page.

In order to do that i have created a sapscript form whick has 24 windows per page with 24 different text elements.

While looping to my internal table i change the element's name and window's name dynamically and then call the 'WRITE_FORM' function module with the respective element and window.

The problem is that as a result i get the last line of the internal table printed in all windows!

Please help!!!!!

Here is the code that i use:

index = index + 1.

PACK index TO ind.

CONCATENATE 'WINDOW' ind INTO window.

CONCATENATE 'LABEL' ind INTO element.

MOVE-CORRESPONDING i_form to zlabelstr.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = element

window = window

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

spool_error = 8

codepage = 9

OTHERS = 10.

IF sy-subrc <> 0.

ENDIF.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

I think the problem is the windows are not MAIN kind, u should create a grid (with 24 cells) in a main window instead of 24 window, or try to set VAR as attribute of your winows.

Max

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

loop internal table

call write_form.

endloop.