Skip to Content
0
Former Member
Dec 01, 2006 at 06:55 AM

sapsript: printing variable / loop itab

32 Views

Hi,

i have 2 problems with the printing on formular.

1 - in my driver programm i created a variable (sequence number), but it's not printed on the form.

code in driver program:

DATA: GV_LFDNR TYPE I.

FORM ITEM_PRINT.

LOOP AT GT_LIST INTO GS_LIST.

ADD 1 TO GV_LFDNR.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ITEM_LINE'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 1.

...

code in form (WINDOW=MAIN).

/E ITEM_LINE

A6 ,,&GV_LFDNR&,,&GS_LIST-MAKTX(15)&,,&GS_LIST-MATNR(08)&,,,,

= &GS_LIST-UNITQ&,,&GS_LIST-SERVCODE(03)&,,&GS_LIST-QUANTITY(03)&,,

...

What should i do to printed the variable on form?

2 - in my driver program i loop internal table. I get all records on form, but only the

last value of record.

code in driver program:

TYPES:

BEGIN OF TY_LIST,

MATNR LIKE /BSHM/FA_EVLG-MATNR,

MAKTX LIKE MAKT-MAKTX,

DOCCOUNT LIKE /BSHM/FA_EVLG-COUNTER,

UNITQ LIKE /BSHM/FA_UNIT-UNITQ,

SERVCODE LIKE /BSHM/FA_EVLG-SERVCODE,

QUANTITY LIKE /BSHM/FA_UNIT-QUANTITY,

PR_VIB TYPE I,

GES_PR TYPE I,

END OF TY_LIST.

DATA:

GT_LIST TYPE TABLE OF TY_LIST,

GS_LIST TYPE TY_LIST.

rest of code see above.

what might be the problem?

Thanks & regards