วันพฤหัสบดีที่ 2 กันยายน พ.ศ. 2553

Program ABAP : zbot_exchangerate : Data Type


report  zbot_exchangerate no standard page heading line-size 200.
*&---------------------------------------------------------------------*
*&                       - P R O G R A M -                             *
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& I N C L U D E                                                       *
*&---------------------------------------------------------------------*

*&---------------------------------------------------------------------*
*& T A B L E S                                                         *
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& D A T A                                                             *
*&---------------------------------------------------------------------*
data : begin of gi_excel occurs 0,
          line type string,
       end of gi_excel.
data : begin of gi_header occurs 0,
          line type string,
       end of gi_header.
data : gi_tab type table of string,
       gi_tab2 type table of string,
       gi_str type table of string,
       gw_tab type string.
data : gv_rdate type sy-datum,
       gv_edate type sy-datum,
       gv_adate type sy-datum,
       gv_pdate type sy-datum,
       gv_fdate type sy-datum,
       gv_bdate type sy-datum,
       gv_ndate type sy-datum,                     
       gv_i type i.
types : begin of t_map .
include type zcm001_exchange.
types :  ffact  type ffact_curr,
         tfact  type tfact_curr,
        end of t_map.

types : begin of t_result .
include type bapi1093_0.
types :
         zindex type i,
         status type string,
         msg type string,
        end of t_result.
data : gi_map type t_map occurs 0 with header line.
data : gi_result type t_result occurs 0 with header line.
data : gi_holi type iscal_day occurs 0 with header line.
data : gi_t247 type t247 occurs 0 with header line.

data : begin of gi_rate occurs 0,
          zindex type i,
          nation type string,
          waers  type waers,
          sb     type p decimals 4,
          tt     type p decimals 4,
          asr    type p decimals 4,
       end of gi_rate.
data : gv_uri type string.
data : gv_holiday.                                 
ranges : r_waers for zcm001_exchange-waers.
*&---------------------------------------------------------------------*
*& S E L E C T I O N S                                                 *
*&---------------------------------------------------------------------*
selection-screen begin of block xx1 with frame title text-001.
parameters: p_bukrs like t001-bukrs default 10 no-display,
            p_date  type sy-datum default sy-datum.
parameters: p_http  radiobutton group r1.
*            P_URI TYPE STRING NO-DISPLAY.
parameters: p_local radiobutton group r1,
            p_file type string default 'D:\ER_XLS_03102008.xls'.
parameters : p_test as checkbox default 'X'.

selection-screen end of block xx1.
*&---------------------------------------------------------------------*
*& A T  S E L E C T I O N  S C R E E N                                 *
*&---------------------------------------------------------------------*
at selection-screen on value-request for p_file.
  data : lv_file type rlgrap-filename.
  lv_file = p_file.
  call function 'KD_GET_FILENAME_ON_F4'
    exporting
      mask      = ',*.txt,*.*'
      static    = 'X'
    changing
      file_name = lv_file.
*&---------------------------------------------------------------------*
*& I N I T I A L I Z A T I O N                                         *
*&---------------------------------------------------------------------*
initialization.
  p_date = sy-datum.


*&---------------------------------------------------------------------*
*& A T  S E L E C T I O N  S C R E E N                                 *
*&---------------------------------------------------------------------*
at selection-screen.
*&---------------------------------------------------------------------*
*& A T  L I N E  S E L E C T I O N                                     *
*&---------------------------------------------------------------------*
at line-selection.
*&---------------------------------------------------------------------*
*& A T  U S E R  C O M M A N D                                         *
*&---------------------------------------------------------------------*
at user-command.
*&---------------------------------------------------------------------*
*& T O P  O F  P A G E                                                 *
*&---------------------------------------------------------------------*
top-of-page.


>> Start-Of-Selection

ไม่มีความคิดเห็น:

แสดงความคิดเห็น