1

我想知道如何使用功能模块CRM_STATUS_READ。在表中crmd_orderadm_h有一个字段GUID,我想通过传递GUID给 FM来显示状态CRM_STATUS_READ

我不知道如何在这个 FM 中填写参数。

FORM create_output USING i_t_crmd_orderadm_h TYPE g_tt_orderadm_h
            CHANGING e_t_out             TYPE g_tt_out.
DATA: l_r_crmd_orderadm_h TYPE g_ty_orderadm_h,
    l_r_out             TYPE g_ty_out.
        .
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

LOOP AT i_t_crmd_orderadm_h INTO l_r_crmd_orderadm_h.
  CALL FUNCTION 'CRM_STATUS_READ'
    EXPORTING
*       CLIENT                 = SY-MANDT
        objnr                  = 
*       ONLY_ACTIVE            = ' '
*     IMPORTING
*       OBTYP                  =  
*       STSMA                  =
*       STONR                  =  
*       ET_JEST_BUF            =
*     TABLES
*       STATUS                 =
ENDFORM.

最好的问候, Huy Vu

4

1 回答 1

0

要调用此模块,您必须知道两件事:GUID 和片段 GUID。后者可以取自产品属性(表COMM_PCAT_REL)。

这是示例:

DATA(lv_guid) = get_guid_by_id( '11111111111' ).

DATA: lv_frg_guid TYPE comm_pr_frg_rod-fragment_type VALUE '37D58F1B772D53A4E10000009B38FA0B',
      rt_stat     TYPE ttjstat.

DATA: lv_objnr  TYPE comm_pr_frg_rod-status_object,
      lt_status TYPE STANDARD TABLE OF jstat.

SELECT SINGLE status_object FROM comm_pr_frg_rod 
  INTO lv_objnr WHERE product_guid = lv_guid AND fragment_type = lv_frg_guid.

CHECK sy-subrc = 0.

CALL FUNCTION 'CRM_STATUS_READ'
  EXPORTING
    objnr            = lv_objnr
  TABLES
    status           = rt_status
  EXCEPTIONS
    object_not_found = 1.
于 2021-09-28T10:25:27.667 回答