Skip to Content
0

How to Get value of Attribute "CATEGORY" of BT120H_CPL

Mar 08 at 11:28 AM

48

avatar image
Former Member

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....?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Mar 15 at 11:44 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Ricky J Mar 09 at 05:11 AM
1

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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' ).
0

Ligin,


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

-Ricky.

0
Ricky J Mar 09 at 11:05 AM
1

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.


capture.jpg (20.7 kB)
capture.jpg (15.5 kB)
Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0

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.

capture.jpg (73.0 kB)
0
Former Member

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

0