cancel
Showing results for 
Search instead for 
Did you mean: 

OnEnter Action

Former Member
0 Kudos

Hi,

In my table first field is cost center & second field is Company code.Cost center field has search help. So based on the cost center i have selected corresponding company code should come in the company code field. So i have written code inside onenter action. My problem is based on cost center i am getting company code. But it is coming in all the table fields. How can i avoid that one.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi hima.......

what you can do is...... when you are filling the compony code... fill it only for the row to whic it is required... pass it only to that row.. you might be passing it to the whole table... instead pass it to only one row.

---regards,

alex b justin

Former Member
0 Kudos

Hi Alex,

How can i recognize each row.

Former Member
0 Kudos

hi hima.....

anyway you are getting the value that is stored in the first column....

by getting so you can also get the index....

with that index update the internal table with the correct value.

or

update the whole internal table column2 with respect to the column1 value.

---regards,

alex b justin

Former Member
0 Kudos

Hi,

Actually me also have written the code like that only. Using index i have set the attribute . But then also i am getting values in all the rows. why its happening like that..

I have written the code like this.

data: lr_node type ref to if_wd_context_node,

itemlist type standard table of if_view5=>element_MAINTABLE,

w_itemlist like line of itemlist,

lt_csks type STANDARD TABLE OF csks,

w_csks like line of lt_csks,

v_index type i VALUE 1,

v_text type string,

v_text1 type string.

lr_node = wd_context->get_child_node( 'MAINTABLE' ).

lr_node->get_static_attributes_table( IMPORTING table = itemlist ).

  • v_index = lr_node->get_lead_selection_index( ).

CLEAR w_itemlist.

READ TABLE itemlist INTO w_itemlist INDEX v_index.

v_text = w_itemlist-attr1.

  • select bukrs from csks into v_text1 where kostl = v_text.

select bukrs from csks into CORRESPONDING FIELDS OF TABLE lt_csks where kostl = v_text.

READ TABLE lt_csks INTO w_csks INDEX v_index.

v_text1 = w_csks-bukrs.

wd_context->set_attribute( EXPORTING index = v_index value = v_text1 name = 'ATTR2' ).

Actually im stuck up with that one..

Can u give any suggestion regarding this code.

Former Member
0 Kudos

hi hima......

consider changing your code a liitle.... such that..

initialy your itab will be like

cost centre company code

12213

13443

so once you load the company code... it will be like

cost centre company code

12213 1000

13443 1100

so bind it again to the same node using bind_table method.

it works.

---regards,

alex b justin