cancel
Showing results for 
Search instead for 
Did you mean: 

populate obj type of BT through obj id

Former Member
0 Kudos

how to populate obj type of BT component throught its obj id by writing a report in se38

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kiran,

   For BTQuery1O the result node would be BTOrder which has crm Guid. So if u need object u need to get from Children (Get_related_entity).

 

Bol Relation is BTOrderHeader then u ll get BTAdminH it has ObjectType,

Eg code :

  Data :  ls_parameter     TYPE crmt_name_value_pair,
     lt_parameter     TYPE crmt_name_value_pair_tab,

     lr_query_service type ref to cl_crm_bol_query_service,

     lr_result type ref to if_bol_entity_col,

     lr_children type ref to cl_crm_bol_entity.


     ls_parameter-name  = 'OBJECT_ID'.                   
     ls_parameter-value =   '1105201'.
     CHECK NOT ls_parameter-value IS INITIAL.
     APPEND ls_parameter TO lt_parameter.

*   run query / search for last interactions
     lr_query_service->set_query_parameters( lt_parameter ).

  

lr_result ?=  lr_query_service->Get_query_result ()

lr_entity ?=  lr_result->get_first( ).

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

lv_obj_type = lr_children->get_property_as_value (Iv_attr_name = 'OBJ_TYPE')

Thanks & Regards,

Arunpandi                                                  

mrkarthi
Participant
0 Kudos

Hi,

The OBJECT_TYPE will be available in the BTQR1Order itself and you can use the iterator to read the input OBJECT_ID.

Regards,

Karthi M R.

Former Member
0 Kudos

Hi,

He is using BTQuery1O as query object (pls check above conversation). For this queryobject, result object is BTOrder which has guid and object type in BTAdminH

Thanks & Regards,

Arunpandi

mrkarthi
Participant
0 Kudos

Hi Kiran,

I suppose the object type could not be edited through report program as it is usually a read only field and it is populated based on the selected process type while creating the transaction.

Regards,

Karthi M R.

Former Member
0 Kudos

hi karthi

no need of editing, i am writing  a bol program in se38 to display obj type by passing obj id. so far, i have loaded the component BT and the query BTQuery1O also i have passed obj id. now suggest how to proceed.

thank you

mrkarthi
Participant
0 Kudos

Hi Kiran,

Pass the query parameters to the dynamic query "BTQ1Order". The query result will be a single entity or entity collection of the type "BTQR1Order ". In the result, you will find the object type.

Also, refer this link for sample BOL code.

Regards,

Karthi M R.

RaviTejaGuptha
Active Participant
0 Kudos

Hi Kiran,

By passing the Object ID to BTQ1Order, we can get the result in a collection.

If u can access the first entity , here u can get the Header GUID details.

Then by navigating through relations you can get the BTHeader/BTAdminH, which will contain the Object type details.

Correct me if my understanding is wrong about your requirement.

Regards,

Ravi