码迷,mamicode.com
首页 > 其他好文 > 详细

给data()临时变量进行test injection

时间:2019-10-18 12:43:26      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:res   rms   name   with   sea   test   port   get   abap   

1: 在代码中使用临时变量,接收返回值。

      TEST-SEAM get_service_team_name_by_id.
        CALL METHOD cl_crms4_orgman_helper=>get_service_team_detail
          EXPORTING
            iv_service_team_id      = cs_orgman_wrk-service_team_rm
            iv_check_authorizations = abap_false
          IMPORTING
            es_service_team_header  = DATA(ls_serv_team_hdr_with_name_id).
      END-TEST-SEAM.
es_service_team_header的type为 crms4s_service_team_header

2: 在test-injection中给该临时变量赋值, 

    TEST-INJECTION get_service_team_name_by_id.
      DATA ls_serv_team_hdr TYPE crms4s_service_team_header.
      ls_serv_team_hdr-respymgmtteamname = team_name2.
      ls_serv_team_hdr_with_name_id = ls_serv_team_hdr.
    END-TEST-INJECTION.

 

给data()临时变量进行test injection

标签:res   rms   name   with   sea   test   port   get   abap   

原文地址:https://www.cnblogs.com/liyafei/p/11697459.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!