Skip to Content
0

How can I read the parameters of current Account in WebUI

Oct 04, 2017 at 09:41 AM

49

avatar image

Dear All,
Hope you are fine,
I am new in webUI and I have a basic question.
Actually I am going to read the value of current AccountID (BP_Number) in debug of webui.

I know how can I access to data via debugging:
this is the pass
me->typed_context->header->collection_wrapper -> COLLECTION_REF -> IF_BSP_WD_COLLECTION_REF~COLLECTION -> ENTITY_LIST -> CONTAINER_PROXY -> Data_Ref -> ATTRIBUTE_REF

But with coding I dont know how can I read it!

I can read until get_Current() but I do not kno how can I access to it

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

Any help would be appreciate!

Regards
Sin

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

1 Answer

Best Answer
Bruno Garcia Oct 04, 2017 at 10:17 AM
1

Hi Sin,

Then, with your LR_ENTITY; you can read the desired properties like this:

lv_value = lr_entity->if_bol_bo_property_access~get_property_as_string( iv_attr_name = 'SOME_PROPERTY' ).

Or, if you know the structure data type, you can read all parameters at once like this:

DATA ls_properties TYPE CRMST_HEADER_OBJECT_BUIL.<br>lr_entity->get_properties( IMPORTING es_attributes = ls_properties ).

Try to search for keywords like BOL or GENIL_MODEL_BROWSER to learn more about this, but meanwhile check if this helps you a little more.

This page might also help a little.

Kind regards,
Garcia

Show 5 Share
10 |10000 characters needed characters left characters exceeded

Hi Garcia,

Thanks for your help.

This is working for me... But the only way is to use Bol, yes?

Both of these soloutions are using BOL

Regards
Sin

0

Hi Sin,

The models behind WebUI components are using BOL, so I'd strongly advise to use it.

This doesn't mean that you can only use BOL to fetch some business data. You can still use some CRM API's (ex: CRM_ORDER_READ function module) to fetch/manipulate business data (BOL does that as well), but I would stick with BOL inside WebUI framework.

Kind regards,
Garcia

1

Hi Bruno,

Thanks a lot for your help!
Kind Regards
Sepide

0
Former Member
s sin

Hi Sin,

Although you have other ways to read/accesss data, BOL is the best way because the moment you load web ui and search for a particular component, CRM loads all the objects and its data into BOL layer. So have data available readily and you can play around with this data.

So what happens if you use other alternatives (like crmd_order_read or direct select stmts etc)?

This may leads to a performance issues and at the same time data inconsistencyissues may raise.

So prefer using BOL.

plz let me know if you need further explanation.

1

Hi Kiran,

Thank you so much for your good explanation!!

0