Skip to Content
author's profile photo Former Member
Former Member

How to change the reason in a ICWC-followup-process with the copying-BAdI?

Hi all,

I want to use the followup- and docflow-functionality in ICWC to copy most of the information from one process to another.

I made the definition of a copying control in the customizing -> working with a new BAdI and the copying routine. Everything works fine so far: I can get/change the description in the BAdIs ORDERADM_H method or the ibase information REFOBJ method for examples.

The question is now how to get/change the reason of the process?

Working with the genil_model_browser the reason is located in BTOrderHeader->BTHeaderBOSSet->BTSubjectSet_F->BTSubject_A1. Where can I find the reason in the BAdI methods?

Thanks for your help.

Regards,

Benjamin

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 21, 2008 at 11:24 AM

    you can use fm 'CRM_ORDER_READ' to read reason:

    CALL FUNCTION 'CRM_ORDER_READ'

    EXPORTING

    it_header_guid = lt_header_guid_wrk

    IMPORTING

    et_service_os = lt_service_os_wrk

    .

    • get record

    READ TABLE lt_service_os_wrk INTO ls_service_os_wrk INDEX 1.

    • get Lead subject profile set

    READ TABLE ls_service_os_wrk-osset INTO ls_osset_wrk WITH KEY profile_type = 'L'.

    • reasons internal table: ls_osset_wrk-subject

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi

      Put a break point in crm_order_maintain to see what structures and fields you need to fill out. Then change the reason code in crm online, you will have all the data you need.

      Here is some code I used in the he badi order_save, method prepare.

      data:

      IV_REF_HANDLE TYPE CRMT_HANDLE,

      IV_REF_GUID TYPE CRMT_OBJECT_GUID,

      IV_REF_KIND TYPE CRMT_OBJECT_KIND,

      IS_SRV_OSSET_COM TYPE CRMT_SRV_OSSET_COM2,

      IT_SRV_REFOBJ_COM TYPE CRMT_SRV_REFOBJ_COMT,

      IT_SRV_SUBJECT_COM TYPE CRMT_SRV_SUBJECT_COMT,

      is_srv_subject_com type CRMT_SRV_SUBJECT_COM,

      ET_SRV_OSSET_COMT TYPE CRMT_SRV_OSSET_COMT,

      LT_SRV_OSSET_COMT TYPE CRMT_SRV_OSSET_COMT,

      ET_INPUT_FIELDS TYPE CRMT_INPUT_FIELD_TAB,

      ET_EXCEPTION TYPE CRMT_EXCEPTION_T,

      tab_osset type CRMT_SRV_OSSET_COMT1,

      wa_osset like line of tab_osset,

      wa_srv like line of ET_SRV_OSSET_COMT,

      new_srv type CRMT_SRV_OSSET_COMT,

      call_list_name type char50,

      query_text(80).

      ******************************************************************

      refresh: ET_INPUT_FIELDS,

      IT_SRV_SUBJECT_COM.

      clear: is_srv_subject_com,

      IS_SRV_OSSET_COM.

      IV_REF_KIND = 'A'.

      iv_ref_guid = iv_guid.

      IS_SRV_OSSET_COM-SUBJECT_PROFILE = 'Z00000002'.

      IS_SRV_OSSET_COM-PROFILE_TYPE = 'F'.

      is_srv_subject_com-ref_handle = '0000000002'.

      is_srv_subject_com-KATALOGART = 'A1'.

      is_srv_subject_com-CODEGRUPPE = 'Z0000002'.

      is_srv_subject_com-CODE = 'ZAA'.

      is_srv_subject_com-DEFQUANTITY = 0.

      is_srv_subject_com-MODE = 'A'.

      append is_srv_subject_com to IT_SRV_SUBJECT_COM.

      CALL FUNCTION 'CRM_SERVICE_OS_SET_DATA'

      EXPORTING

      IV_REF_GUID = iv_ref_guid

      IV_REF_KIND = 'A'

      IS_SRV_OSSET_COM = IS_SRV_OSSET_COM

      IT_SRV_SUBJECT_COM = IT_SRV_SUBJECT_COM

      IMPORTING

      ET_SRV_OSSET_COMT = et_srv_osset_comt

      EXCEPTIONS

      ERROR_OCCURRED = 1

      INVALID_GUID = 2

      NO_RECORD_EXIST = 3

      OTHERS = 4.

      IF SY-SUBRC <> 0.

      ENDIF.

      CALL FUNCTION 'CRM_SERVICE_OS_PUT_DATA'

      IMPORTING

      ET_SRV_OSSET_COM = et_srv_osset_comt

      ET_INPUT_FIELDS = ET_INPUT_FIELDS.

      read table LT_SRV_OSSET_COMT index 1 into wa_srv.

      if sy-subrc = 0.

      tab_osset[] = wa_SRV-osset[].

      endif.

      loop at ET_SRV_OSSET_COMT into wa_srv.

      append lines of tab_osset to wa_srv-osset.

      endloop.

      append wa_srv to new_srv.

      else.

      new_srv[] = LT_SRV_OSSET_COMT[].

      endif.

      CALL FUNCTION 'CRM_ORDER_MAINTAIN'

      EXPORTING

      IT_SERVICE_OS = new_srv

      IMPORTING

      ET_EXCEPTION = et_exception

      CHANGING

      CT_INPUT_FIELDS = ET_INPUT_FIELDS

      EXCEPTIONS

      ERROR_OCCURRED = 1

      DOCUMENT_LOCKED = 2

      NO_CHANGE_ALLOWED = 3

      NO_AUTHORITY = 4

      OTHERS = 5.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.