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

How do I get the instance of a serviceticket in ICCMP_BTPARTNER?!

Hi all,

I want to find out which instance/ibase is currently set in a serviceticket. I am in the component "ICCMP_BTPARTNER" in the view "PARTNERTABLE".

I thought I might get the instance of the serviceticket in the global data context in GDC_CURRENTIBASE or GDC_CURRENTSERVICETICKET. But the CURRENTIBASE is initial and in SERVICETICKET the only information I get is the CRM_GUID.

I tried something like this...

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.

CALL METHOD lr_gdc->get_entity

EXPORTING

name = if_iccmp_global_data_cont_con=>gdc_currentibase

RECEIVING

value = lr_serviceticket.

CHECK lr_ibase IS BOUND.

So, does anyone know how to get the current instance of a serviceticket in any other components view (here ICCMP_BTPARTNER/PartnerTable)?

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 08, 2010 at 07:59 AM

    Done.

    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: lv_instance TYPE ib_instance.

    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.

    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.

    CLEAR: lr_entity.

    lr_entity ?= lr_serviceticket.

    CHECK lr_entity IS BOUND.

    CLEAR: lv_instance.

    TRY.

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

    CHECK lr_entity IS BOUND.

    lr_entity = lr_entity->get_related_entity( iv_relation_name = 'BTHeaderBOSSet' ).

    CHECK lr_entity IS BOUND.

    lr_entity = lr_entity->get_related_entity( iv_relation_name = 'BTRefObjSet_A' ).

    CHECK lr_entity IS BOUND.

    lr_entity = lr_entity->get_related_entity( iv_relation_name = 'BTRefObjectComponentsAll' ).

    CHECK lr_entity IS BOUND.

    lv_instance = lr_entity->if_bol_bo_property_access~get_property_as_string( 'IB_INSTANCE' ).

    CATCH cx_crm_genil_model_error cx_root.

    ENDTRY.

    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.