cancel
Showing results for 
Search instead for 
Did you mean: 

Access To BTPARTNER/Partner From BT116H_SRVO/Details

Former Member
0 Kudos

Hi All,

I need your help with the following issue...

When I create a new order, I set SOLD_TO field and then the partners are autocomplete.

I must access to Partners information and then fill IBBASE field.

How I can access to BTPARTNER/Partner from DO_PREPARE_OUTPUT of BT116H_SRVO/Details?

Thanks and Regards!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nicol,

This can be accessed via custom controller present in BT116H_SRVO component.

Data: lr_cuco type ref to CL_BT_H_CUBTPARTNERCU,

         lr_entity type ref to cl_Crm_bol_entity.

lr_cuco ?=  get_custom_controller( 'BT116H_SRVO/CUBTPartnerCuCo' ).

then lr_cuco has all the partner context nodes which are having the content of BTPARTNER/Partner

lr_entity ?= lr_cuco->typed_Context->BTPARTNER->get_Current( ) will give you the partner entity where you can take the collection for all partner entities.

Regards,

Naresh

Answers (1)

Answers (1)

former_member210661
Active Contributor
0 Kudos

Hi Nicol,

sorry for the late reply..

just fallow the naresh instruction in that you will get partner collection..

if your not getting then go the relation method..

ex:

data : lr_entity TYPE REF TO CL_CRM_BOL_ENTITY.

constants: lc_foreign_rel type crmt_relation_name value 'BTIbase'

.

lr_entity ?= me->typed_context-> BTAdminH-> collection_wrapper->get_current( ).

if lr_entity is bound.

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

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

   lr_entity ?= lr_ent->get_related_entity( iv_relation_name = 'BTRefObjectSingle' ).

check lr_entity is bound.

try.

       lr_entity = lr_ent-> create_related_entity( iv_relation_name = lc_foreign_rel ).

     catch cx_crm_genil_model_error.

       return.

   endtry.

*      Generating Guid.

         CALL FUNCTION 'GUID_CREATE'

           IMPORTING

             ev_guid_16 = guid.

lr_entity->get_properties( IMPORTING es_attributes = lv_ibase  ). ( declare attr structue for ibase.)


fill your data into that sturcure.


lr_entity->set_properties( EXPORTING is_attributes = lv_ibase ).

lr_core->modify.

lr_tx lr_entity-> get_transaction( ).

IF lr_tx->save( ) = abap_true.

           lr_tx->commit( ).

         ELSE.

           lr_tx->rollback( ).

         ENDIF.


Try this and let me know..


Thanks & Regards,

Srinivas.