cancel
Showing results for 
Search instead for 
Did you mean: 

Create a attribute under model context node

Former Member
0 Kudos

Hi Friends,

Bt115it_slso component has view Items, which has a table context node ( to show order item details ) - BTADMINI which is bound to a model node BTAdminI.

Now are the fields in this model node are available for us. But my requirement is to bring one dummy field onto this Item table.

I need this dummy field ( this doenst have any model node attribute ) user allowed to enter some value in that field, i have to do some validation using that value.

So i dont need that value to be saved in the backend.. Is it possible ? How can i add a field onto this item table which doenst have any associate model attribute, as i dont need this value to be saved.

please resppond.

thanks

Niraja

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jon,

For adding Global varibales, go to your view controller class. Enter the paramter name. Select the level value as 'Static attribute' from the F4 help and Visibility as 'Public'.Enter you data type.This acts as global variable.

Regards,

Lakshmi.Y

former_member214667
Contributor
0 Kudos

Hi Niraja,

If you need to add a dummy field which is relevant only on UI layer and does not need to be saved, then you just need to add a value attribute to the context node. To do this, you need to enhance the concerned view and then add the attribute to the right context node. You can refer to the following wiki that describes how to enhance a Web UI component :

http://wiki.sdn.sap.com/wiki/x/6ADACg

After you add this attribute, you can then pull it on your layout from the configuration tool.

Regards,

Shiromani

Former Member
0 Kudos

Hi Shiromani,

Did you try this? I am not able to add any value attribute to BTADMINI node of items view??

I am not able to add as the wizard's value node radio button is disabled..

Can anybody tell me how to do this?

If I manually create getter and setter methods is it possible ?? if yes what should be code in get and set method??

Former Member
0 Kudos

Hi Niraja,

I tried adding it the way it is discussed and I am able to add value attribute.

Can you please check if you enhanced component, then view and the BTADMINI context node by right clicking and choosing 'Enhance'. There should not be any problem in adding value attribute to a model node.

I hope it helps.

Thanks,

Rohit

Former Member
0 Kudos

instead of value node, i created a EEWB field at item level.

now in the table context BTADMINI, i created a model node attribute( BTCustomerI ) by right clicking the BTADMINI Context.

The getter setter were generated..... ( in the wizard it didnt ask me bind the relation between BTADMINI and new BTCustomerI-attribute )..

i brought this field on UI, but this is always showing in read only mode..... so i went to get, set and get_I methods, and used

below code --

DATA: current TYPE REF TO if_bol_bo_property_access.

rv_disabled = 'TRUE'.

IF iterator IS BOUND.

current = iterator->get_current( ).

ELSE.

current = collection_wrapper->get_current( ).

ENDIF.

TRY.

DATA: coll TYPE REF TO if_bol_entity_col.

DATA: entity TYPE REF TO cl_crm_bol_entity.

entity ?= current.

coll = entity->get_related_entities(

iv_relation_name = 'BTItemCustExt' ). "#EC NOTEXT

current = coll->get_current( ).

IF current IS NOT BOUND. (BUT current is not bound always - BTADMIN Has no relationship created for BTCustomerI, so its hitting RETURN and going rv_disabled = TRUE )

RETURN.

ENDIF.

IF current->is_property_readonly(

'ATTR1' ) = abap_false. "#EC NOTEXT

rv_disabled = 'FALSE'.

ENDIF.

Why does the relationship not getting created between BATAMINI and BTCustomerI ??

Could you please tell me what is missing here? Its pretty staright forward, as we know EEWB Field at item level can be created anywhere in UI using BTCustomerI.... But this is not working.. im on crm 6.0

Former Member
0 Kudos

i was able to do this by creating the relation for BTCustomerI

coll = entity->create_related_entitiy(

iv_relation_name = 'BTItemCustExt' ). now that field is coming in edit mode....

but i still not getting how can i create a value node in BTADMINI.. i have a structure ZVALUENODE with 3 fields..

now could you explain me how i can do this..

Former Member
0 Kudos

Shiromani,

Do you know how I can add a global variable (from the conmtroller class) so that I can include these into the view as text boxes and when changed have the value updated in the global variable.

I've never used global variables in this and noticed that using the context wizard does not allow me to set this up.

Any help would be much appreciated.

John Sappora

Former Member
0 Kudos

Jon Sappora

Do you know you can also post a new question, instead of using some others post?

Make sense ?????