Skip to Content
0
Former Member
Dec 27, 2007 at 08:12 AM

sapscript

15 Views

hello abapers,

I have the next code:

TABLES: BSEG, LFA1.

  • Selection criteria

PARAMETERS S_LIFNR LIKE bseg-LIFNR.

DATA: BEGIN OF T_DATA1 OCCURS 0,

T_NAME1 LIKE LFA1-NAME1,

T_STRAS LIKE LFA1-STRAS,

T_ORT01 LIKE LFA1-ORT01,

T_PSTLZ LIKE LFA1-PSTLZ,

T_LIFNR1 LIKE LFA1-LIFNR,

T_LIFNR2 LIKE BSEG-LIFNR,

T_GJAHR LIKE BSEG-GJAHR,

END OF T_DATA1.

select name1 stras ort01 pstlz lifnr

from LFA1

into corresponding fields of table T_DATA1

where lifnr = S_LIFNR.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

form = 'ZNOVALE_OST_PRU1'

device = 'PRINTER'

dialog = 'X'

language = SY-LANGU

EXCEPTIONS

canceled = 1

device = 2

form = 3

options = 4

unclosed = 5.

loop at T_DATA1.

CALL FUNCTION 'START_FORM'

EXPORTING

startpage = 'FIRST'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'CABECERA'.

CALL FUNCTION 'END_FORM'.

endloop.

CALL FUNCTION 'CLOSE_FORM'.

Then, to get data in the form, I have the next code:

PN &T_DATA1-T_NAME1&

PN &T_DATA1-T_ORT01&

PN &T_DATA1-T_PSTLZ&

But it no obtain.

¿Can you help me, please?