Skip to Content

Currently in CRM 5.0 ICWC, the partner selection is not
possible as in SAP GUI. The partner selection is done automatically for various
partner functions with the first partner in the selection list. This Weblog helps in enabling partner selection in ICWC as it is in SAP GUI.

The complete development is divided into

five

sections. Three sections are described in Part I and the remaining two are described in Part II.

Section 1: Call the new function module for the Partner Determination event

step 1

: The standard event function module called for
Partner Determination can be found in the Customizing event handler transaction
– CRMV_EVENT

image

The standard function module called is CRM_PARTNER_DETERM_INITIAL_EC
which will assign the first partner in the selection list to a particular
partner function. To prevent this, a new API has to be called instead of the
standard API for this event.

step 2

: Copy the standard function module CRM_PARTNER_DETERM_INITIAL_EC
to ZCRM_PARTNER_DETERM_INITIAL_EC in a new function group
ZCRM_PARTNER_DETERMINATION

step 3

: In the new function group add an attribute gv_flag
of type c

step 4

: In the new function module ZCRM_PARTNER_DETERM_INITIAL_EC,
after line


  STATICS: lv_recursion TYPE c VALUE space.

Add the following code and before ENDFUNCTION add ENDIF

. . .
. . .
. . .
ENDIF.
ENDFUNCTION.

step 5

: Add two new function modules to enable and disable the flag gv_flag

Function module 1: ZClear_Determination_flag

FUNCTION zclear_determination_flag.

*”—-


“Local Interface:

*”—-


gv_flag = true.

ENDFUNCTION.

and function module 2: Zfill_Determination_flag

FUNCTION zfill_determination_flag.

*”—-


“Local Interface:

*”—-


CLEAR gv_flag.

ENDFUNCTION.

step 6

:  Add the new function to the Object function CRM_PARTNER_DETERMINATION by clicking on the button
Object Function/Callback in the transaction CRMV_EVENT

!https://weblogs.sdn.sap.com/weblogs/images/49751/image002.jpg|height=79|alt=image|width=496|src=https://weblogs.sdn.sap.com/weblogs/images/49751/image002.jpg|border=0!

step 7

: Call the new function module ZCRM_PARTNER_DETERM_INITIAL_EC
for the event PROCEED_PARTNER_DETERMINATION in the transaction CRMV_EVENT

image

</p>

Section 2: Create a custom controller containing the Partner Determination Logic

step 1

: Create a custom controller ZCucoPartnerSelection.do

step 2

: Create a new controller class – ZCl_Cuco_partnerselection inheriting CL_BSP_WD_CUSTOM_CONTROLLER

step 3

: Create a protected local type TY_PARTNER_FCT

step 4

: Add the following attributes

Attribute

Level

Visibility

Type

Initial Value

GT_PARTNER_SELECTION_TAB

Static

Public

COMT_PARTNER_COMT

GT_SELECTED_PARTNER_LIST

Instance

Public

COMT_PARTNER_COMT

GT_PARTNER_FN_DESC

Instance

Public

COMT_PARTNER_DESCRIPTION_TAB

GV_OUTBOUND_PLUG

Instance

Public

STRING

PARTNER_SELECTION_VIEW

Constant

Public

STRING

‘ZPartnerSelection’

GT_DETERM_PROCEDURE

Instance

Private

COMT_PARTNER_DEADLOCK_PDP_TAB

GV_SELECTION_FLAG

Instance

Private

ABAP_BOOL

GV_PARTNER_GUID_SET

Instance

Private

CRMT_OBJECT_GUID

GV_PARTNER_CONTROL

Instance

Private

COMT_PARTNER_CONTROL

GT_SELECTED_PARTNERS_ALL

Instance

Private

COMT_PARTNER_COMT

GC_YES

Constant

Private

C

‘X’

GV_GUID

Instance

Private

CRMT_OBJECT_GUID

GV_COM_STRUCTURE

Instance

Private

STRING

GT_PARTNER_FUNC_TO_SKIP*

Instance

Private

* – GT_PARTNER_FUNC_TO_SKIP should be as below

DATA gt_partner_func_to_skip TYPE TABLE OF ty_partner_fct .

step 5

: Add a new interface – IF_CRM_IC_EVENT_LISTENER

step 6

: Add the following methods

h5. IF_CRM_IC_EVENT_LISTENER~HANDLE_EVENT

Parameter

Type

Typing Method

Associated Type

EVENT

Importing

Type ref

CL_CRM_IC_EVENT

get_name( ).

CASE lv_name.

  • general ic events

WHEN cl_crm_ic_interaction_manager=>event_interaction_ended.

     CALL METHOD clear_all.

     CALL FUNCTION ‘ZFILL_DETERMINATION_FLAG’.

WHEN if_crm_ic_events_con=>gc_bustransselected.

     CALL METHOD clear_all.

     CALL FUNCTION ‘ZCLEAR_DETERMINATION_FLAG’.

WHEN if_crm_ic_events_con=>gc_bpconfirmed.

     CALL FUNCTION ‘ZCLEAR_DETERMINATION_FLAG’.

ENDCASE.

ENDMETHOD.

h5. CONSTRUCTOR

constructor

    .

  • subscribe to events which should be handled by Interaction Record

  lr_ic_event_srv = cl_crm_ic_services=>get_event_srv_instance( ).

  lr_ic_event_srv->subscribe( event_name = if_crm_ic_events_con=>gc_bustransselected

                              listener   = me ).

  lr_ic_event_srv->subscribe( event_name = if_crm_ic_events_con=>gc_bpconfirmed

                              listener   = me

                              prio       = 0 ).

  • subscribe to events of interaction manager

  lr_ic_event_srv->subscribe( event_name = cl_crm_ic_interaction_manager=>event_interaction_ended

                              listener   = me ).

  • Get the description of partner functions

  CALL FUNCTION ‘COM_PARTNER_GET_DESCRIPTION_CB’

    IMPORTING

      et_fct_description = gt_partner_fn_desc.

ENDMETHOD.

h5. FILL_PARTNER_FUNCTIONS (Instance, Public)

Parameter

Type

Typing Method

Associated Type

METHOD fill_partner_functions.

  DATA:

          lv_partner_selection TYPE comt_partner_com,

          lt_fields            TYPE crmt_input_field_names_tab,

          lt_partner_com       TYPE crmt_partner_comt,

          lv_handle            TYPE numc4,

          lt_partner_selection TYPE comt_partner_comt,

          lt_partner_sel_tmp   TYPE comt_partner_comt,

          lt_input_fields      TYPE crmt_input_field_tab,

          lv_input_fields      TYPE crmt_input_field,

          lv_partner_com       TYPE comt_partner_com,

          lt_partner_wrk       TYPE crmt_partner_external_wrkt,

          lv_partner_wrk       TYPE crmt_partner_external_wrk,

          lv_fields            TYPE crmt_input_field_names,

          lv_delete            TYPE c,

          lv_partner_filled    TYPE c.

  DATA:

        lv_objid       TYPE actorid,

        lt_result_tab  TYPE TABLE OF swhactor,

        lv_result      TYPE swhactor,     

        lv_partner     TYPE bu_partner.

  CLEAR lv_partner_filled.

  lv_fields-fieldname = ‘DISPLAY_TYPE’.

  APPEND lv_fields TO lt_fields.

  lv_fields-fieldname = ‘NO_TYPE’.

  APPEND lv_fields TO lt_fields.

  lv_fields-fieldname = ‘PARTNER_FCT’.

  APPEND lv_fields TO lt_fields.

  lv_fields-fieldname = ‘PARTNER_NO’.

  APPEND lv_fields TO lt_fields.

  lv_fields-fieldname = ‘RELATION_PARTNER’.

  APPEND lv_fields TO lt_fields.

  lt_partner_selection = gt_selected_partner_list.

  lt_partner_sel_tmp = lt_partner_selection.

  DELETE ADJACENT DUPLICATES FROM lt_partner_sel_tmp COMPARING partner_fct.

  TRY.

      CALL FUNCTION ‘CRM_PARTNER_READ_OW’

        EXPORTING

          iv_ref_guid                        = gv_guid

          iv_ref_kind                        = ‘A’

       IMPORTING

         et_partner_wrk                     = lt_partner_wrk

  •               ES_PARTNER_WRK                     =

  •               ES_MORE_THAN_ONE_MAINPARTNER       =

       EXCEPTIONS

         error_occurred                     = 1

         parameter_error                    = 2

         entry_does_not_exist               = 3

         OTHERS                             = 4

                .

      IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

  •        ENDIF.

  •      ENDIF.

      IF NOT lt_partner_wrk IS INITIAL.

        lv_partner_filled = gc_yes.

        LOOP AT lt_partner_sel_tmp INTO lv_partner_selection.

          DELETE lt_partner_wrk WHERE partner_fct = lv_partner_selection-partner_fct.

          IF sy-subrc = 0.

            lv_delete = gc_yes.

          ENDIF.

        ENDLOOP.

      ENDIF.

      IF NOT lv_delete IS INITIAL.

        CALL FUNCTION ‘CRM_PARTNER_DELETE_OB’

          EXPORTING

            iv_ref_guid          = gv_guid

            iv_ref_kind          = ‘A’

          EXCEPTIONS

            entry_does_not_exist = 1

            parameter_error      = 2

            error_occurred       = 3

            OTHERS               = 4.

        IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

        ENDIF.

        LOOP AT lt_partner_wrk INTO lv_partner_wrk.

          MOVE-CORRESPONDING lv_partner_wrk TO lv_partner_selection.

          INSERT lv_partner_selection INTO TABLE lt_partner_selection.

        ENDLOOP.

      ENDIF.

      LOOP AT lt_partner_selection INTO lv_partner_selection.

  •        CHECK lv_partner_selection-partner_fct <> ‘00000014’.

        CLEAR lv_partner_com.

        CLEAR lv_partner.

        CLEAR lv_input_fields.

        IF NOT lv_partner_filled IS INITIAL.

          lv_partner_com-ref_guid = gv_guid.

        ENDIF.

  •       Get BP number of user

        IF lv_partner_selection-partner_no = sy-uname.

          lv_partner = sy-uname.

          lv_objid = sy-uname.

          CALL FUNCTION ‘RH_STRUC_GET’

            EXPORTING

              act_otype      = ‘US’

              act_objid      = lv_objid

              act_wegid      = ‘US_BP’

              act_begda      = sy-datum

              act_endda      = sy-datum

              act_tdepth     = 0

              act_tflag      = ‘X’

              act_vflag      = ‘X’

            TABLES

              result_tab     = lt_result_tab

            EXCEPTIONS

              no_plvar_found = 1

              no_entry_found = 2

              OTHERS         = 3.

          IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

          ENDIF.

          READ TABLE lt_result_tab INTO lv_result

            WITH KEY otype = ‘BP’.

          CHECK sy-subrc = 0.

          lv_partner = lv_result-objid.

        ELSE.

          lv_partner = lv_partner_selection-partner_no.

        ENDIF.

        lv_partner_com-ref_kind = ‘A’.

        lv_partner_com-ref_handle = lv_handle.

        lv_partner_com-display_type = ‘BP’.

        lv_partner_com-no_type = ‘BP’.

        lv_partner_com-partner_fct = lv_partner_selection-partner_fct.

        lv_partner_com-partner_no = lv_partner.

  •        lv_partner_com-relation_partner = lv_partner_guid.

        INSERT lv_partner_com INTO TABLE lt_partner_com.

        MOVE-CORRESPONDING lv_partner_com TO lv_input_fields.

        lv_input_fields-objectname = ‘PARTNER’.

        lv_input_fields-field_names = lt_fields.

        lv_input_fields-logical_key = ‘0000’.

        APPEND lv_input_fields TO lt_input_fields.

        lv_handle = lv_handle + 1.

      ENDLOOP.

  •     Clear flag to run patner determination procedure

      CALL FUNCTION ‘ZFILL_DETERMINATION_FLAG’.

      CALL FUNCTION ‘CRM_ORDER_MAINTAIN’

       EXPORTING

         it_partner                    = lt_partner_com

       CHANGING

         ct_input_fields              = lt_input_fields

  •       IMPORTING

  •         ET_EXCEPTION                  =

       EXCEPTIONS

         error_occurred                = 1

         document_locked               = 2

         no_change_allowed             = 3

         no_authority                  = 4

         OTHERS                        = 5

                .

      IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

    CATCH cx_root.

  ENDTRY.

  CALL FUNCTION ‘Z_12S_IC_CLEAR_DETERM_FLAG’.

  CLEAR gt_partner_selection_tab.

  CLEAR gt_selected_partner_list.

  INSERT lines of lt_partner_sel_tmp INTO TABLE gt_selected_partners_all.

ENDMETHOD.

h5. GET_PARTNER_FUNCTIONS (Instance, Public)

Parameter

Type

Typing Method

Associated Type

EV_PARTNER_VIEW_NOT_REQUIRED

Exporting

Type

C

0.

        lv_partner_control = gv_partner_control.

        CALL FUNCTION ‘COM_PARTNER_DETERM_STEP_ONE_OW’

          EXPORTING

            iv_partnerset_guid                   = gv_partner_guid_set

  •             IV_PREDECESSOR_PARTNERSET_GUID       =

            is_partner_control                   = lv_partner_control

            is_bp_access_structure               = gv_com_structure

            is_determination_step                = lv_determ_procedure

         IMPORTING

           et_found_partner_com                 = lt_partner_comt

  •             ET_FOUND_INPUT_FIELDS                =

  •             ET_FOUND_ATTRIBUTES                  =

         EXCEPTIONS

           parameter_error                      = 1

           partnerset_not_found                 = 2

           pred_partnerset_not_fou              = 3

           OTHERS                               = 4

                  .

        IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

        ENDIF.

        DESCRIBE TABLE lt_partner_comt LINES ln_lines.

        IF NOT lv_determ_procedure-changeable IS INITIAL.

          IF ln_lines > 0.

            IF ln_lines > lv_determ_procedure-count_high.

  •           Duplicate records should not be entered

              READ TABLE lt_partner_comt INTO lv_partner_com INDEX 1.

              DELETE gt_partner_selection_tab WHERE partner_fct = lv_partner_com-partner_fct.

              IF lv_determ_procedure-count_low = 0.

                lv_partner_func_to_skip-partner_fct = lv_determ_procedure-partner_fct.

                APPEND lv_partner_func_to_skip TO gt_partner_func_to_skip.

              ENDIF.

              LOOP AT lt_partner_comt INTO lv_partner_com.

                INSERT lv_partner_com INTO TABLE gt_partner_selection_tab.

              ENDLOOP.

            ELSE.

              LOOP AT lt_partner_comt INTO lv_partner_com.

                lv_selected_partner_list-partner_no = lv_partner_com-partner_no.

                lv_selected_partner_list-partner_fct = lv_partner_com-partner_fct.

                INSERT lv_selected_partner_list  INTO TABLE gt_selected_partner_list.

              ENDLOOP.

            ENDIF.

          ENDIF.

        ENDIF.

      ELSE.

        lv_partner_func_to_skip-partner_fct = lv_determ_procedure-partner_fct.

        APPEND lv_partner_func_to_skip TO gt_partner_func_to_skip.

      ENDIF.

    ENDLOOP.

  ENDIF.

  IF gt_partner_selection_tab IS INITIAL.

    IF NOT gt_selected_partner_list IS INITIAL.

      CALL METHOD me->fill_partner_functions.

    ENDIF.

    CALL METHOD me->set_selection_flag

      EXPORTING

        iv_flag = gc_yes.

    ev_partner_view_not_required = ‘X’.

  ENDIF.

ENDMETHOD.

METHOD check_partner_functions.

  DATA:  lt_partner_selection TYPE comt_partner_comt,

         lt_partner_sel_tmp   TYPE comt_partner_comt,

         lv_determ_procedure  TYPE comt_partner_deadlock_pdp,

         ln_count             TYPE int2,

         lv_no_check          TYPE c.

  lt_partner_selection = gt_selected_partner_list.

  lt_partner_sel_tmp = lt_partner_selection.

  DELETE ADJACENT DUPLICATES FROM lt_partner_sel_tmp COMPARING partner_fct.

    •       Check

  LOOP AT gt_determ_procedure INTO lv_determ_procedure.

    CLEAR ln_count.

    READ TABLE lt_partner_sel_tmp TRANSPORTING NO FIELDS

      WITH KEY partner_fct = lv_determ_procedure-partner_fct.

    CHECK sy-subrc = 0.

    LOOP AT gt_selected_partner_list TRANSPORTING NO FIELDS

      WHERE partner_fct = lv_determ_procedure-partner_fct.

      ln_count = ln_count + 1.

    ENDLOOP.

    IF lv_determ_procedure-count_high IS INITIAL.

      IF lv_determ_procedure-count_low IS INITIAL.

        lv_no_check = gc_yes.

      ELSE.

        lv_determ_procedure-count_high = lv_determ_procedure-count_low.

      ENDIF.

    ELSE.

      IF lv_determ_procedure-count_low IS INITIAL.

        lv_determ_procedure-count_low = 0.

      ENDIF.

    ENDIF.

    IF lv_no_check IS INITIAL.

      IF lv_determ_procedure-count_low > ln_count

        OR lv_determ_procedure-count_high  0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      MOVE-CORRESPONDING lv_partner_ctrl TO gv_partner_control.

      lv_determ_proc = gv_partner_control-determ_proc.

      CALL FUNCTION ‘COM_PARTNER_DEADLOCK_CHECK_CB’

        EXPORTING

          iv_determ_proc                   = lv_determ_proc

  •   IV_REFRESH_BUFFER                = ‘ ‘

         is_partner_control               = gv_partner_control

  •   IV_REFRESH_DETERM                = ‘ ‘

       IMPORTING

  •   ET_SYMSG                         =

         et_determination_path            = gt_determ_procedure

       EXCEPTIONS

         deadlock_found                   = 1

         determ_procedure_not_found       = 2

         access_sequence_not_found        = 3

         partner_function_not_found       = 4

         OTHERS                           = 5

                .

      IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      CALL FUNCTION ‘CRM_LINK_GET_OW’

        EXPORTING

          iv_guid_hi                     = gv_guid

         iv_objname_hi                  = ‘ORDERADM_H’

         iv_objname_set                 = ‘PARTNER’

  •           IV_GET_ALL                     =

         iv_inherit_from_str            = ‘X’

       IMPORTING

         et_link                        = lt_link

       EXCEPTIONS

         invalid_input_data             = 1

         no_allocated_obj_found         = 2

         undefined_internal_error       = 3

         OTHERS                         = 4

                .

      IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  •         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      READ TABLE lt_link INTO lv_link INDEX 1.

      gv_partner_guid_set = lv_link-guid_set.

  •      ENDIF.

    CATCH  cx_root.

      CLEAR gv_partner_guid_set.

      CLEAR gt_determ_procedure.

      CLEAR gv_partner_control.

      MESSAGE i000(r1) RAISING add_error.

  ENDTRY.

ENDMETHOD.

h5. CLEAR_ALL (Instance, Private)

Section 3: Create a Simple object to hold the values of Partner selection list in IMG

step 1

: Create a structure ZPARTNERSELECTION_STR with the following fields

Field Name

Type

PARTNER_NO

CRMT_PARTNER_NO

SELECT_FLAG

CHAR1

PARTNER_FCT

CRMT_PARTNER_FCT

PARTNERFUNCTIONDESCR

TEXT30

FULLNAME

BU_NAME1TX

step 2

: Create a class ZCL_PARTNERSELECTION_SO implementing
interface IF_GENIL_SO_HANDLER2

Add the following attributes

Attribute

Level

Visibility

Type

Initial Value

GT_PARTNER_FN_DESC

Instance

Private

COMT_PARTNER_DESCRIPTION_TAB

GT_PARTNERS_LIST*

Instance

Private

Create GT_PARTNERS_LIST as shown below

step 3

: Implement the method IF_GENIL_SO_HANDLER2~GET_LIST

METHOD if_genil_so_handler2~get_list.

  DATA: lv_partner_list TYPE zpartnerselection_str,

      lv_partnerselection type COMT_PARTNER_COM.

  DATA: ls_person TYPE bapibus1006_central_person,

        ls_org    TYPE bapibus1006_central_organ,

        ls_group  TYPE bapibus1006_central_group.

  DATA: lv_partnerfunc TYPE COMT_PARTNER_DESCRIPTION.

  • Add items found to simple object data container

  •   and buffer items found additionally

  DATA: lv_key        TYPE crmt_partner_no,

        lv_genil_key  TYPE crmt_genil_object_id,

        lr_so         TYPE REF TO if_genil_cont_simple_object,

        lv_attr       TYPE        zpartnerselection_str,

        lr_attr_props TYPE REF TO if_genil_obj_attr_properties.

If gt_partner_fn_desc is initial.

  • Get the description of partner functions

  CALL FUNCTION ‘COM_PARTNER_GET_DESCRIPTION_CB’

    IMPORTING

      et_fct_description = gt_partner_fn_desc.

Endif.

Loop at zcl_cuco_partnerselection=>gt_partner_selection_tab INTO lv_partnerselection.

Lv_partner_list-partner_no = lv_partnerselection-partner_no.

Lv_partner_list-partner_fct = lv_partnerselection-partner_fct.

  CALL FUNCTION ‘BUPA_CENTRAL_GET_DETAIL’

    EXPORTING

      iv_partner     = lv_partner_list-partner_no

    IMPORTING

      es_data_person = ls_person

      es_data_organ  = ls_org

      es_data_group  = ls_group.

  IF NOT ls_person IS INITIAL.

    Lv_partner_list-fullname = ls_person-fullname.

  ELSEIF NOT ls_org IS INITIAL.

    Lv_partner_list-fullname = ls_org-name1.

  ELSE.

    Lv_partner_list-fullname = ls_group-namegroup1.

  ENDIF.

READ TABLE gt_partner_fn_desc INTO lv_partnerfunc

               WITH KEY partner_fct = lv_partner_list-partner_fct.

IF sy-subrc = 0.

   Lv_partner_list-partnerfunctiondescr = lv_partnerfunc-description.

ENDIF.

APPEND lv_partner_list TO gt_partners_list.

ENDLOOP.

 

IF gt_partners_list IS NOT INITIAL.

    LOOP AT gt_partners_list INTO lv_partner_list.

      lv_key = lv_partner_list-partner_no.

      lv_genil_key = cl_crm_genil_container_tools=>build_object_id( lv_key ).

      lr_so = iv_simple_obj_list->add_object( lv_genil_key ).

  •     Fill GENIL container

      MOVE-CORRESPONDING lv_partner_list TO lv_attr.

      lr_so->set_attributes( lv_attr ).

      lr_attr_props = lr_so->get_attr_props_obj( ).

      CALL METHOD lr_attr_props->set_all_properties

        EXPORTING

          iv_value = if_genil_obj_attr_properties=>read_only.

    ENDLOOP.

  ENDIF.

ENDMETHOD.

step 4

: Implement the method IF_GENIL_SO_HANDLER2~GET_DETAIL

METHOD if_genil_so_handler2~get_detail.

  • This methods gets detail information for a SAPOffice document

  • either for a list of keys or a single object

  • Access requested objects key by key

  DATA:

        lv_partner TYPE crmt_partner_no,

        lr_so         TYPE REF TO if_genil_cont_simple_object,

        lv_attr       TYPE zpartnerselection_str,

        lr_attr_props TYPE REF TO if_genil_obj_attr_properties.

  DATA: lv_partner_list TYPE zpartnerselection_str.

  lr_so = iv_simple_obj_list->get_first( ).

  WHILE lr_so IS BOUND.

  •   Get key of requested object

    CALL METHOD lr_so->get_key

      IMPORTING

        es_key = lv_partner.

  •   Read its attributes

    IF lv_partner IS NOT INITIAL.

  •     Try to load object from buffer

      READ TABLE gt_partners_list INTO lv_partner_list

        WITH KEY partner_no = lv_partner_list.

  •     Fill GENIL container

      MOVE-CORRESPONDING lv_partner_list TO lv_attr.

      lr_so->set_attributes( lv_attr ).

      lr_attr_props = lr_so->get_attr_props_obj( ).

      CALL METHOD lr_attr_props->set_all_properties

        EXPORTING

          iv_value = if_genil_obj_attr_properties=>read_only.

    ENDIF.

  •   Next one, please

    lr_so = iv_simple_obj_list->get_next( ).

  ENDWHILE.

ENDMETHOD.

step 5

: Define Simple Object in IMG

!https://weblogs.sdn.sap.com/weblogs/images/49751/image003.jpg|height=309|alt=image|width=406|src=https://weblogs.sdn.sap.com/weblogs/images/49751/image003.jpg|border=0!

step 6

: Add the implementation class and the structure as
shown below

!https://weblogs.sdn.sap.com/weblogs/images/49751/image004.jpg|height=81|alt=image|width=556|src=https://weblogs.sdn.sap.com/weblogs/images/49751/image004.jpg|border=0!

step 7

: Add a Search object ZPartnerSelectionQuery

!https://weblogs.sdn.sap.com/weblogs/images/49751/image005.jpg|height=134|alt=image|width=556|src=https://weblogs.sdn.sap.com/weblogs/images/49751/image005.jpg|border=0!

Note:- Further continued in Part II

To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Jayasri Roy
    Hi Raja,

    We are in the middle of upgrading CRM to 5.0 and R/3 to ECC 6.0. Currently we bring over the CUSTOMER and PARTNER objects from R/3 to CRM. I am trying to find out the impact and side effects of ECC 6.0 upgrade on CRM 5.0. Can you help me figure out what changes I need to consider on the CRM side from the configuration as well as ABAP standpoint in order to make these two modules compatible.  Also I need to know how much changes will be required for the adapter objects in the Middleware for CUSTOMER and PARTNER.  Any help you can provide will be greatly appreciated.

    Thanks and regards,
    Jayasri Roy

    (0) 
    1. Raja G Post author
      Hi Jayasri,

      It is a different topic from what is discussed here. Please look into Service market place for any information on the topic.

      Regards
      G.Raja

      (0) 
  2. Sampath Kumar
    Hi Raja,

    Nice article. I have downloaded CRM ICWC cookbook from marketplace. But, i am having some difficulty in working it out in CRM system.

    Could you please share your email id for the same.

    thanks
    Kumar

    (0) 

Leave a Reply