0% found this document useful (0 votes)
33 views

Form Script

This report program YTFORM generates a form called YTRFORM to display transaction data from table YTRANS for a specified account number. It selects the transaction data from YTRANS into an internal table IT based on the account number parameter D. It then calls functions to write the transaction data from IT to the form fields for the table layout, table data, and footer data. After writing all the data, it closes the form.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Form Script

This report program YTFORM generates a form called YTRFORM to display transaction data from table YTRANS for a specified account number. It selects the transaction data from YTRANS into an internal table IT based on the account number parameter D. It then calls functions to write the transaction data from IT to the form fields for the table layout, table data, and footer data. After writing all the data, it closes the form.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

*&---------------------------------------------------------------------*

*& Report YTFORM


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT YTFORM.

TABLES:SSCRFIELDS.

TYPES : BEGIN OF AS,


DAT TYPE YTRANS-DAT,
ACNO TYPE YTRANS-ACNO,
ACNAME TYPE YTRANS-ACNAME,
ACTYP TYPE YTRANS-ACTYP,
CRDT TYPE YTRANS-CRDT,
DBT TYPE YTRANS-DBT,
BLNS TYPE YTRANS-BLNS,
END OF AS.

DATA : IT TYPE STANDARD TABLE OF AS INITIAL SIZE 0 , WA LIKE LINE OF IT.

PARAMETERS: D TYPE YTRANS-ACNO.


SELECTION-SCREEN : SKIP 2 , PUSHBUTTON 9(26) BUTTON USER-COMMAND PRIVIEW .

INITIALIZATION.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = 'ICON_LAYOUT_CONTROL'
TEXT = ' PRINT '
INFO = 'PRIENT '
IMPORTING
RESULT = BUTTON .

AT SELECTION-SCREEN .
CASE SSCRFIELDS-UCOMM.
WHEN 'PRIVIEW'.
SELECT * FROM YTRANS INTO CORRESPONDING FIELDS OF TABLE IT WHERE ACNO = D .

CALL FUNCTION 'OPEN_FORM'


EXPORTING
DEVICE = 'PRINTER'
DIALOG = 'X'
FORM = 'YTRFORM'
LANGUAGE = SY-LANGU.

CALL FUNCTION 'WRITE_FORM'


EXPORTING
ELEMENT = 'TABLE-LAYOUT'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'.

LOOP AT IT INTO WA .
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'TABLE-DATA'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'.
ENDLOOP.

LOOP AT IT INTO WA .
SUM.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'FOOTER-DATA'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'.
ENDLOOP.

CALL FUNCTION 'CLOSE_FORM'.


IF SY-SUBRC <> 0 .
ENDIF.

ENDCASE.

You might also like