ITPub博客

首页 > 应用开发 > IT综合 > SAP CRM附件创建的internal模式是什么含义

SAP CRM附件创建的internal模式是什么含义

原创 IT综合 作者:i042416 时间:2020-08-17 10:52:10 0 删除 编辑

When I am creating attachment for my business object via code provided in solution:

ls_prop-name = 'DESCRIPTION'.
  ls_prop-value = 'created by Tool'.
  APPEND ls_prop TO lt_prop.
  ls_prop-name = 'CREATED_BY'.
  ls_prop-value = XXX - some one else other than sy-uname
  APPEND ls_prop TO lt_prop.
  CALL METHOD cl_crm_documents=>create_with_table
      EXPORTING
        business_object     = ls_bo
        properties          = lt_pro
        properties_attr     = lt_properties_attr
        file_access_info    = lt_file_info
        file_content_binary = lt_file_content
        raw_mode            = 'X'
      IMPORTING
        loio                = ls_loio
        phio                = ls_phio
        error               = ls_error.

I meet with the error below: Characteristic of class CRM_L_DOC is not valid



I debugged a little and found it is caused because the content management code regards “CREATED_BY” field as read only ( protected field ) if internal mode is inactive.



I use where use list on the field internal_mode and found the FM below could activate internal mode with 02 passed into.



After I call that FM in my program, the error is gone and attachment could be created. Unfortunately, I still could not specify the created_by field, I find it is always filled as sy-uname in line 298.



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


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24475491/viewspace-2712200/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
SAP成都研究院开发专家,SAP社区导师,SAP中国技术大使。

注册时间:2018-01-20

  • 博文量
    1914
  • 访问量
    882474