给data()临时变量进行test injection
Posted liyafei
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了给data()临时变量进行test injection相关的知识,希望对你有一定的参考价值。
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的主要内容,如果未能解决你的问题,请参考以下文章
jQuery $.get(url,data,callback,type) 返回值给全局变量赋值的问题