主页 > 云服务器 > > 正文

虚拟主机_堡垒之夜服务器_多少钱

来源:胜利云 发布时间:2021-09-27 10:06 标签:虚拟主机堡垒少钱之夜服务器
浏览:

Debugging ABAP code in background processing is a common requirement. How developers usually approch this task is by coding time delay or dead loop to take control of the process in trx. SM50 and debug it. There is no easy and graceful way to activate or deactivate such "break-point" in production environment.

Checkpoint Group provide flexibilty and ease of activation and deactivation of break-points using trx. SAAB. For example, break-point can be activation per specific user and will not affect other users.

If you execute ABAP program online execution will stop at activated break-point.

The same break-point will not interrupt execution in background processing. There is a way to use the same Checkpint Group to interrupt ABAP processing in both dialog and background processing. What it takes is to code activatable break-point using ZCL_AAB=>BREAK_POINT custom class method.

ZCL_AAB=>BREAK_POINT method checks if activatable break-point exists (calling ZCL_AAB=>EXISTS method) and active (calling ZCL_AAB=>IS_BREAK_POINT_ACTIVE method). If break point exists and active then in dialog processing execution is interrupted using BREAK-POINT statement, othersize is background processing excution is delayed for 60 seconds (calling ZCL_AAB=>TIME_DELAY method).

class ZCL_AAB definition  public  final  create public .

*"* public components of class ZCL_AAB*"* do not include other source files here!!!public section.

class-methods BREAK_POINT    importing      !IV_AAB_ID type AAB_ID_NAME .protected section.*"* protected components of class ZCL_AAB*"* do not include other source files here!!!private section.*"* private components of class ZCL_AAB*"* do not include other source files here!!!

class-methods EXISTS    importing      !IV_AAB_ID type AAB_ID_NAME    returning      value(RT_EXISTS) type CHAR1 .  class-methods IS_BREAK_POINT_ACTIVE    importing      !IV_AAB_ID type AAB_ID_NAME    returning      value(RT_BREAK_POINT_IS_ACTIVE) type CHAR1 .  class-methods TIME_DELAY .ENDCLASS.

CLASS ZCL_AAB IMPLEMENTATION.

* —————————————————–+* | Static Public Method ZCL_AAB=>BREAK_POINT* +————————————————————–+* | [—>] IV_AAB_ID                      TYPE        AAB_ID_NAME* +—————————————————METHOD break_point.DATA: w_text TYPE string.

IF exists( iv_aab_id ) = SPACE.    CONCATENATE ‘Checkpoint Group’ iv_aab_id ‘does not exist’      INTO w_text SEPARATED BY SPACE.    MESSAGE w_text TYPE ‘I’.    EXIT.  ENDIF.

IF is_break_point_active( iv_aab_id ) = ‘X’.    IF cl_gui_alv_grid=>offline( ) IS INITIAL.*     Foreground      BREAK-POINT.    ELSE.*     Background      time_delay( ).    ENDIF.  ENDIF.

ENDMETHOD.

* —————————————————+* | Static Private Method ZCL_AAB=>EXISTS* +————————————————————-+* | [—>] IV_AAB_ID                      TYPE        AAB_ID_NAME* | [IS_BREAK_POINT_ACTIVE* +————————————————————-+* | [—>] IV_AAB_ID                      TYPE        AAB_ID_NAME* | [TIME_DELAY* +——————————————————-+* +——————————————–METHOD time_delay.DATA: w_time_curr TYPE tims,      w_time_end   TYPE tims.DATA: w_timestamp TYPE timestampl.

GET TIME STAMP FIELD w_timestamp.  CONVERT TIME STAMP w_timestamp TIME ZONE sy–zonlo  INTO TIME w_time_curr.  w_time_end = w_time_curr  + 60.  WHILE w_time_curr < w_time_end.    GET TIME STAMP FIELD w_timestamp.    CONVERT TIME STAMP w_timestamp TIME ZONE sy–zonlo    INTO TIME w_time_curr.  ENDWHILE.

ENDMETHOD.ENDCLASS.

Lets see it in action. First run the program in background and take over control of the program in trx. SM50

Then once in debugger session, interrupt WHILE loop setting W_TIME_CURR at least 60 seconds in the future. For simplicity just set it to 235959 and click on Return (F7) button

Press Return (F7) on next screen

Voilà you are in Z_DEMO program

Lets see how the break-point works in dialog processing. Run the program and execution is interrupted at BREAK-POINT statement, press Return (F7) button

Voilà you are in Z_DEMO program.

Good Post ... Thanks

Cheers,

Kripa Rangachari.

Hello,

I had a similar requirement recently and this is how I built it.

Create Check Point Group:

Create a local Activation variant for the Check Point Group created above by assigning the Check Point Group to this variant:

Now my Check Point Group looks like this:

Below is my application - I trigger the "Debug Delay" in method RUN( ).

REPORT zfi_bank_stmt_upload.

INCLUDE:

lbtchdef,

zfi_inc_bank_stmt_upload.

AT SELECTION-SCREEN OUTPUT.

lcl_application=>pbo( ).

AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_path.

lcl_application=>pai( ).

START-OF-SELECTION.

lcl_application=>run( ).

Below is the code for method RUN( ).

METHOD run.

* for foreground debug

BREAK-POINT ID z_cpg_fi_ebs_upload.

* to support background debug at the time of troubleshooting

lcl_application=>support_debug( ).

………….

...............

ENDMETHOD.

Below is the code for method SUPPORT_DEBUG( ).

METHOD support_debug.

assert( ).

TRY.

DATA(lt_settings) =

cl_aab_activation=>get_instance( )->read_settings(

EXPORTING

scope_range = VALUE #( ( sign     = |I|    option   = |EQ|

low-type = |ACID| low-name = lc_cp_group ) )

user_range  = VALUE #( ( sign     = |I|    option   = |EQ|

low      = sy-uname ) ) ).

IF lt_settings IS INITIAL.

RETURN.

ELSE.

CHECK line_exists( lt_settings[ mode-breakpoint = abap_true ] ).

WAIT UP TO 20 SECONDS.

ENDIF.

CATCH cx_aab_activationsettings                           ##NO_HANDLER.

ENDTRY.

ENDMETHOD.

METHOD assert.

BREAK-POINT ID z_cpg_fi_ebs_upload CONDITION sy-batch IS NOT INITIAL.

ENDMETHOD.

Cheers,

Sougata.

Hi Sougata,

thank you for sharing. Your code will work except for situation when checkpoint is activated globally for all users. You need to pass second entry in user_range parameter for empty user.

Regards, Uladzislau

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

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

热门文章

  • 云存储_企业邮箱是怎么申请_便宜的
    <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)支持客户管理密...

云储存

更多 >
  • 域名交易_oracle数据库课程_精选特惠
    域名交易_oracle数据库课程_精选特惠

    如果您计划将SAP系统导出到7.40版本或使用软件更新管理器(SUM)执行维护操作到7.40目标版本,我们最近发现了一个可能会影响您的问题。这个问题会影响...

  • 谷歌云_数据库数据导入_怎么买
    谷歌云_数据库数据导入_怎么买

    设计工作室用户: 我知道我们都不喜欢做调查,并且认为有足够的人来做。但在这种情况下,我注意到,为了在SAP BusinessObjects Design Studio上获得突破,我们...

云储存香港服务器_中超数据库_便宜的
云储存金山云_神盾局特工第二季百度云_优惠券
云储存MySQL数据库_一个好网站建设_高性价比
云储存京东云_优衣库百度云链接地址_限量秒杀
云储存网站空间_北京建设厅网站_好用