主页 > 云服务器 > > 正文

分布式存储_英雄联盟连不上服务器_免费6个月

浏览:

分布式存储_英雄联盟连不上服务器_免费6个月

Initial requirement

My requirement was to create two reports with ALV Grid output. These reports should be called via transaction codes, and their data gathering should be done thru function modules, for the identical data will be needed for a Web Tool accessing those data via RFC.

Issue

For there is no data selection and no selection screen in these reports (and there shouldn’t be one as required), after starting these transactions the users see nothing for several seconds, until the ALV Grid is displayed. So some users became unsure, if they’ve correctly started the transactions.

Looking for a solution

I was looking for some ideas, and I found here on SCN some threads pointing to class CL_GUI_TIMER. So I decided to create a function module calling a screen and closing it, after the timer interval has finished.

Creating the function module

First I thought about the data to be passed to the function module:

Code of the function module

FUNCTION zmy_popup_show.

*"———————————————————————-

*"*"Local Interface:

*"  IMPORTING

*"     VALUE(I_HEADER_TEXT) TYPE  TEXT80

*"     VALUE(I_INFO_TEXT1) TYPE  TEXT80

*"     VALUE(I_LABEL_TEXT) TYPE  TEXT30 OPTIONAL

*"     VALUE(I_VALUE_TEXT) TYPE  TEXT50 OPTIONAL

*"     VALUE(I_INFO_TEXT2) TYPE  TEXT80 OPTIONAL

*"     VALUE(I_INTERVAL) TYPE  I DEFAULT 5

*"———————————————————————-

* Filling dynpro fields and interval

xv_header_text                     =  i_header_text.

xv_info_text1                      =  i_info_text1.

xv_info_text2                      =  i_info_text2.

xv_label_text                      =  i_label_text.

xv_value_text                      =  i_value_text.

xv_interval                        =  i_interval.

* Call info screen 9000

CALL SCREEN                           ‘9000’

STARTING                        AT  5 5.

ENDFUNCTION.

Here I pass all input parameters to global defined variables. All text fields will be shown at the screen.

Code of the function group’s TOP include

FUNCTION-POOL zmy_popup.                    "MESSAGE-ID ..

* Definitions

CLASS xcl_event_receiver      DEFINITION DEFERRED.

DATA: xo_event          TYPE  REF TO xcl_event_receiver."#EC NEEDED

DATA: xv_header_text    TYPE  text80.

DATA: xv_info_text1     TYPE  text80.

DATA: xv_info_text2     TYPE  text80.

DATA: xv_interval       TYPE  i.

DATA: xv_label_text     TYPE  text30.

DATA: xo_timer          TYPE  REF TO cl_gui_timer.

DATA: xv_value_text     TYPE  text50.

* Definition of class XCL_EVENT_RECEIVER

INCLUDE lzmy_popupcls.

For catching the FINISHED event of class CL_GUI_TIMER a local event receiver class is needed:

Event Receiver Class Definition …

*&———————————————————————*

*&  Include           LZMY_POPUPCLS

*&———————————————————————*

*———————————————————————-*

*   CLASS xcl_event_receiver DEFINITION

*———————————————————————-*

CLASS xcl_event_receiver DEFINITION.

PUBLIC SECTION.

CLASS-METHODS:

timer_finished       FOR EVENT  finished

OF  cl_gui_timer.

ENDCLASS.                    "xcl_event_receiver DEFINITION

… and Implementation

*&———————————————————————*

*&  Include           LZMY_POPUPCLI

*&———————————————————————*

*———————————————————————-*

*   CLASS xcl_event_receiver IMPLEMENTATION                            *

*———————————————————————-*

*   Handle events                                                      *

*———————————————————————-*

CLASS xcl_event_receiver IMPLEMENTATION.

*———————————————————————-*

*       METHOD timer_finished                                          *

*———————————————————————-*

*       Action after timer has finished                                *

*———————————————————————-*

METHOD timer_finished.

PERFORM                     exit_dynpro.

ENDMETHOD.                    "timer_finished

ENDCLASS.                    "xcl_event_receiver IMPLEMENTATION

How to leave will be shown in FORM EXIT_DYNPRO later.

Definition of the Info Screen 9000

The flow logic looks pretty simple:

PROCESS BEFORE OUTPUT.

MODULE call_timer.

*

PROCESS AFTER INPUT.

MODULE exit_dynpro.

The screen contains the fields

and some frames:

Remark: Übertschrift means Header/Heading.

Definition of PBO module CALL_TIMER:

*&———————————————————————*

*&  Include           LZMY_POPUPO01

*&———————————————————————*

*&———————————————————————*

*&      Module  CALL_TIMER  OUTPUT

*&———————————————————————*

*       Create and start timer

*———————————————————————-*

MODULE call_timer OUTPUT.

* Timer setzen

CREATE  OBJECT                     xo_timer

EXCEPTIONS

OTHERS                      =  4.

CHECK sy-subrc                 EQ  0.

SET HANDLER xo_event->timer_finished FOR xo_timer.

xo_timer->interval              =  xv_interval.

xo_timer->run( ).

ENDMODULE.                 " CALL_TIMER  OUTPUT

Here the timer object is created, the event handler is set, the timer interval is set and the timer is started.

Definition of optional PAI module EXIT_DYNPRO:

*&———————————————————————*

*&  Include           LZMY_POPUPI01

*&———————————————————————*

*&———————————————————————*

*&      Module  EXIT_DYNPRO  INPUT

*&———————————————————————*

*       Leave Screen

*———————————————————————-*

MODULE exit_dynpro INPUT.

CASE  sy-ucomm.

WHEN  ‘ECAN’.

PERFORM                     exit_dynpro.

ENDCASE.

ENDMODULE.                 " EXIT_DYNPRO  INPUT

This module is optional, if you want to close the info screen manually, too.

Definition of FORM routine EXIT_DYNPRO:

*&———————————————————————*

*&  Include           LZMY_POPUPF01

*&———————————————————————*

*&———————————————————————*

*&      Form  EXIT_DYNPRO

*&———————————————————————*

*       Leave Screen

*———————————————————————-*

FORM exit_dynpro .

FREE                                xo_timer.

CLEAR                               xo_timer.

LEAVE                           TO  SCREEN 0.

ENDFORM.                    " EXIT_DYNPRO

And the Function Group ZMY_POPUP looks like::

*******************************************************************

*   System-defined Include-files.                                 *

*******************************************************************

INCLUDE lzmy_popuptop.                     " Global Data

INCLUDE lzmy_popupuxx.                     " Function Modules

*******************************************************************

*   User-defined Include-files (if necessary).                    *

*******************************************************************

INCLUDE lzmy_popupcli.                     " Class Implementation

INCLUDE lzmy_popupf01.                     " FORM Routines

INCLUDE lzmy_popupi01.                     " PAI-Modules

INCLUDE lzmy_popupo01.                     " PBO-Modules

Now the Function Group ZMY_POPUP and Function Module ZMY_POPUP_SHOW are complete.

Calling Function Module ZMY_POPUP_SHOW from report

After testing this function module in SE37, I added an asynchronous RFC call to my ALV Grid reports looking like

CALL FUNCTION ‘Z2V_POPUP_SHOW’

STARTING          NEW TASK  ‘POPUP’

EXPORTING

i_header_text          =  text-hdr

i_info_text1           =  text-in1

i_label_text           =  text-lbl

i_value_text           =  xv_text_val

i_info_text2           =  xv_text_in2

i_interval             =  xk_interval.

And the result looks like

The screen closes automatically and all could be fine, if there were no …

Further issues

发表评论
验证码: 点击我更换图片

注:网友评论仅供其表达个人看法,并不代表本站立场。

热门文章

  • 云存储_企业邮箱是怎么申请_便宜的
    <strong>云存储_企业邮箱是怎么申请_便宜的</strong>

    云存储_企业邮箱是怎么申请_便宜的

    雪花数据仓库中的端到端加密2016年4月13日作者:马丁·亨切尔彼得·波维尼克云数据安全,工程作者:马丁·亨切尔和彼得·波维尼克。保护客户数据是雪花...

  • 分布式数据库_八度网络云主机_便宜的
    <strong>分布式数据库_八度网络云主机_便宜的</strong>

    分布式数据库_八度网络云主机_便宜的

    在云数据库服务的世界里,对客户来说,没有什么比不间断地访问他们的数据更重要的了。在在线游戏和金融服务等交易率较高的行业,即使是最小的中断...

  • 数据库服务器_服务器带宽_哪家好
    <strong>数据库服务器_服务器带宽_哪家好</strong>

    数据库服务器_服务器带宽_哪家好

    图1。派特法是一家领先的油田服务公司派特法为能源客户锁定价值派特法设计、建造、运营和维护石油、天然气和可再生能源资产。公司致力于数字化转型...

  • MySQL数据库_不能用邮箱注册企业邮箱吗
    <strong>MySQL数据库_不能用邮箱注册企业邮箱吗</strong>

    MySQL数据库_不能用邮箱注册企业邮箱吗

    如今,企业被迫维护两种类型的分析系统:数据仓库和数据湖。数据仓库提供了有关业务健康状况的重要见解。数据湖可以发现客户、产品、员工和流程的...

  • 微软云_服务器售后_年度促销
    <strong>微软云_服务器售后_年度促销</strong>

    微软云_服务器售后_年度促销

    使用Azure的客户管理密钥进行数据加密2019年9月6日|3分钟读取作者:保卢斯雪花新闻,雪花科技2017年,雪花宣布使用AWS密钥管理服务(KMS)支持客户管理密...

云储存

更多 >
  • <strong>域名交易_如何租用云服务器_排行榜</strong>
    域名交易_如何租用云服务器_排行榜

    蒂姆·费里斯(Tim Ferriss)上个月在播客上发表了这一观点,他是《邪教》的作者,也是国际畅销书《每周4小时工作制》。我完全同意。在我2009年发表的关...

  • <strong>全站加速_云存储服务器哪个好_12月免费</strong>
    全站加速_云存储服务器哪个好_12月免费

    请注意这里的代码是简化的,以便初学者更好地理解。 对于那些只需要代码就可以走的人,这里是您所需要的一切。为了您的方便,我几乎评论了每一行...

云储存亚马逊云_数据库服务_速度快
云储存百度云_淘宝客网站建设_年度促销
云储存分布式存储_云服务器ecs_安全稳定
云储存香港带宽_监控视频服务器_三重好礼
云储存域名交易_阿里云的ecs_便宜的