First you need to create your form in transaction se71.
and second create an executable report like this:
*&---------------------------------------------------------------------*
*& Report ZSL_EX_FORM
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zsl_ex_form.
TABLES: zslproj, zslaloc, zslcli, zslcons.
DATA: s_zslproj LIKE zslproj,
t_zslaloc LIKE zslaloc OCCURS 0 WITH HEADER LINE,
s_zslcli LIKE zslcli,
s_zslcons like zslcons.
SELECTION-SCREEN: BEGIN OF BLOCK myblock WITH FRAME TITLE text-001.
PARAMETERS: proj LIKE zslproj-zcod_proj.
SELECTION-SCREEN:END OF BLOCK myblock.
SELECT SINGLE * FROM zslproj INTO s_zslproj WHERE zcod_proj = proj.
SELECT * FROM zslaloc INTO TABLE t_zslaloc WHERE zcod_proj = proj.
SELECT SINGLE * FROM zslcli INTO s_zslcli
WHERE zcod_cli = s_zslproj-zcod_cli.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
form = 'ZSL_EX_FORM'.
CALL FUNCTION 'START_FORM'
EXPORTING
* ARCHIVE_INDEX =
form = 'ZSL_EX_FORM'
language = sy-langu
startpage = 'FIRST'
program = sy-repid.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'HEAD'
* FUNCTION = 'SET'
* TYPE = 'BODY'
window = 'MAIN'.
loop at t_zslaloc.
SELECT SINGLE * FROM zslcons INTO s_zslcons
WHERE zcod_cons = t_zslaloc-zcod_cons.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'TABELA'
* FUNCTION = 'SET'
* TYPE = 'BODY'
window = 'MAIN'.
endloop.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
* element = 'TOPRIGHT'
* FUNCTION = 'SET'
* TYPE = 'BODY'
window = 'LOGO'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'TOPRIGHT'
* FUNCTION = 'SET'
* TYPE = 'BODY'
window = 'TOPRIGHT'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
* element = 'TOPRIGHT'
* FUNCTION = 'SET'
* TYPE = 'BODY'
window = 'MIDLE'.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'FOOTER'
* FUNCTION = 'SET'
* TYPE = 'BODY'
window = 'FOOTER'
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*
* CALL FUNCTION 'WRITE_FORM'
* EXPORTING
* element = 'ADDRESS'
** FUNCTION = 'SET'
** TYPE = 'BODY'
* window = 'WINDOW1'
** IMPORTING
** PENDING_LINES =
** 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.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
*
*
*LOOP AT T_VBAP.
* CALL FUNCTION 'WRITE_FORM'
* EXPORTING
* element = 'ELEMENTO'
** FUNCTION = 'SET'
** TYPE = 'BODY'
* window = 'MAIN'
** IMPORTING
** PENDING_LINES =
** 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.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
*
*
*ENDLOOP.
CALL FUNCTION 'END_FORM'.
CALL FUNCTION 'CLOSE_FORM'.
Subscrever:
Enviar feedback (Atom)
Sem comentários:
Enviar um comentário