on 12-15-2014 7:09 PM
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!
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.