cancel
Showing results for 
Search instead for 
Did you mean: 

Binding each cell of a particular column of table to different data element

Former Member
0 Kudos

Hi All,

I need to have a table like this ( has 2 columns FieldName, Val

Field Name Value

Name XYZ

City Bangalore

Country IN

The problem is that each cell in value column should be bound to different type of data element based on the field name.

So that proper F4 help comes for Values for city, country etc.

Any idea how this can be achieved.

Regards

Manas Dua

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please refer this thread -

Please elaborate your requirement.

Regards,

Lekha.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I've solved this problem with the hepl of cell vairant - table standard cell.

My table structure was something like this

Field_Name.................................... Value

And Data was like this

_______________________________________________________________________

Field_Name...................................................Value

_______________________________________________________________________

Country..........................................................US

Region............................................................AL

Postal_Code..................................................121

____________________________________________________________________________

Intially to hold this data I created a node as

Address - 0..n

.........Field_Name - string

.........Value - string

.........Cell_Key - string

I filled Address node like this

ls_address-field_name = lv_medium_text. "Country

ls_address-Value = wd_comp_controller->mr_address_data-country. " US

ls_address-cell_key = '1'. " Cell Variant Key for Country

append ls_address to lt_address.

ls_address-field_name = lv_medium_text. "Region

ls_address-Value = wd_comp_controller->mr_address_data-region. " AL

ls_address-cell_key = '2'. " Cell Variant Key for region

append ls_address to lt_address.

ls_address-field_name = lv_medium_text. "Postal_code

ls_address-Value = wd_comp_controller->mr_address_data-postal_code " 121

ls_address-cell_key = '3'. " Cell Variant Key for Postal_Code

append ls_address to lt_address.

Then I created One more node which will contain Value in its original format ( in address node they were string ). This node will be bound to input fields created in respective cell editors

Validated_Addr - 1..1

.........Country - ADRC_STRUC-COUNTRY

.........Region - ADRC_STRUC-REGION

.........Postal_Code - ADRC_STRUC-POST_CODE1

This node was filled something like this

ls_validated_addr-new_addr_country = wd_comp_controller->mr_address_data-country.

ls_validated_addr-new_addr_region = wd_comp_controller->mr_address_data-region.

ls_validated_addr-new_addr_postcode = wd_comp_controller->mr_address_data-post_code1.

Now Comes the UI part -

In table column for Value I created 3 Cell Variants of Type Table Standard Cell

CV_COUNTRY.............VairantKey = 1.................."Cell Variant for Country

CV_REGION .............VairantKey = 2.................."Cell Variant for Region

CV_POST_CODE..........VairantKey = 3.................."Cell Variant for Postal_Code

For each of these cell variants I created Input Fields and binded them to Validated_Addr Node respective attritbutes so that these input fields contain data of those respective types.

In the last step I binded the SelectedCellVariant property of Table Columns Values to Cell_Key field of Address Node.

And thats it -


my input fields in Value Column were containing the required F4 helps and were accepting data of required types.

Regards

manas dua

Former Member
0 Kudos

hi,

What you can do is :

On the lead selection of any Row in this Table ,change the search help based on Field1 value - whether it is Name ,City or Country.

1. On Lead selection of Row, check the value of Field 1.

2. Based on this , assign Search help to Field2.

To dynammically Assign/a Search help , Refer this :

data lo_nd_info type if_wd_context_node_info.

lo_nd_info = lo_nd->get_node_info( ).

CALL METHOD lo_nd_info->set_attribute_value_help

EXPORTING

name = 'ATTR1' " Your attribute Name

value_help_mode = '121' " Valid value help mode

value_help = 'Z187442'. " Search help name

The various possible values that you can pass to value_help_mode are as shown below.

deactivated 101

automatic 111

ddic 121

ovs 131

I hope this would help.