cancel
Showing results for 
Search instead for 
Did you mean: 

Select options propertis change

Former Member
0 Kudos

Hi all,

I have a select options initialized into the method WDDOINIT of a view as follows:

wd_this->m_handler->add_selection_field( i_id = 'KUNNR'

it_result = lt_range_table

i_read_only = read_only

i_no_extension = abap_false

i_no_intervals = abap_false ).

in this view I arrive from another one by cliccking one of 4 links, I would like that only in 1 of this case the select options above is without intervals and extension, so I call into each method HANDLEFROM_LINK the method upd_selection_field.

in that one the select options should have no interval and extension I write following code:

CALL METHOD wd_this->m_handler->upd_selection_field

EXPORTING

i_id = 'KUNNR'

i_no_extension = abap_true

i_no_intervals = abap_true.

in all the other ones instead I write:

CALL METHOD wd_this->m_handler->upd_selection_field

EXPORTING

i_id = 'KUNNR'

i_no_extension = abap_false

i_no_intervals = abap_false.

this unfortunately doesn't work very well during the navigation, what happends is, when I click the first time a link it take the correct properties for the select options, but if I come back to the previous view and click another link It take again the properties of the first link clicked...

Any suggest for me?

thanks in advance

GN

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I solved the issue, I saw that it doesn't work after first time beacuse into the method upd_selection_fields the internal table <added_fields> was filled only the first time, this as into I call add_selection_fields only into WDDOINIT, so I set the vies property LIFETIME = when visible and before call add_selection_field I call the method remove_selection_fields_item in order to avoid a dump due to the addition of an object already existent, than into the Handle_link methods I manage the option of select option through the upd_selection_fields and it works.

Former Member
0 Kudos

Good job.

Former Member
0 Kudos

What I saw in debug is that during upd_selection_field execution the attribute MT_FIELDS is filled only when I call the first link and the method works, then I push back, and click on another link this time that attribute is empty, following read fails:

read table mt_added_fields

with key m_id = <field>-m_id

assigning <added_field>.

if sy-subrc = 0.

<added_field> = <field>.

  • if field is a new added field, any property can be changed

<original_field> = <field>.

else.

if is_changeable_property = abap_true.

delete mt_changed_fields where table_line = <field>-m_id.

insert <field>-m_id into table mt_changed_fields.

  • if field is not new only a subset of properties can be changed

<original_field>-mt_range_table = <field>-mt_range_table.

<original_field>-mt_value_set = <field>-mt_value_set.

<original_field>-m_is_nullable = <field>-m_is_nullable.

<original_field>-m_format_properties = <field>-m_format_properties.

endif.

endif.

So <added_field> is not updated... could this help you to understand my error?

Former Member
0 Kudos

I am using separated inbound plugs... but it doesn't work anymore... I am desperate... please help me!!!

Former Member
0 Kudos

so what you are saying is that when you do this in the inbound plug of the window

ALL METHOD wd_this->m_handler->upd_selection_field

EXPORTING

i_id = 'KUNNR'

i_no_extension = abap_false

i_no_intervals = abap_false.

it is not working ? Have you seen this debug that this code executes. If that is true , you have to check that this is not overwritten in any other place.

If everything is correct and still not working then the problem very well be in the m_handler .

Former Member
0 Kudos

My problem is not on WDDOINIT but into the HANDLE method linked to the inbound plugs, is there that I call methods upd_selection_field which looks work fine only the first time...

Former Member
0 Kudos

has each link connected to separate inbound_plug.

In that case i would expect that it should work.

You can also use the same inbound_plug but with some parameters in the importing. Based on the incoming parameter you set the values for select options.

Former Member
0 Kudos

The hookmethod wddoint is called by the framework only once during the life time of the view. Hence when you are coming to the view second time , it does not go to WDDOINT method.

You can solve this by

1. setting the view->properties->lifetime to change to when visible.

OR

2. Move this logic in wddoint to another method and call it in the plughandler methods.