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

Reports

The document defines data types and data objects to store and display company data. It selects company data into an internal table based on a selection screen field. It includes comments for printing the output, handling user commands to select/deselect all or download data, and performing actions on line selections.

Uploaded by

Subodh Kant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Reports

The document defines data types and data objects to store and display company data. It selects company data into an internal table based on a selection screen field. It includes comments for printing the output, handling user commands to select/deselect all or download data, and performing actions on line selections.

Uploaded by

Subodh Kant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

SET PF-STATUS 'EVENTS_DEMO'.

TYPES : BEGIN OF ty_t001,
     bukrs TYPE bukrs,
     butxt TYPE butxt,
     ort01 TYPE ort01,
  END OF ty_t001.
DATA : it_t001 TYPE TABLE OF ty_t001,
       wa_t001 TYPE ty_t001.

TYPES : BEGIN OF ty_cus,
       kunnr TYPE kunnr,
  END OF ty_cus.
DATA : it_cus TYPE TABLE OF ty_cus,
       wa_cus TYPE ty_cus.
DATA : v_bukrs TYPE bukrs.
SELECT-OPTIONS : s_bukrs FOR v_bukrs.

START-OF-SELECTION.
  SELECT bukrs butxt ort01 INTO TABLE it_t001
           FROM t001 WHERE bukrs IN s_bukrs.

***** Print the Output***********
*  LOOP AT it_t001 INTO wa_t001.
*    WRITE : /5
*              v_box as CHECKBOX,
*             wa_t001-bukrs,
*            15  wa_t001-butxt,
*            25  wa_t001-ort01.
*  ENDLOOP.

********* At- User-Command*********
*at user-COMMAND.
**data : v_box(1) TYPE C.
*case sy-ucomm.
*  if sy-ucomm = 'SALL'.
*     v_box = 'X'.
*           loop at it_t001 into wa_t001.
*         write : /5 v_box as CHECKBOX,
*                    wa_t001-bukrs,
*                    wa_t001-butxt,
*                    wa_t001-ort01.
*       endloop.
*       endif.
*    if sy-ucomm = 'DALL'.
*     v_box = SPACE.
*           loop at it_t001 into wa_t001.
*         write : /5 v_box as CHECKBOX,
*                    wa_t001-bukrs,
*                    wa_t001-butxt,
*                    wa_t001-ort01.
*       endloop.
*       endif.
*    if sy-ucomm = 'DOWNLOAD'.
*      CALL FUNCTION 'GUI_DOWNLOAD'
*        EXPORTING
*          filename                        = 'C:/downloa.txt'
*        tables
*          data_tab                        = it_t001.
*     endif.
*endcase.

*AT LINE-SELECTION.
* ********** Get Cursor***********
*  DATA : v_fnam1(15),
*         v_fval1 TYPE butxt.
*  get cursor FIELD v_fnam1 value v_fval1.
*  case sy-lsind.
*    when 1 .
*    select kunnr into table it_cus from knb1
*                   where bukrs = v_fval1.
*      loop at it_cus into wa_cus.
*        write : / wa_cus-kunnr.
*      ENDLOOP.
*  endcase.
*  ************** SY-LISEL*******************
*data : v_ort01 type ort01.
*  case sy-lsind.
*    when 1.
*      v_ort01 = sy-lisel+4(4).
*    select kunnr into table it_cus from knb1
*                   where bukrs = v_bukrs.
*      loop at it_cus into wa_cus.
*        write : / wa_cus-kunnr.
*      ENDLOOP.
*endcase.

**********************Hide ******************
*      hide :  wa_t001-bukrs

*  case sy-lsind.
*    when 1.
*      select kunnr INTO table it_cus from knb1
*                   where bukrs = wa_t001-bukrs.
*  endcase.

You might also like