cancel
Showing results for 
Search instead for 
Did you mean: 

sapsript: printing variable / loop itab

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

1) Define sequence variable as standard data dictionary element...

2) In WRITE_FORM, use FUNCTION = 'APPEND"

Answers (2)

Answers (2)

Former Member
0 Kudos

The hint from Sanjay Shah solved the problems.

Only fields in data dictionary have to declare to the form interface.

Thanx a lot!

Former Member
0 Kudos

1) i created a data dictionary element and included in my driver program as follows:

DATA: GV_LFDNR TYPE /BSHP/FA_LLISTE-LFDNR.

... but the variable is not issued.

2) i add the parameter, but it doesn't work...