Search This Blog

Search This Blog

Using HIDE Stmt in Reports

REPORT  ZHIDE.

TABLES EKKO.

SELECT-OPTIONS: S_EBELN FOR EKKO-EBELN.

DATA: BEGIN OF IT_EKKO OCCURS 0,
        EBELN TYPE EKKO-EBELN,
        BUKRS TYPE EKKO-BUKRS,
        LIFNR TYPE EKKO-LIFNR,
        EKORG TYPE EKKO-EKORG,
      END OF IT_EKKO.

DATA: BEGIN OF IT_EKPO OCCURS 0,
        EBELN TYPE EKPO-EBELN,
        EBELP TYPE EKPO-EBELP,
      END OF IT_EKPO.

SELECT EBELN
       BUKRS
       LIFNR
       EKORG INTO TABLE IT_EKKO FROM EKKO WHERE EBELN IN S_EBELN.

LOOP AT IT_EKKO.
WRITE: / IT_EKKO-EBELN,
         IT_EKKO-BUKRS,
         IT_EKKO-LIFNR,
         IT_EKKO-EKORG.

 HIDE IT_EKKO-EBELN.

ENDLOOP.

*********************************************************************
*                      AT LINE-SELECTION                            *
*********************************************************************

AT LINE-SELECTION.

IF SY-LSIND = 1.

 SELECT EBELN
        EBELP INTO TABLE IT_EKPO FROM EKPO WHERE EBELN = IT_EKKO-EBELN.

 LOOP AT IT_EKPO.
  WRITE: / IT_EKPO-EBELN,
         IT_EKPO-EBELP.
 ENDLOOP.

ENDIF.