在SAP Cloud Platform ABAP编程环境里打印系统变量

119 阅读1分钟

代码:

class ZCL_HELLOWORLD definition
  public
  final
  create public .

public section.
interfaces if_http_service_extension.
protected section.
private section.
ENDCLASS.



CLASS ZCL_HELLOWORLD IMPLEMENTATION.


  METHOD if_http_service_extension~handle_request.
  DATA(system_date) = CL_ABAP_CONTEXT_INFO=>get_system_date( ).
  DATA: text type string.

  text = 'Hello World: ' && system_date.

  DATA(user_name) = CL_ABAP_CONTEXT_INFO=>get_user_formatted_name( ).

  text = text && '.' && user_name.

  response->set_text( text ).
  ENDMETHOD.
ENDCLASS.

输出:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":