You are on page 1of 3

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

*& Report  ZSCRIPT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZSCRIPT.

data: BEGIN OF wa_emp_exp,
  id type zeid,
  name type zgname,
  doj type zdoj,
  designation type zdesignation,
  END OF wa_emp_exp.

DATA: it_EMP_exp like TABLE OF wa_emp_exp,
      wa1_emp_exp like wa_emp_exp.

SELECTION-SCREEN begin of BLOCK b1 with frame TITLE text_000.
SELECT-OPTIONS: s_id for wa_emp_exp-id.
SELECTION-SCREEN END OF block b1.

START-OF-SELECTION.
  perform read_emp_exp_data.
  PERFORM open_form.

  sort it_EMP_exp by id.
  loop at it_emp_exp into wa_emp_exp.
    wa1_emp_exp = wa_emp_exp.
    at new id.
      PERFORM start_form.
      PERFORM write_form_address.
      perform write_form_logo.
      perform write_form_print_main.
      perform write_print_sign.
      perform endform.
    endat.
  endloop.
  PERFORM close_form.
*&---------------------------------------------------------------------*
*&      Form  read_emp_exp_data
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form read_emp_exp_data.

  select id name doj designation into table it_emp_exp
    from zemp_exp_details where id in s_id.
endform.                    "read_emp_exp_data

*&---------------------------------------------------------------------*
*&      Form  open_form
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form open_form.
  CALL FUNCTION 'OPEN_FORM'.
endform.                    "open_form
*&---------------------------------------------------------------------*
*&      Form  write_form_address
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form write_form_address.
  CALL FUNCTION 'WRITE_FORM'
    EXPORTING
      ELEMENT = 'PRINT_ADDRESS'
      WINDOW  = 'ADDRESS'.
endform.                    "write_form_address
*&---------------------------------------------------------------------*
*&      Form  write_form_print_main
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form write_form_print_main.
  CALL FUNCTION 'WRITE_FORM'
    EXPORTING
      ELEMENT = 'PRINT_MAIN'
      WINDOW  = 'MAIN'.
endform.                    "write_form_print_main
*&---------------------------------------------------------------------*
*&      Form  start_form
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form start_form.
  CALL FUNCTION 'START_FORM'
    EXPORTING
      FORM = 'ZSCRIPTS'.
endform.                    "start_form

*&---------------------------------------------------------------------*
*&      Form  endform
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form endform.
  CALL FUNCTION 'END_FORM'.
endform.                    "endform

*&---------------------------------------------------------------------*
*&      Form  close_form
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form close_form.
  CALL FUNCTION 'CLOSE_FORM'.
endform.                    "close_form
*&---------------------------------------------------------------------*
*&      Form  write_form_logo
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form write_form_logo.
  CALL FUNCTION 'WRITE_FORM'
    EXPORTING
      ELEMENT = 'PRINT_LOGO'
      WINDOW  = 'LOGO'.
endform.                    "write_form_logo
*&---------------------------------------------------------------------*
*&      Form  write_print_sign
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
form write_print_sign.
  CALL FUNCTION 'WRITE_FORM'
    EXPORTING
      ELEMENT = 'PRINT_SIGN'
      WINDOW  = 'SIGN'.
endform.                    "write_print_sign

You might also like