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

How can I sort the partner table (ICCMP_BTPARTNER/PartnerTable)?

Hi all,

we run a crm 5.0 system and are currently in a change of release to version 7.0. In 5.0 the sort order of the partner table within a serviceticket can be controlled by customizing (Customer Relationship Management -> Basic Functions -> Partner Processing -> Define Partner Determination Procedure -> User Interface Settings).

In 7.0 these settings seem to be ignored. The sortation is by the technical id of the partner function. Is there any new customizing for that? Or is there no sortation supported?

Same issue is within the dropdownlistbox of the partner functions in ICCMP_BTPARTNER/AddView. I want to sort the dropdownlistbox as well.

Thanks for your help.

Best regards.

Ben

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 11, 2010 at 12:58 PM

    Done.

    I realized it with two methods...

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

    CALLED in WD_CREATE_CONTEXT

    METHOD read_customzing_for_sortation.

    • Variablen

    DATA: lr_gdc TYPE REF TO if_crm_ui_data_context.

    DATA: lr_serviceticket TYPE REF TO if_bol_bo_property_access.

    DATA: lr_entity TYPE REF TO cl_crm_bol_entity.

    DATA: ls_ui_settings TYPE comc_partner_uis.

    DATA: lv_proc_type TYPE crmt_process_type.

    DATA: lv_det_proc TYPE comt_partner_determ_proc.

    DATA: lt_partner_fct TYPE TABLE OF crmc_partner_pdp.

    DATA: ls_partner_fct TYPE crmc_partner_pdp.

    • Daten zurücksetzen

    CLEAR: gt_partner_sort_cust.

    • Globalen Datenkontext ermitteln

    CLEAR: lr_gdc.

    TRY.

    lr_gdc ?= cl_crm_ui_data_context_srv=>get_instance( iv_controller = me ).

    CATCH cx_root.

    ENDTRY.

    CHECK lr_gdc IS BOUND.

    • Aktuelles Serviceticket ermitteln

    CLEAR: lr_serviceticket, lr_entity.

    CALL METHOD lr_gdc->get_entity

    EXPORTING

    name = if_iccmp_global_data_cont_con=>gdc_currentserviceticket

    RECEIVING

    value = lr_serviceticket.

    CHECK lr_serviceticket IS BOUND.

    lr_entity ?= lr_serviceticket.

    CHECK lr_entity IS BOUND.

    • Vorgangstyp ermitteln

    CLEAR: lv_proc_type.

    TRY.

    lr_entity = lr_entity->get_related_entity( 'BTOrderHeader' ).

    CHECK lr_entity IS BOUND.

    CALL METHOD lr_entity->get_property_as_value

    EXPORTING

    iv_attr_name = 'PROCESS_TYPE'

    IMPORTING

    ev_result = lv_proc_type.

    CATCH cx_root.

    ENDTRY.

    CHECK lv_proc_type IS NOT INITIAL.

    • Partnerschema ermitteln

    CLEAR: lv_det_proc.

    SELECT SINGLE part_determ_proc

    FROM crmc_proc_type

    INTO lv_det_proc

    WHERE process_type EQ lv_proc_type.

    CHECK lv_det_proc IS NOT initial.

    • Customizing für Partnerschema auslesen

    CLEAR: ls_ui_settings.

    SELECT SINGLE *

    FROM comc_partner_uis

    INTO ls_ui_settings

    WHERE determ_proc EQ lv_det_proc.

    • Partnerfunktionen in Sortierreihenfolge der Tabelle hinzufügen

    APPEND ls_ui_settings-header_fct_1 TO gt_partner_sort_cust.

    APPEND ls_ui_settings-header_fct_2 TO gt_partner_sort_cust.

    APPEND ls_ui_settings-header_fct_3 TO gt_partner_sort_cust.

    APPEND ls_ui_settings-header_fct_4 TO gt_partner_sort_cust.

    • Im Customizing können nur die ersten vier Partnerfunktionen angegeben werden, restliche Partnerfunktionen nachlesen

    CLEAR: lt_partner_fct.

    SELECT * FROM crmc_partner_pdp

    INTO TABLE lt_partner_fct

    WHERE determ_proc EQ lv_det_proc.

    • Partnerschema durchgehen und ggf. fehlende Partnerfunktionen hinzufügen

    LOOP AT lt_partner_fct INTO ls_partner_fct.

    READ TABLE gt_partner_sort_cust FROM ls_partner_fct-partner_fct TRANSPORTING NO FIELDS.

    IF sy-subrc NE 0.

    APPEND ls_partner_fct-partner_fct TO gt_partner_sort_cust.

    ENDIF.

    ENDLOOP.

    ENDMETHOD.

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

    and

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

    CALLED in DO_PREPARE_OUTPUT

    METHOD sort_partner_table.

    • Variablen

    DATA: lr_sorted_collection TYPE REF TO cl_bsp_wd_collection_wrapper.

    DATA: lr_entity TYPE REF TO cl_crm_bol_entity.

    DATA: ls_partner_sort_cust TYPE comt_partner_fct.

    DATA: lv_partner_fct TYPE crmt_partner_fct.

    • Daten zurücksetzen

    CLEAR: lr_entity, lr_sorted_collection.

    • Neue, sortierte Collection initialisieren

    CREATE OBJECT lr_sorted_collection.

    • Vor der Sortierung nach Customizing einmal nach Partnernummer sortieren, damit zweite Sortierung später korrekt ist

    me->typed_context->btpartner->collection_wrapper->sort( iv_attr_name = 'PARTNER_NO'

    iv_sort_order = if_bol_bo_col=>sort_ascending

    iv_stable = abap_true ).

    • Partner-Sortier-Customizing durchgehen

    LOOP AT gt_partner_sort_cust INTO ls_partner_sort_cust.

    • Partnertabelle durchgehen

    CLEAR: lr_entity.

    lr_entity ?= me->typed_context->btpartner->collection_wrapper->get_first( ).

    WHILE lr_entity IS BOUND.

    • Partnerfunktion ermitteln

    CALL METHOD lr_entity->get_property_as_value

    EXPORTING

    iv_attr_name = 'PARTNER_FCT'

    IMPORTING

    ev_result = lv_partner_fct.

    • Wenn Partnerfunktionen gleich, dann Entität in neue, sortierte Collection schreiben

    IF lv_partner_fct EQ ls_partner_sort_cust.

    lr_sorted_collection->add( lr_entity ).

    ENDIF.

    • Nächsten Eintrag

    lr_entity ?= me->typed_context->btpartner->collection_wrapper->get_next( ).

    ENDWHILE.

    ENDLOOP.

    • Neue, sortierte Collection an Stelle der alten Collection setzen

    me->typed_context->btpartner->collection_wrapper->clear( ).

    me->typed_context->btpartner->collection_wrapper->set_collection( lr_sorted_collection ).

    ENDMETHOD.

    Add a comment
    10|10000 characters needed characters exceeded

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.