Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Automatic fill of Inputfield2 when Inputfield1 is filled manually

Hi all gurus,

I need your help for an issue I'm not able to manage.

This is the scenario: in srm7, an header custom table is used in web dynpro /SAPSRM/WDC_DODC_CT (view V_DODC_CT) and the user can fill 5 values in it.

In particular, some fields depend on the value filled in another field: consider, for example, the couple:

ZVENDOR and ZVENDOR_DESCRIPTION (names say it all).

Actually I associated an OVS search help to ZVENDOR, so that when the user select a Vendor code from the OVS list, then:

ZVENDOR is filled with that code and

ZVENDOR_DESCRIPTION is filled too, on the basis of the selection table entry which has been chosen.

That's the stuff that works... Now, the trouble: the user could also introduce a value for ZVENDOR manually and press ENTER. This doens't trigger obviously the OVS search help for the field; as a consequence ZVENDOR_DESCRIPTION is not populated.

I'm looking then for a way to replicate the OVS behaviour also for manual insertion, but...

- the logic on which the selection list in OVS is build is quite complex... is it possible to reuse the OVS behaviour or should I replicate the logic in a separate method?

- I was thinking to introduce a sketch of code like the following in WDDOMODIFYVIEW (note that the table is binded dinamically):

DATA: vendor_desc_value TYPE ZR7_PROLE_DESC.

CALL METHOD lo_tabnode->get_attribute
*    index  = USE_LEAD_SELECTION
    name   = 'ZVENDOR'
    value  = vendor_value.

CALL METHOD lo_tabnode->get_attribute
*    index  = USE_LEAD_SELECTION
    value  = vendor_desc_value.

*if vendor_value is filled and vendor_desc_value not, then:
* 1) calculate the corresponding description (is it possible to use OVS?)
* 2) lo_tabnode->set_attribute for ZVENDOR_DESCRIPTION with the retrieved value.

Don't know if there's a better way to do that; if this could be a fine solution, could you please help me defining point 1) ?

Thanks again.


Former Member replied


I have gone through the code of WDDOMODIFY of the component.


Create Post exit instead of Overwrite exit.

Get the column ZVENDOR in the Post exit :

DATA : lr_table type ref to cl_wd_table,

lr_column type ref to cl_wd_table_column,

lr_input_field type ref to cl_wd_input_field,

lr_editor type ref to cl_wd_uielement.

lr_table->get_column( EXPORTING ID = 'ZVENDOR' RECEIVING the_column = lr_column ).

call method lr_column->get_table_cell_editor RECEIVING the_table_cell_editor = lr_input_field

" IF the above method call gives error.then use below code

call method lr_column->get_table_cell_editor RECEIVING the_table_cell_editor = lr_input_field

lr_input_field = lr_editor.

After this, you can treat the lr_input_field as normal input field and use the code in previous mails to set the ON_ENTER .

I hope this helps.



0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question