*&---------------------------------------------------------------------*
*& Report ZAFL_VIEWER
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zafl_viewer.
DATA: _log TYPE zafl_log.
INCLUDE zafl_macros.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-t00.
SELECT-OPTIONS: s_fm FOR _log-fname NO INTERVALS NO-EXTENSION.
SELECT-OPTIONS: s_guid FOR _log-guid.
SELECT-OPTIONS: s_cf1 FOR _log-cust_field1.
SELECT-OPTIONS: s_cf2 FOR _log-cust_field2.
SELECT-OPTIONS: s_cf3 FOR _log-cust_field3.
SELECT-OPTIONS: s_status FOR _log-status NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE TEXT-t01.
SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN COMMENT 1(20) TEXT-t02 FOR FIELD p_dstart.
PARAMETERS: p_dstart TYPE edidc-upddat DEFAULT sy-datum.
SELECTION-SCREEN COMMENT 35(20) TEXT-t03 FOR FIELD p_dend.
PARAMETERS: p_dend TYPE edidc-upddat.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE .
SELECTION-SCREEN COMMENT 1(20) TEXT-t04 FOR FIELD p_tstart.
PARAMETERS: p_tstart TYPE edidc-updtim DEFAULT '000000'.
SELECTION-SCREEN COMMENT 35(20) TEXT-t05 FOR FIELD p_tend.
PARAMETERS: p_tend TYPE edidc-updtim DEFAULT '235959'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b2.
* Block: Number Of Hits.
SELECTION-SCREEN BEGIN OF BLOCK no_of_hits WITH FRAME TITLE TEXT-t06.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) FOR FIELD pv_nofhs.
PARAMETERS pv_nofhs TYPE i DEFAULT 1000 MODIF ID nh2.
SELECTION-SCREEN POSITION 40.
PARAMETERS pc_nhnl AS CHECKBOX USER-COMMAND nh1.
SELECTION-SCREEN COMMENT 47(30) TEXT-t07 FOR FIELD pc_nhnl.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK no_of_hits.
TYPES: ty_time_cond TYPE RANGE OF timestamp.
TYPES BEGIN OF ty_log.
TYPES date TYPE sy-datum.
TYPES time TYPE sy-uzeit.
TYPES time_zone TYPE sy-zonlo.
INCLUDE TYPE zafl_log.
TYPES END OF ty_log.
DATA: gt_log TYPE STANDARD TABLE OF ty_log.
DATA: gr_alv TYPE REF TO cl_salv_table.
DATA:gv_s TYPE i,gv_e TYPE i,gv_c TYPE i.
*----------------------------------------------------------------------*
* CLASS lcl_handle_events DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_handle_events DEFINITION.
PUBLIC SECTION.
METHODS:
on_user_command FOR EVENT added_function OF cl_salv_events
IMPORTING e_salv_function,
on_link_click FOR EVENT link_click OF cl_salv_events_table
IMPORTING row column.
ENDCLASS. "lcl_handle_events DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_handle_events IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_handle_events IMPLEMENTATION.
METHOD on_user_command.
PERFORM handle_user_command USING e_salv_function.
ENDMETHOD. "on_user_command
"on_double_click
METHOD on_link_click.
DATA: value TYPE string.
DATA: fm_name TYPE rs38l_fnam.
FIELD-SYMBOLS:
<row> LIKE LINE OF gt_log
,<value> TYPE any
.
READ TABLE gt_log INDEX row ASSIGNING <row>.
IF sy-subrc = 0.
ASSIGN COMPONENT column OF STRUCTURE <row> TO <value>.
IF sy-subrc = 0.
value = <value>.
ENDIF.
ENDIF.
IF column = 'FNAME'.
fm_name = value.
SET PARAMETER ID 'LIB' FIELD fm_name.
CALL TRANSACTION 'SE37' AND SKIP FIRST SCREEN.
ELSE.
cl_demo_output=>display_json( <value> ).
ENDIF.
ENDMETHOD. "on_single_click
ENDCLASS. "lcl_handle_events IMPLEMENTATION
INITIALIZATION.
START-OF-SELECTION.
* DATA(gr_events) = NEW lcl_handle_events( ).
DATA gr_events TYPE REF TO lcl_handle_events.
CREATE OBJECT gr_events.
PERFORM get_data.
PERFORM display.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data.
DATA: s_ts TYPE ty_time_cond.
CLEAR :gv_s,gv_e,gv_c.
FIELD-SYMBOLS:<fs_log> LIKE LINE OF gt_log.
PERFORM get_time_cond USING p_dstart
p_dend
p_tstart
p_tend
s_ts.
CASE pc_nhnl.
WHEN 'X'.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE gt_log
* UP TO pv_nofhs ROWS
FROM zafl_log
WHERE guid IN s_guid
AND fname IN s_fm
AND cust_field1 IN s_cf1
AND cust_field2 IN s_cf2
AND cust_field3 IN s_cf3
AND status IN s_status
AND timestamp IN s_ts .
WHEN ''.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE gt_log
UP TO pv_nofhs ROWS
FROM zafl_log
WHERE guid IN s_guid
AND fname IN s_fm
AND cust_field1 IN s_cf1
AND cust_field2 IN s_cf2
AND cust_field3 IN s_cf3
AND status IN s_status
AND timestamp IN s_ts .
ENDCASE.
LOOP AT gt_log ASSIGNING <fs_log> WHERE timestamp IS NOT INITIAL.
<fs_log>-time_zone = sy-zonlo.
CONVERT TIME STAMP <fs_log>-timestamp
TIME ZONE <fs_log>-time_zone
INTO DATE <fs_log>-date
TIME <fs_log>-time.
IF <fs_log>-status = 'S'.
gv_s = gv_s + 1.
ELSEIF <fs_log>-status = 'E'.
gv_e = gv_e + 1.
ENDIF.
gv_c = gv_c + 1.
ENDLOOP.
ENDFORM. "get_data
*&---------------------------------------------------------------------*
*& Form get_time_cond
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->SDATE text
* -->EDATE text
* -->STIME text
* -->ETIME text
* -->RESULT text
*----------------------------------------------------------------------*
FORM get_time_cond USING sdate TYPE dats
edate TYPE dats
stime TYPE uzeit
etime TYPE uzeit
result TYPE ty_time_cond.
DATA:start_date TYPE dats
,end_date TYPE dats
,start_timestamp TYPE timestamp
,end_timestamp TYPE timestamp
,ls_result TYPE LINE OF ty_time_cond
.
IF sdate IS INITIAL AND edate IS INITIAL.
RETURN.
ENDIF.
start_date = sdate.
end_date = edate.
IF end_date IS INITIAL.
end_date = start_date.
ENDIF.
IF start_date IS INITIAL.
start_date = end_date.
ENDIF.
start_timestamp = start_date && stime.
end_timestamp = end_date && etime.
* MOVE 'IBT' TO result.
ls_result-sign = 'I'.
ls_result-option = 'BT'.
ls_result-low = start_timestamp.
ls_result-high = end_timestamp.
APPEND ls_result TO result.CLEAR ls_result.
* result = value #( SIGN = 'I' OPTION = 'BT' (
* LOW = start_timestamp
* HIGH = end_timestamp
* )
* ).
ENDFORM. "get_time_cond
*&---------------------------------------------------------------------*
*& Form DISPLAY
*&---------------------------------------------------------------------*
* text
*---
Jasson
- 粉丝: 183
- 资源: 11
最新资源
- 1734956384252.jpeg
- NEMS.exe v2.4
- 游戏人物头部检测24-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 疾病防控综合系统-JAVA-基于springboot的疾病防控综合系统的设计与实现(毕业论文)
- VBA视频教程 0005
- 游戏人物检测1-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 四轮独立驱动横摆角速度控制,LQR 基于LQR算法的 基于二自由度动力学方程,通过主动转向afs和直接横摆力矩dyc实现的横摆角速度跟踪 ,模型包括期望横摆角速度,质心侧偏角,稳定性因素,lqr模块等
- 线控转向系统Carsim和Simulink联合仿真模型,带Carsim数据库,C级车 【正向建模,利用三环PID控制算法控制无刷直流电机获得前轮转角】 主要根据Carsim自带的转向系统,查出小齿轮
- Survey Document -1.xlsx
- 游戏人物检测11-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 线控转向-Carsim与simulink联合仿真模型 包含转向电机模型,转向执行机构模型,齿轮齿条模型 提供carsim参数配置文件 simulink模型文件 对应参考资料
- 数据结构课设-哈夫曼编码译码器
- 基于一阶RC模型,电池带遗忘因子递推最小二乘法+扩展卡尔曼滤波算法(FFRLS+ EKF),参数与SOC的在线联合估计,matlab程序
- 车牌号自动识别程序-matlab
- 游戏人物检测129-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 考虑过网费用分摊的多产消者点对点能源交易分布式优化 摘要:代码主要做的是配电网中产消者点对点交易相关研究,配网中的卖方和买方通过P2P交易匹配协商来平衡供需,同时重点考虑了P2P交易过程中公共设施的使
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈