cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Get value of Attribute "CATEGORY" of BT120H_CPL

Former Member
0 Kudos
1,196

Hi All,

How we can pass a data from one UI component to another.

I have a Page with two UI components. Ui component "BTCATEGORIES" contains a drop down list "Category" with some values. and UI component "BT120H_CPL" contains a drop down called "Priority" with high medium low priorities. I would like to collect the category value from drop down of "BTCATEGORIES" and use it in do_prepare_output method of "BT120H_CPL, for some condition checking".

Is there any way we can do this....?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ricky,

I figured out that the Category value was getting determined and populated when all the CAT01, CAT02, CAT03 and CAT04 will be filled with values.

Hence My lv_category populated with the needed value.

Thanks for the help on this as ..

Ligin

Answers (2)

Answers (2)

former_member223320
Participant

Hi Ligin,

I have checked the screen in WebUI. The field CATEGORY is of BT120H_CPL. Please check the screenshot.

If you are talking about that field, then you can use the below code.

DATA: lr_entity_h TYPE REF TO cl_crm_bol_entity,
      lv_category TYPE crmt_activity_category.

lr_entity_h ?= me->typed_context->btadminh->collection_wrapper->get_current(  ).
lv_category = lr_entity_h->get_property_as_string( 'CATEGORY' ).

If you are talking about the fields which are under the section 'Categorization' as shown below, then let me know.

-Ricky.

Former Member
0 Kudos

Hi Ricky,

Yes I am looking for the category under processing data.

lr_entity_h ?= me->typed_context->btadminh->collection_wrapper->get_current( ). gave me an error

" is accessed in the current context under a different name"

so i wrote

lr_entity_cat ?= me->typed_context->btadminh->collection_wrapper->if_bol_bo_col~get_current( ).

but while loading the page it shows the below error !

  • Entry parameter of method CL_CRM_BOL_ENTITY->GET_PROPERTY contains value CATEGORY, which is not allowed"

Ligin.

former_member223320
Participant
0 Kudos

Ligin,

I have re-checked this now.. Your code is correct. I have tested this and I am able to see the code in debugger.

-Ricky.

Former Member
0 Kudos

Hi Ricky,

I have a correction to make. the attribute "Category" is there in my component but, in my page there is no field for category. The category is been determined by the program by the values selected by the user from the drop downs"

category :CAT01, catalog :CAT02, code group : CAT03 and code: CAT04. from UI component BTCATEGORIES, View: Category.

In this case I will not be able to extract the data as CATEGORY is not a drop down for me.

I would like to capture those values , from the drop downs category :CAT01, catalog :CAT02, code group : CAT03 and code: CAT04 of BTCATEGORIES ,to DO_PREPARE_OUT_PUT of BT120hCPL

Thanks | Ligin

former_member223320
Participant

Hi Ligin,

The component BTCATEGORIES is already integrated in BT120H_CPL. Try to access the component controller and then read relations of BTOrder/BTAdminH.

-Ricky.

Former Member
0 Kudos

Hi Ricky, Thnaks for your response once more.

i used the below code. But the category is only determined once the transaction is being saved. lv_category_old will be populated with value only on the display mode of a saved transaction. on the creation time , after selecting a value from the CATEGORY dropdown, lr_entity_h->get_property_as_string( 'CATEGORY' ) is not retrieving any value. Requirement is to determine the Category of the transaction, on creation time by reading the drop down value.or do you think is there any way to figure out the category of the transaction on creation time.?



lr_entity_h ?= me->typed_context->btadminh->collection_wrapper->if_bol_bo_col~get_current(  ).

       lr_coll = lr_entity_h->get_related_entities(

               iv_relation_name = 'BTHeaderActivityExt' ).  

       lr_entity_h = lr_coll->get_current( ).

       lv_category_old = lr_entity_h->get_property_as_string( 'CATEGORY' ).
former_member223320
Participant
0 Kudos

Ligin,


Can you show me the screenshot of that categories in WebUI?

-Ricky.