Register Login

ABAP report showing Classical report.

Updated May 18, 2018

*CLASSICAL REPORT

REPORT  yclassicalreports_prathyusha NO STANDARD PAGE HEADING LINE-COUNT
 20(2) LINE-SIZE 62 MESSAGE-ID ymsg1           .
TABLES:kna1.
*INCLUDE PROGRAM.
INCLUDE yclassicalreportinc_prathyu.
*SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
SELECT-OPTIONS: s_kunnr FOR kna1-kunnr   NO-EXTENSION.
PARAMETERS:p_land1 LIKE kna1-land1.
SELECTION-SCREEN END OF BLOCK b1.

INITIALIZATION.
  REFRESH itab.
  CLEAR itab.
  p_land1 = 'US'.
  s_kunnr-low = 1.
  s_kunnr-high = 500.
  APPEND s_kunnr.
*INPUT CHECKS.
AT SELECTION-SCREEN ON p_land1.
  IF p_land1 NE 'US'.
    MESSAGE e001.
  ENDIF.
*START-OF-SELECTION.
START-OF-SELECTION.
  SELECT kunnr
                 name1
                 land1
                 FROM kna1
                 INTO TABLE itab
                 WHERE kunnr IN s_kunnr
                 AND land1 = p_land1.
  IF sy-subrc NE 0.
    MESSAGE e002.
  ENDIF.

END-OF-SELECTION.
  DATA:v_val TYPE i.
  LOOP AT itab.
    v_val = sy-tabix MOD 2.
    IF v_val = 0.
      FORMAT COLOR 5 INTENSIFIED OFF.
    ELSE.
      FORMAT COLOR COL_NORMAL.
    ENDIF.
    WRITE:/ sy-vline,
    (15) itab-kunnr,
    sy-vline,
    (30) itab-name1,
    sy-vline,
    (7) itab-land1,
    sy-vline.
  ENDLOOP.
  WRITE:/ sy-uline(62).

TOP-OF-PAGE.
  WRITE: / 'DATE:' , sy-datum,
          'TIME:' , sy-uzeit,
          'PAGENO:' , sy-pagno.

  WRITE: / sy-uline(62).
  FORMAT COLOR COL_HEADING.
  WRITE:/ sy-vline,
        text-003,
        sy-vline,
        text-004,
        sy-vline,
        text-005,
        sy-vline.
  WRITE:/ sy-uline(62).

END-OF-PAGE.

  WRITE: / sy-uline(62).
  WRITE: / 'END-OF-PAGE:' ,  sy-pagno.


×