Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9680

Re: Unable to get the main partner from BT order

$
0
0

Below is the screen shot of the required field

 

san2.jpg

 

Sorry Vinod and Praveen,

 

Tried using the same steps..

 

Pls find the code :

 

lr_core = cl_crm_bol_core=>get_instance( ).
lr_core
->load_component_set( '4S' ).

lv_dyn_query
= cl_crm_bol_dquery_service=>get_instance(
'BTQ1Order' ).

lv_dyn_query
->add_selection_param(
EXPORTING
iv_attr_name
'BU_PARTNER'   " Component name
iv_sign     
'I'   " Inclusion/exclusion criterion SIGN for range tables
iv_option   
'EQ'   " Selection operator OPTION for range tables
iv_low      
'4040050694'
iv_high     
''
).

* Execute the query and receive result

lv_result
= lv_dyn_query->get_query_result( ).

* Use iterator to access entities in query result
lv_iterator
= lv_result->get_iterator( ).
lv_entity
= lv_iterator->get_first( ). "“Entity is UIFFlight

 

  1. TRY.
    lr_order
    lv_entity->get_related_entity( iv_relation_name =   'BTADVS1Ord' ).
    CATCH cx_crm_genil_model_error.    " Error when Accessing Object Model
    ENDTRY.


    TRY.
    lr_adminh
    lr_order->get_related_entity( iv_relation_name =   'BTOrderHeader' ).
    CATCH cx_crm_genil_model_error.    " Error when Accessing Object Model
    ENDTRY.

    IF lr_adminh IS BOUND.

    lr_adminh
    ->get_related_entity(
    EXPORTING
    iv_relation_name
    'BTHeaderPartnerSet' " Relation Name
    *      iv_mode          = NORMAL    " Read mode
    RECEIVING
    rv_result       
    =   lr_entity  " Entity
    ).
    *    CATCH cx_crm_genil_model_error.    " Error when Accessing Object Model

    IF lr_entity IS  BOUND.
    lr_entity
    ->get_related_entities(
    EXPORTING
    iv_relation_name
    = 'BTPartner_00000001_MAIN' " Relation Name
    *        iv_child_name    =     " Concrete Object Type (in Abstract Relations)
    *        iv_mode          = NORMAL    " Read Mode
    *        iv_owned_only    = ABAP_FALSE    " No Associated Entities
    RECEIVING
    rv_result       
    =    coll   " Entity collection
    ).
    *      CATCH cx_crm_genil_model_error.    " Error when Accessing Object Model

    current
    = coll->get_current( ).
    IF current IS BOUND.
    current
    ->get_property_as_string(
    EXPORTING
    iv_attr_name     
    = 'MAINPARTNER'    " Component Name
    *              iv_use_iso_format = ABAP_FALSE
    RECEIVING
    rv_result        
    = lv_string
    ).


    ENDIF.
    ENDIF.

 

san1.jpg

 

 

 

If you observe the aabove screen shot, you get zero entities in collection ( COLL )

 

Pls help !


Viewing all articles
Browse latest Browse all 9680

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>