SAP CRM Product Interlinkage - Customer Product ID的一个例子

in 网站建设
关注公众号【好便宜】( ID:haopianyi222 ),领红包啦~
阿里云,国内最大的云服务商,注册就送数千元优惠券:https://t.cn/AiQe5A0g
腾讯云,良心云,价格优惠: https://t.cn/AieHwwKl
搬瓦工,CN2 GIA 优质线路,搭梯子、海外建站推荐: https://t.cn/AieHwfX9

For detail technical introduction about relationship, please refer to this wiki.
The relationship transaction data is maintained in assignment block below:

clipboard1

The data could be read from function module below:

clipboard2

Result stored in this component:

clipboard3

It contains interlinkage guid, source object guid and target guid.
Source guid: FA163EE56C3A1EE69C9B0D4E88D25F12
This guid points to the product:

clipboard4

Target guid: FA163EEF573D1EE4BB948D01BE952F51
This guid points to the customer maintained as relationship target in WebUI:
clipboard5

See the following code about how to read the data of relationship PRDCPN of a given product:

  METHOD get_rel_data_by_type.
    DATA: lr_il_data     TYPE REF TO data,
          lt_link_idents TYPE comt_il_ident_tab,
          lt_message     TYPE comt_il_error_tab.

    FIELD-SYMBOLS: <il_data_tab> TYPE ANY TABLE.
    DATA(lv_prod_guid) = get_guid_by_id( iv_prod_id ).

    DATA(ls_rel_meta) = get_rel_meta_data_by_type( iv_rel_type ).

    TRY.
        CREATE DATA lr_il_data
                       TYPE (ls_rel_meta-data_reltype_tab).
      CATCH cx_sy_create_data_error.
        RETURN.
    ENDTRY.
    ASSIGN lr_il_data->* TO <il_data_tab>.

    DATA(ls_il_ident) = VALUE comt_il_ident( sourceguid = lv_prod_guid ).
    APPEND ls_il_ident TO lt_link_idents.
    CALL FUNCTION 'COM_IL_API_READ'
      EXPORTING
        iv_reltype          = iv_rel_type
        it_link_idents      = lt_link_idents
      IMPORTING
        et_interlinkage_all = <il_data_tab>
        et_messages         = lt_message
      EXCEPTIONS
        lock_failed         = 1
        OTHERS              = 2.

    et_data = <il_data_tab>.
  ENDMETHOD.

Input:

clipboard6

Output:

clipboard7

From the code we can know the fact: unlike product settype design, for each product relationship, there is no dedicated read function module designed, but still each relationship has each own persistence table. The relationship data is generically read out via function module COM_IL_API_READ.

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

关注公众号【好便宜】( ID:haopianyi222 ),领红包啦~
阿里云,国内最大的云服务商,注册就送数千元优惠券:https://t.cn/AiQe5A0g
腾讯云,良心云,价格优惠: https://t.cn/AieHwwKl
搬瓦工,CN2 GIA 优质线路,搭梯子、海外建站推荐: https://t.cn/AieHwfX9
扫一扫关注公众号添加购物返利助手,领红包
Comments are closed.

推荐使用阿里云服务器

超多优惠券

服务器最低一折,一年不到100!

朕已阅去看看